- 506
- 161
Lua:
local event = require('samp.events')
myfont = renderCreateFont("arial", 10, 5)
local list = {}
function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand('cmode', function()
cmode = not cmode
msg('Режим чекера изменен на: {bd8a00}'..(cmode and 'Сообщения в чате' or 'Лист под чатом')..'{808080}.')
if cmode then list = {} end
end)
while true do wait(0)
if not cmode and #list ~= 0 then
for i, str in pairs(list) do
renderFontDrawText(myfont, '{808080}'..str, 10, 500 + renderGetFontDrawHeight(myfont) * (i - 1), 0xFFFFFFFF)
end
if #list > 5 then
table.remove(list, 1)
end
end
end
end
function event.onPlayerQuit(id, reason)
for i = 0, 1004 do
local result, _ = sampGetCharHandleBySampPlayerId(id)
if result and id == i and reason == 2 then
if cmode then
msg('Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} покинул сервер. Причина: кик/бан.')
else
table.insert(list, 'Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} покинул сервер. Причина: кик/бан.')
end
end
end
end
function event.onPlayerDeath(id)
for i = 0, 1004 do
local result, _ = sampGetCharHandleBySampPlayerId(id)
if result and id == i then
if cmode then
msg('Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} погиб.')
else
table.insert(list, 'Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} погиб.')
end
end
end
end
function msg(text)
return sampAddChatMessage('[KickChecker]: {808080}'..text, 0xbd8a00)
end
А должно вывести такLua:local event = require('samp.events') myfont = renderCreateFont("arial", 10, 5) local list = {} function main() repeat wait(0) until isSampAvailable() sampRegisterChatCommand('cmode', function() cmode = not cmode msg('Режим чекера изменен на: {bd8a00}'..(cmode and 'Сообщения в чате' or 'Лист под чатом')..'{808080}.') if cmode then list = {} end end) while true do wait(0) if not cmode and #list ~= 0 then for i, str in pairs(list) do renderFontDrawText(myfont, '{808080}'..str, 10, 500 + renderGetFontDrawHeight(myfont) * (i - 1), 0xFFFFFFFF) end if #list > 5 then table.remove(list, 1) end end end end function event.onPlayerQuit(id, reason) for i = 0, 1004 do local result, _ = sampGetCharHandleBySampPlayerId(id) if result and id == i and reason == 2 then if cmode then msg('Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} покинул сервер. Причина: кик/бан.') else table.insert(list, 'Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} покинул сервер. Причина: кик/бан.') end end end end function event.onPlayerDeath(id) for i = 0, 1004 do local result, _ = sampGetCharHandleBySampPlayerId(id) if result and id == i then if cmode then msg('Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} погиб.') else table.insert(list, 'Игрок {bd8a00}'..sampGetPlayerNickname(id)..' ['..id..']{808080} погиб.') end end end end function msg(text) return sampAddChatMessage('[KickChecker]: {808080}'..text, 0xbd8a00) end