Norhy Posted February 22, 2012 Share Posted February 22, 2012 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 Zango Posted February 22, 2012 Discord Moderators Share Posted February 22, 2012 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
Norhy Posted February 22, 2012 Author Share Posted February 22, 2012 ... I'm a noob, i should check everything before posting ... Anyway thank you, i hope this problem will never appear. 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