This is my code to spawn Players
[LUA]
function GM:InitPostEntity()
self.Spawns = {}
self.Spawns[ TEAM_DEATH ] = ents.FindByClass( "info_player_terrorist" )
self.Spawns[ TEAM_RUN ] = ents.FindByClass( "info_player_counterterrorist" )
self.Spawns[ TEAM_SPEC ] = table.Copy( self.Spawns[ TEAM_RUN ] )
self.Respawnables = ents.GetAll()
end
[/LUA]
but, we spawn always on the runners side.
pleas help
Thanks,
[lua]
function GM:PlayerSelectSpawn( pl )
local spawns = ents.FindByClass( "info_player_counterterrorist" )
if(pl:Team() == TEAM_DEATH)then spawns = ents.FindByClass( "info_player_terrorist" ) end
local random_entry = math.random(#spawns)
return spawns[random_entry]
end[/lua]
Try this?
Thanks faceguydb, you help'd me a second time again today!!
:D
Imagine misreading the above code so badly
yes i dit but it didn't work
[QUOTE=Dwight;29403659]yes i dit but it didn't work[/QUOTE]
[lua]
team.SetSpawnPoint( TEAM_DEATH, "info_player_terrorist" )
team.SetSpawnPoint( TEAM_RUN, "info_player_counterterrorist" )
team.SetSpawnPoint( TEAM_SPEC, { "info_player_counterterrorist", "info_player_terrorist" })
[/lua]
you can put that in shared just your way i assumed you wanted to do something much more complex like run a function.
Sorry, you need to Log In to post a reply to this thread.