GamingTim Posted February 9, 2014 Share Posted February 9, 2014 Alright i'm totally new to coding but i know "some" basics. I'm not sure on how to set a player to an admin team if he's an admin when he joins. I created a team on the default MTA admin panel but when I reconnect it doesn't set the player which was added as an admin to the admin team. what code should I add? or which ones should i use? Link to comment
Anubhav Posted February 9, 2014 Share Posted February 9, 2014 local team = createTeam("Admin",255,255,255) function team() if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam(source,Admin) else cancelEvent() end addEventHandler("onPlayerJoin",thePlayer,team) Link to comment
GamingTim Posted February 9, 2014 Author Share Posted February 9, 2014 Thanks but it didn't work so i changed the onPlayerJoin to onPlayerLogin still the same. Link to comment
DNL291 Posted February 9, 2014 Share Posted February 9, 2014 local team = createTeam("Admin",255,255,255) function setTeam(_, acc) if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("Admin")) then setPlayerTeam(source, team) end end addEventHandler("onPlayerLogin",root, setTeam) Link to comment
GamingTim Posted February 9, 2014 Author Share Posted February 9, 2014 local team = createTeam("Admin",255,255,255) function setTeam(_, acc) if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("Admin")) then setPlayerTeam(source, team) end end addEventHandler("onPlayerLogin",root, setTeam) Thanks alot mate! 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