AlexWo Posted May 24, 2013 Share 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 Link to comment
Castillo Posted May 24, 2013 Share Posted May 24, 2013 You must use "onPlayerJoin", and not "onPlayerConnect". Link to comment
AlexWo Posted May 24, 2013 Author Share Posted May 24, 2013 Ok and the second Argument of "addEventHandler" is it ok like there? Link to comment
Castillo Posted May 24, 2013 Share 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. Link to comment
AlexWo Posted May 24, 2013 Author Share Posted May 24, 2013 Ok it is working now. Thank you very much 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