- 166
- 24
мне нужно чтобы время шло от 10 до 0 а оно наоборот идет, еще нужно приветствие при загрузе скрипта
луа:
local event = require('lib.samp.events')
local stColor = 0xFFFF0000
stop = 0
started = 0
prinato = 0
active_report = 0
active_report2 = 0
function main()
repeat wait(0) until isSampAvailable()
while true do
wait(0)
if isKeyDown(74) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
while isKeyDown(74) do wait(0) end
if(active_report == 2) then
sampSendChat("/"..cmd.." "..paramssss)
status("true", 1)
sampSendChat("/a [ReForma] Одобрено")
active_report2 = 1
end
end
end
end
function event.onServerMessage(color, text)
local reasons = {"kick", "mute", "jail", "jailoff", "sethp", "sban", "banoff", "muteoff", "sbanoff", "spplayer", "slap", "unmute", "unjail", "sban", "spcar", "ban", "sban", "warn", "skick", "setskin", "ao", "unban", "unwarn", "setskin", "skick", "banip", "offban", "offwarn", "plveh", "sban", "ptp", "o", "aad", "givegun", "avig", "aunvig", "setadmin", "givedonate", "spawncars",
"mpwin", "prefix", "asellhouse", "delacc", "asellbiz", "money", "test", 'iban'}
for k,v in ipairs(reasons) do
if text:match("%[.*%] (%w+_?%w+)%[(%d+)%]%: /"..v.."%s") then
started = started + 1
if started < 2 then
prikoll = "true"
admin_nick, admin_id, other = text:match("%[.+%] (%w+_?%w+)%[(%d+)%]%: /"..v.."%s(.*)")
cmd = v
paramssss = other
if stop == 0 then
lua_thread.create(function()
for i = 0, 5 do
if active_report2 == 0 then
status("false", i)
else
status("true", i)
end
end
if prikoll == "true" then
wait(550)
printStyledString("You missed form", 1000, 5)
active_report = 1
active_report2 = 0
started = 0
bbstart = -1
end
end)
end
end
end
end
end
function status(parsasm, ggbc)
if parsasm == "true" then
active_report2 = 1
prikoll = "false"
if ggbc == 5 then
active_report2 = 0
started = 0
end
active_report = 1
printStyledString("Admin form accepted", 5000, 5)
bbstart = -1
else
bbstart = -1
bbstart = bbstart + ggbc
if bbstart == 0 then
active_report = 2
end
if active_report2 == 0 then
wait(1000)
printStyledString('Admin form '..ggbc.." wait", 1000, 5)
end
end
end