Jump to content

bad Argument :D


golanu21

Recommended Posts

Posted
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

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

Posted
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.

Paid developer. Twitter: @willia_am -

http://www.williamdasilva.fr

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...