- 88
- 19
- Версия MoonLoader
- Другое
мне нужно выдать id человека из сообщения, у меня есть такой код, что не так? когда человек что то написал в чат, его id ни в консоль, ни в чат не отправляется
Lua:
local sampev = require ('samp.events')
local encoding = require("encoding")
encoding.default = 'CP1251'
u8 = encoding.UTF8
function main() if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
end
function sampev.onServerMessage(color, text)
if text:find("(.+)%[(%d+)%] говорит: (.+)") then
nick, id, message = text:match("(.+)%[(%d+)%] говорит: (.+)")
print(id)
sampSendChat(id)
end
end