MaRcell Posted March 4, 2020 Share Posted March 4, 2020 well, I did this system of banning player by command, but it is not going, I write / iban ID, days and nothing happens .. will there be a problem with the account I made addCommandHandler("iban", function(playerSource, commandName, id, days, ...) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup ("Admin")) then if(id) then local playerID = tonumber(id) seconds = tonumber(seconds) or 60 if(playerID) then local targetPlayer = getPlayerID(playerID) if targetPlayer then local seconds = days*86400 local reason = table.concat({...}, " ") if ( hasObjectPermissionTo (playerSource, "function.banPlayer" ) ) then outputChatBox("#00FFFFO jogador "..getPlayerName(targetPlayer).." foi banido por ".. tostring(seconds).." dias por "..getPlayerName(playerSource)..". Motivo: "..reason..".",root,0,0,0,true) banPlayer(targetPlayer , false, false, true, getRootElement(), reason, seconds) end end end end end end) Link to comment
Addlibs Posted March 4, 2020 Share Posted March 4, 2020 getPlayerID isn't an MTA function; could you show us it's code as well? Also, did you add the resource into admin ACL too? It needs to be privileged to use the function 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