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