Jump to content

ACL Group


Norhy

Recommended Posts

So, i created a new Group is ACL, "SWAT":

"SWAT"> 
        "SWAT">
        "user.Norhy"> 
    

Well, then i created a Script, that will create a Team on the start and check if the Player is in the ACL Group "SWAT". Something like Admin. There, i got problems :/. It says Bad argument @ addEventHandler.

Script

function createSWATTeamOnStart () 
    SWAT = createTeam ( "SWAT", 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot, createAdminTeamOnStart) 
  
function setAdminTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SWAT")) then 
   setPlayerTeam(source, SWAT)  
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setSWAT)  

Link to comment
  • Discord Moderators

Look at the function names you supply to addEventHandler, setSWAT and createAdminTeamOnStart does not exist.

function createSWATTeamOnStart () 
    SWAT = createTeam ( "SWAT", 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot, createSWATTeamOnStart) 
  
function setAdminTeam() 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SWAT")) then 
        setPlayerTeam(source, SWAT) 
    end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setAdminTeam) 

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