I tried to do it by myself but i failed.
I want the command by like this: !warn <id> <reason>
And when player reach 3 warns he get kicked
Can someone help me ?
2× editiert, zuletzt 17.05.18 08:48:22
Scripts
Warn
Warn
1

warn = {}
addhook("say","wsay")
function wsay(id,txt)
if string.sub(txt:lower(),1,5) == "!warn" then
local s, targ, reas = txt:find(" ",7)
targ, reas = tonumber(txt:sub(7,s-1)), txt:sub(s+1)
if targ and reas then
warn[targ]=warn[targ]+1
if warn[targ]>=3 then
parse("kick "..targ.." \""..reas.."\"")
else
msg2(targ,"You've been warned for such reason! : "..reas)
end
else
msg2(id,"Error: Target is missing or the reason.")
end
end
end
addhook("leave","winit")
addhook("join","winit")
function winit(id)
warn[id]=0
end
_oops:
1
