Giovany Mito Posted July 17, 2019 Share Posted July 17, 2019 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
Investor Posted July 17, 2019 Share Posted July 17, 2019 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
Giovany Mito Posted July 17, 2019 Author Share Posted July 17, 2019 as do that? I've tried to rewrite this line anyway Link to comment
Dimos7 Posted July 18, 2019 Share Posted July 18, 2019 If you want kick player you need kickPlayer No banPlayer 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