On Player Connect/Spawn
On Player Connect and Spawned has changed from WAW in BO3
It now uses a function in another script and calls the function passed when the player connects or spawns depending which you chose
- WAW method:
- WAW method:
init()
{
thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerSpawned();
}
}
OnPlayerSpawned()
{
//do this
}
- BO3 method:
//put this up top of script #using scripts\shared\callbacks_shared; function init()
{
callback::on_connect( &on_player_connect );
callback::on_spawned( &on_player_spawned );
}
function on_player_connect()
{
//do stuff each time a player connects
}
function on_player_spawned()
{
//do stuff stuff each time player spawns
}