Jump to content

Spawn at base


Mike269

Recommended Posts

Hello guys.

team = { } 
team["staff"] =createTeam ( "Staff", 255, 255, 255 ) 
team["military"] =createTeam ( "Armed Forces", 29, 99, 6 ) 
team["swatteam"] =createTeam ( "S.W.A.T.", 0, 90, 255 ) 
team["lawenforcement"] =createTeam ( "Law Enforcement", 40, 147, 242 ) 
team["Criminal"] =createTeam ( "Criminal", 255, 0, 0 ) 
team["Communtiy"] =createTeam ( "Community", 255, 255, 0 ) 
team["medic"] =createTeam ( "Medic", 0, 255, 255 ) 
team["unemployed"] =createTeam ( "Unemployed", 209, 218, 106 ) 
team["EleCtriC KiLlerS"] =createTeam ( "EleCtriC KiLlerS", 0, 0, 0 ) 
team["The Magic Assassins"] =createTeam ( "The Magic Assassins", 43, 20, 184 ) 
  
function lena(thePlayer) 
local playerTeam = getPlayerTeam ( player ) 
local ss = getTeamName ( playerTeam )   
if ss=="The Magic Assassins" then 
setTimer(azaz, 1800, 1, player) 
outputDebugString("It's works") 
end 
end 
addEventHandler("onPlayerWasted",getRootElement(),lena) 
  
function azaz(player) 
setElementPosition(player,1094.7105712891,2092.7939453125,15.350400924683) 
end 
  
function lena(thePlayer) 
local playerTeam = getPlayerTeam ( player ) 
local ss = getTeamName ( playerTeam )   
if ss=="EleCtriC KiLlerS" then 
setTimer(azaz, 1800, 1, player) 
outputDebugString("It's works") 
end 
end 
addEventHandler("onPlayerWasted",getRootElement(),lena) 
  
function azaz(player) 
setElementPosition(player,1040.1600341797,1304.3272705078,10.8203125) 
end 

I had spawn (function lena) first just for one gang and was working perfect but now i made 2nd spawn for another gang "EleCtriC KiLlerS" and spawn wont work everyone spawn at hospital.

debugscript 3 : WARNING: Teams\teams.lua:14: Bad argument @ 'getPlayerTeam'

WARNING: Teams\teams.lua:15: Bad argument @ 'getTeamName'

WARNING: Teams\teams.lua:28: Bad argument @ 'getPlayerTeam'

WARNING: Teams\teams.lua:29: Bad argument @ 'getTeamName

If you can help me fix it ill be very happy , thx!'

Link to comment
Hello guys.
team = { } 
team["staff"] =createTeam ( "Staff", 255, 255, 255 ) 
team["military"] =createTeam ( "Armed Forces", 29, 99, 6 ) 
team["swatteam"] =createTeam ( "S.W.A.T.", 0, 90, 255 ) 
team["lawenforcement"] =createTeam ( "Law Enforcement", 40, 147, 242 ) 
team["Criminal"] =createTeam ( "Criminal", 255, 0, 0 ) 
team["Communtiy"] =createTeam ( "Community", 255, 255, 0 ) 
team["medic"] =createTeam ( "Medic", 0, 255, 255 ) 
team["unemployed"] =createTeam ( "Unemployed", 209, 218, 106 ) 
team["EleCtriC KiLlerS"] =createTeam ( "EleCtriC KiLlerS", 0, 0, 0 ) 
team["The Magic Assassins"] =createTeam ( "The Magic Assassins", 43, 20, 184 ) 
  
function lena(thePlayer) 
local playerTeam = getPlayerTeam ( player ) 
local ss = getTeamName ( playerTeam )   
if ss=="The Magic Assassins" then 
setTimer(azaz, 1800, 1, player) 
outputDebugString("It's works") 
end 
end 
addEventHandler("onPlayerWasted",getRootElement(),lena) 
  
function azaz(player) 
setElementPosition(player,1094.7105712891,2092.7939453125,15.350400924683) 
end 
  
function lena(thePlayer) 
local playerTeam = getPlayerTeam ( player ) 
local ss = getTeamName ( playerTeam )   
if ss=="EleCtriC KiLlerS" then 
setTimer(azaz, 1800, 1, player) 
outputDebugString("It's works") 
end 
end 
addEventHandler("onPlayerWasted",getRootElement(),lena) 
  
function azaz(player) 
setElementPosition(player,1040.1600341797,1304.3272705078,10.8203125) 
end 

I had spawn (function lena) first just for one gang and was working perfect but now i made 2nd spawn for another gang "EleCtriC KiLlerS" and spawn wont work everyone spawn at hospital.

debugscript 3 : WARNING: Teams\teams.lua:14: Bad argument @ 'getPlayerTeam'

WARNING: Teams\teams.lua:15: Bad argument @ 'getTeamName'

WARNING: Teams\teams.lua:28: Bad argument @ 'getPlayerTeam'

WARNING: Teams\teams.lua:29: Bad argument @ 'getTeamName

If you can help me fix it ill be very happy , thx!'

The two functions have the same Name. Just change the seconds lena function to lena2 but the best and less memory usage way would be to use elseif statement.

  
function lena(thePlayer) 
local playerTeam = getPlayerTeam ( player ) 
local ss = getTeamName ( playerTeam )   
if ss=="The Magic Assassins" then 
setTimer(azaz, 1800, 1, player) 
outputDebugString("It's works") 
setTimer(setElementPosition, 1800, 1 ,1094.7105712891,2092.7939453125,15.350400924683 ) 
elseif  ss=="EleCtriC KiLlerS" then 
setTimer(setElementPosition, 1800, 1 ,7105712891,2092.7939453125,15.350400924683 ) 
outputDebugString("It's works") 
end 
end 
addEventHandler("onPlayerWasted",getRootElement(),lena) 
  

)

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