Alazam Posted February 11, 2014 Share Posted February 11, 2014 Hello i have this error and player dont go in team why ? teamgroove = createTeam ( "Groove", 26, 124, 15 ) teamballas = createTeam ( "Ballas", 69, 21, 132 ) teamvagos = createTeam ( "Vagos", 172, 153, 28 ) teamcops = createTeam ( "Cops", 20, 63, 208 ) function groovespawn() spawnPlayer(client, 2495, -1686, 13) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("You are a groove", client) giveWeapon ( source, 1, 1 ) giveWeapon ( source, 28, 500 ) giveWeapon ( source, 25, 500 ) setPlayerTeam( source, teamgroove) end function ballasspawn() spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("You are a ballas", client) giveWeapon ( source, 1, 1 ) giveWeapon ( source, 32, 500 ) giveWeapon ( source, 30, 500 ) setPlayerTeam( source, teamballas) end function vagosspawn() spawnPlayer(client, 1959.55, -1634, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("You are a vagos", client) giveWeapon ( source, 1, 1 ) giveWeapon ( source, 29, 500 ) giveWeapon ( source, 33, 500 ) setPlayerTeam( source, teamvagos) end function copsspawn() spawnPlayer(client, 1575, -1634, 13) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("You are a cops", client) giveWeapon ( source, 31, 500 ) giveWeapon ( source, 17, 3 ) setPlayerTeam( source, teamcops) end Link to comment
Damien_Teh_Demon Posted February 11, 2014 Share Posted February 11, 2014 use lua tags , not code Also, you need to have this serverside, and use the event onPlayerWasted, like so function doThings --spawning code end addEventHandler("onPlayerWasted", getRootElement(), doThings) Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 I have addEvent("grooveevent",true) addEvent("ballasevent",true) addEvent("vagosevent",true) addEvent("copsevent",true) addEventHandler("grooveevent",root,groovespawn) addEventHandler("ballasevent",root,ballasspawn) addEventHandler("vagosevent",root,vagosspawn) addEventHandler("copsevent",root,copsspawn) And client side script its not that the question i just want to know how to fix the error Link to comment
Damien_Teh_Demon Posted February 11, 2014 Share Posted February 11, 2014 I just told you to use the event onPlayerWasted Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 If i use on player wasted the team is not set when player spawn Link to comment
Damien_Teh_Demon Posted February 11, 2014 Share Posted February 11, 2014 then set the team manually, make the team via script, then setPlayerTeam Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 what i have do? .... Link to comment
Damien_Teh_Demon Posted February 11, 2014 Share Posted February 11, 2014 Its something along these lines team = createTeam("Name", r,g,b) addEventHandler"onPlayerWasted",getRootElement(), function() setPlayerTeam(source,team) end) Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 you are stupid? i have say when they spawn Link to comment
Moderators IIYAMA Posted February 11, 2014 Moderators Share Posted February 11, 2014 addEventHandler("onPlayerSpawn",root, function () end) Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 if i set a on playerspawn how i can know the team of the player? i have a gui with 4 button each for 1 team/spawn/weapon Link to comment
xDrul Posted February 11, 2014 Share Posted February 11, 2014 Change the 'source' @ setTeam to client Link to comment
Alazam Posted February 11, 2014 Author Share Posted February 11, 2014 thank i going to try that next time 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