Jump to content

HELP Kick


Recommended Posts

 

  function kikarplayer (theClient, commandName, kickedName, ...) 
        local account = getAccountName (getPlayerAccount (theClient))
     	if isObjectInACLGroup ("user."..account, aclGetGroup ("Admin")) then 
		   if not ... then
                return outputChatBox ("#bf2e2e* Erro: /kick [nick] [motivo]",theClient,255,255,255,true) 
            end 
            local reason = table.concat({...}," ") 
            local kickerName = getPlayerName(theClient):gsub("#%x%x%x%x%x%x","") 
            local kickedPlayer = getPlayerFromName(kickedName) 
            if not isElement(kickedPlayer) then 
                outputChatBox ("#bf2e2e* Erro: Player Invalido!",theClient,255,255,255,true) 
            end 
            outputChatBox ( "#c9c9c9[#1a6cefFW-INFORMA#c9c9c9]O #1a6cef" .. kickerName .. "  #c9c9c9Kickou o Player #1a6cef" ..getPlayerName(kickedPlayer):gsub("#%x%x%x%x%x%x","").. "#c9c9c9 | Motivo #1a6cef" ..reason.. "#c9c9c9", getRootElement(), 255, 0, 0, true )  
            banPlayer ( kickedPlayer, theClient, reason ) 
        else 
            outputChatBox ("#bf2e2e* Erro: Você Não tem Permissão!",theClient,255,255,255,true) 
        end 
    end 
    addCommandHandler ( "kick", kikarplayer )

Error  

 ERROR: Loading script failed: [FW]Comandos/Server.Lua:4: unexpected symbol near '�'
Link to comment
Quote

�

doesn't seem to appear in the provided script, which could mean encoding problems. Anyway, while checking the code I also found it to contain a couple U+FEFF characters (ZERO WIDTH NO-BREAK SPACE). The bytes 0xFEFF are apparently also used by UTF-8 for BOM (Byte Order Mark) which could be part of encoding issues, perhaps. Best would be to simply filter out invisible and special characters which shouldn't be there.

Link to comment

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