Mike269 Posted August 27, 2015 Share Posted August 27, 2015 Hello, well I've made a 3 teams Civilians, Army and Terrorists, (If you're not in any team you automaticly join Civilians) That's my code, but the problem is that when I reconnect/die I don't spawn at the position I wrote, help please! team = { } team["Civilian"] =createTeam ( "Civilian", 102, 0, 102 ) team["Army"] =createTeam ( "Army", 102, 51, 0 ) team["Terrorists"] =createTeam ( "Terrorists", 204, 0, 0 ) function lena(thePlayer) local playerTeam = getPlayerTeam ( player ) local ss = getTeamName ( playerTeam ) if ss=="Vampires" then setTimer(azaz, 1800, 1, player) outputDebugString("It's works") setTimer(setElementPosition, 1800, 1 ,1094.7105712891,2092.7939453125,15.350400924683 ) elseif ss=="Werewolves" then setTimer(setElementPosition, 1800, 1 ,7105712891,2092.7939453125,15.350400924683 ) outputDebugString("It's works") elseif ss=="Civilians" then setTimer(setElementPosition, 1800, 1 ,7105712891,2092.7939453125,15.350400924683 ) outputDebugString("It's works") end end addEventHandler("onPlayerWasted",getRootElement(),lena) Link to comment
iMr.SFA7 Posted August 27, 2015 Share Posted August 27, 2015 try team = { } team["Civilian"] = createTeam ( "Civilian", 102, 0, 102 ) team["Army"] = createTeam ( "Army", 102, 51, 0 ) team["Terrorists"] = createTeam ( "Terrorists", 204, 0, 0 ) addEventHandler("onPlayerWasted",root, function ( ) local Playerteam = getPlayerTeam ( source ) local teamName = getTeamName ( Playerteam ) if ( teamName == "Terrorists" ) then outputDebugString("It's works") setTimer(setElementPosition, 2000, 1 ,source, 1094.7105712891,2092.7939453125,15.350400924683 ) elseif ( teamName == "Army" ) then setTimer(setElementPosition, 2000, 1 ,source, 7105712891,2092.7939453125,15.350400924683 ) outputDebugString("It's works") elseif ( teamName == "Civilian" ) then setTimer(setElementPosition, 2000, 1 ,source, 7105712891,2092.7939453125,15.350400924683 ) outputDebugString("It's works") end end ) Link to comment
Mike269 Posted August 27, 2015 Author Share Posted August 27, 2015 It's working, thank you very much! But how can I make a spawn for each team when they join, like for civlians when they join for first time, I stopped gamemode play because it was keep changing my skin so I guess I have to make my own spawns... Link to comment
Mike269 Posted August 27, 2015 Author Share Posted August 27, 2015 well I was wrong, play has to be turned on or I can't spawn, but the problem is my skin always change to CJ, what can I do? Link to comment
iMr.SFA7 Posted August 27, 2015 Share Posted August 27, 2015 well I was wrong, play has to be turned on or I can't spawn, but the problem is my skin always change to CJ, what can I do? use setElementModel 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