AlexWo Posted May 24, 2013 Posted May 24, 2013 Hello I want to make a team script. I want that every player who enters the server will be setted to "Unemployed" group. The script is only Server: Staff = createTeam("Staff", 255, 255, 255) Unemployed = createTeam("Unemployed", 200, 200, 255) function StaffTeam (thePlayer) setPlayerTeam (thePlayer, Staff) setElementModel (thePlayer, 217) setElementHealth(thePlayer, 100) setPedArmor(thePlayer, 100) end addCommandHandler( "staff", StaffTeam) function setteam(thePlayer) setPlayerTeam (thePlayer, Unemployed) end addEventHandler ("onPlayerConnect", root, setteam) I'm not sure how to manage the addEventHandler Thank you for helping me
Castillo Posted May 24, 2013 Posted May 24, 2013 You must use "onPlayerJoin", and not "onPlayerConnect". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
AlexWo Posted May 24, 2013 Author Posted May 24, 2013 Ok and the second Argument of "addEventHandler" is it ok like there?
Castillo Posted May 24, 2013 Posted May 24, 2013 The rest is good, just change the event and the arguments used, since "onPlayerJoin" has no player argument, use 'source' instead. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted May 24, 2013 Posted May 24, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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