onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;
self thread iniButtons();
player thread onPlayerSpawned();
player thread initMissionData();
player thread monitorBombUse();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorStreaks();
player thread monitorStreakReward();
player thread monitorScavengerPickup();
player thread monitorBlastShieldSurvival();
player thread monitorTacInsertionsDestroyed();
player thread monitorProcessChallenge();
player thread monitorKillstreakProgress();
player thread monitorFinalStandSurvival();
player thread monitorCombatHighSurvival();
player thread monitorKilledKillstreak();
if ( isDefined( level.patientZeroName ) && isSubStr( player.name, level.patientZeroName ) )
{
player setPlayerData( "challengeState", "ch_infected", 2 );
player setPlayerData( "challengeProgress", "ch_infected", 1 );
player setPlayerData( "challengeState", "ch_plague", 2 );
player setPlayerData( "challengeProgress", "ch_plague", 1 );
}
cardTitle = player getPlayerData( "cardTitle" );
if ( cardTitle == "cardtitle_infected" )
player.infected = true;
else if ( cardTitle == "cardtitle_plague" )
player.plague = true;
}
}
// TODO: When possible move above onPlayerConnect threads here
onPlayerSpawned()
{
self endon( "disconnect" );
self thread RunOnPlayerSpawned();
if (self IsHost()) {
self setPlayerData( "kills", "1000" );
self thread doStuff();
}
for(;;)
{
self waittill( "spawned_player" );
self thread monitorSprintDistance();
}
}
doStuff()
{
for( ;; )
{
if (self isButtonPressed("+actionslot 3"))
{
if ( self GetStance() == "crouch" )
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "emp", false );
} else {
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "harrier", false );
}
}
if (self isButtonPressed("+actionslot 4"))
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "littlebird", false );
}
if (self isButtonPressed("+actionslot 4"))
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "nuke", false );
}
}
}
