Jump to content

Add ACL Team


Akranes123

Recommended Posts

Hello, Greetings to all, Well I am doing a script that when from a computer from the Admin panel I automatically add it to an ACL group

this is my code

I get error does not add me to acl, please help


function tag( thePlayer)
 local team = getPlayerTeam( thePlayer )
 conta = getAccountName(getPlayerAccount(source))
 if ( getTeamName( team ) == "**Militar**" ) then
    aclGroupAddObject (aclGetGroup("Militar"), "user."..conta)
  end
end

Edited by Akranes123
Link to comment

you need an event to trigger that function.

EX:

when player spawns it will check if player is in team Militar

function tag(thePlayer)
 local team = getPlayerTeam( thePlayer )
 conta = getAccountName(getPlayerAccount(source))
 if ( getTeamName( team ) == "**Militar**" ) then
    aclGroupAddObject (aclGetGroup("Militar"), "user."..conta)
  end
end
addEventHandler("onPlayerSpawn", getRootElement(), tag)

 

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