Call of Duty 5: Co-op Player Spawns

From COD Modding & Mapping Wiki
Revision as of 19:00, 24 November 2008 by CoDEmanX (talk | contribs) (New page: You're probably wondering whether you have to add four (4) info_player_starts to your map, the answer is no. Just add in one, but you'll need to add in four script structs otherwise player...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You're probably wondering whether you have to add four (4) info_player_starts to your map, the answer is no. Just add in one, but you'll need to add in four script structs otherwise players will spawn inside each other (they'll be able to move out but probably wouldn't look professional) and script a function to move the players to each unique struct.

On the four (4) script_structs, give them the KVP:

"targetname" "initial_spawn_points"

You'll need need add this bit to your script (feel free to modify it as you wish if need be) and call the function shortly after maps\_load::main() is called:

coop_player_spawn_placement()
{
	structs = getstructarray( "initial_spawn_points", "targetname" ); 
	
	flag_wait( "all_players_connected" ); 
	
	players = get_players(); 
	
	for( i = 0; i < players.size; i++ )
	{
		players[i] setorigin( structs[i].origin ); 
		players[i] setplayerangles( structs[i].angles ); 
	}
}


Sources: Treyarch's Wiki