Lloyd Logan Posted January 19, 2013 Posted January 19, 2013 Hey, so i made a GUI and when you click "join" it sets you to the team, but its not working! team = createTeam ( "Bus Driver", 0, 255, 0 ) function teamSet(thePlayer, team) setPlayerTeam( thePlayer, team) end addEvent("sTeam", true) addEventHandler("sTeam", thePlayer, teamSet)
Castillo Posted January 19, 2013 Posted January 19, 2013 Change "thePlayer" from addEventHandler to "root".
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 Change "thePlayer" from addEventHandler to "root". I did that, the db 3 now says, Bad Arguement @ 'setPlayerTeam'
3NAD Posted January 19, 2013 Posted January 19, 2013 createTeam ( "Bus Driver", 0, 255, 0 ) function teamSet ( ) local team = getTeamFromName ( "Bus Driver" ) if team then setPlayerTeam ( source, team ) end end addEvent ( "sTeam", true) addEventHandler ( "sTeam", root, teamSet ) if not working, put your client code.
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 It now says, Bad 'player' pointer at @ 'setPlayerTeam' client function joinTeam(thePlayer) triggerServerEvent("sTeam", getRootElement(), "teamSet") end It is triggering it, so i am guessing the problem is Server side?
Castillo Posted January 19, 2013 Posted January 19, 2013 function joinTeam() triggerServerEvent("sTeam", localPlayer, "teamSet") end
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 function joinTeam() triggerServerEvent("sTeam", source, "teamSet") end Will this work with your code, or 3NAD's?
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 Still nothing guys! server createTeam ("Bus Driver", 0, 255, 0 ) function teamSet ( ) local team = getTeamFromName ( "Bus Driver" ) if team then setPlayerTeam ( source, team ) end end addEvent ( "sTeam", true) addEventHandler ( "sTeam", root, teamSet ) client function joinTeam() triggerServerEvent("sTeam", source, "teamSet") end
3NAD Posted January 19, 2013 Posted January 19, 2013 At ' triggerServerEvent ', the source is not Defined. use ' localPlayer '
Lloyd Logan Posted January 19, 2013 Author Posted January 19, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' Atlast!! It works, Thank You!
Smart. Posted January 19, 2013 Posted January 19, 2013 You can use 'root' as argument at triggerServerEvent and then use 'client' as player argument server sided
Castillo Posted January 20, 2013 Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow.
3NAD Posted January 20, 2013 Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow. No problem, i Saw it
Lloyd Logan Posted January 20, 2013 Author Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow. Is that what was happening yesterday? I tried to get on sometimes it would let me and sometimes it would give me a HTTP 500 error. Normally the forums are ultra fast for me because of my connection l, oh well!
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