mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-06-28 07:01:49 +00:00
func and airdrop
This commit is contained in:
@ -126,6 +126,7 @@ init()
|
||||
level thread fixGamemodes();
|
||||
|
||||
level thread onPlayerConnect();
|
||||
level thread addNotifyOnAirdrops();
|
||||
|
||||
level thread handleBots();
|
||||
}
|
||||
@ -201,6 +202,38 @@ fixGamemodes()
|
||||
}
|
||||
}
|
||||
|
||||
addNotifyOnAirdrops()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
wait 1;
|
||||
dropCrates = getEntArray( "care_package", "targetname" );
|
||||
|
||||
for (i = dropCrates.size - 1; i >= 0; i--)
|
||||
{
|
||||
airdrop = dropCrates[i];
|
||||
|
||||
if (!isDefined(airdrop.owner))
|
||||
continue;
|
||||
|
||||
if (isDefined(airdrop.doingPhysics))
|
||||
continue;
|
||||
|
||||
airdrop.doingPhysics = true;
|
||||
airdrop thread doNotifyOnAirdrop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doNotifyOnAirdrop()
|
||||
{
|
||||
self endon( "death" );
|
||||
self waittill( "physics_finished" );
|
||||
|
||||
self.doingPhysics = false;
|
||||
self.owner notify("crate_physics_done");
|
||||
}
|
||||
|
||||
/*
|
||||
Thread when any player connects. Starts the threads needed.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user