golanu21 Posted August 22, 2013 Share Posted August 22, 2013 local warn = {} function command (sourcePlayer, command, who) if not who then outputChatBox ( "No name was given." ) return end name = getPlayerFromName(who) if name then local accName = getAccountName ( getPlayerAccount ( sourcePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if not warn[ name ] then -- hasn't got a warning yet warn[ name ] = 1 else warn[ name ] = warn[ name ] + 1 --alredy has waring(s), so give one more outputChatBox("Administratorul " ..accName.." la avertizat pe : "..who..", si acum are "..warn[name].." avertisment(e)") end if warn[name] >= 3 then -- 3 warnings = ban banPlayer(who, sourcePlayer) end end end end addCommandHandler("warn", command) BAD ARGUMENT::: banPlayer Link to comment
FatalTerror Posted August 22, 2013 Share Posted August 22, 2013 local warn = {} function command (sourcePlayer, command, who) if not who then outputChatBox ( "No name was given." ) return end name = getPlayerFromName(who) if name then local accName = getAccountName ( getPlayerAccount ( sourcePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if not warn[ name ] then -- hasn't got a warning yet warn[ name ] = 1 else warn[ name ] = warn[ name ] + 1 --alredy has waring(s), so give one more outputChatBox("Administratorul " ..accName.." la avertizat pe : "..who..", si acum are "..warn[name].." avertisment(e)") end if warn[name] >= 3 then -- 3 warnings = ban banPlayer(who, sourcePlayer) end end end end addCommandHandler("warn", command) BAD ARGUMENT::: banPlayer ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] ) The first argument needs to be an player element, not his name. Check the wiki before post for these stuffs. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now