Jump to content

Team spawn


Mike269

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...