require ("lib.moonloader")
local samp = require ('lib.samp.events')
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
end
end
function samp.onServerMessage(color, text)
if text:find('.* /code (%d+) .*') then
code = text:match('.* /code (%d+) .*')
lua_thread.create(function()
wait(100)
sampAddChatMessage(code, -1)
sampSendChat('/code')
end)
end
end
function samp.onShowDialog(id, style, title, button1, button2, text)
if id == 1009 then
sampSendDialogResponse(id, 1, nil, tostring(code))
return false
end
end