Jump to content

Help | team


ghassen14

Recommended Posts

function team (source) 
local team1 = getPlayerTeam(source) 
local team2 = getTeamName(team1) 
if (team2 == "TEAM") then 
setElementPosition(source, x,y,z) -- if player is in team "TEAM" --> he will spawned on x,y,z 
elseif (team2 == "TEAM2") then 
setElementPosition(source, x,y,z) -- if player is in team "TEAM2" --> he will spawned on x,y,z 
else 
setElementPosition(source, x,y,z) -- if player is not in team --> he will spawned on next x,y,z 
end 
end 
addEventHandler("onPlayerWasted", getRootElement(), team) 

or

function team (source) 
local team1 = getPlayerTeam(source) 
local team2 = getTeamName(team1) 
if (team2 == "TEAM") then 
setElementPosition(source, x,y,z) -- if player is in team "TEAM" --> he will spawned on x,y,z 
else 
setElementPosition(source, x,y,z) -- if player is not in team --> he will spawned on next x,y,z 
end 
end 
addEventHandler("onPlayerWasted", getRootElement(), team) 

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