mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-06-30 08:11:52 +00:00
Added kill_stuck_bots
This commit is contained in:
54
small_scripts/kill_stuck_bots.gsc
Normal file
54
small_scripts/kill_stuck_bots.gsc
Normal file
@ -0,0 +1,54 @@
|
||||
Init()
|
||||
{
|
||||
level thread OnPlayerConnect();
|
||||
}
|
||||
|
||||
OnPlayerConnect()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
level waittill("connected", player);
|
||||
player thread OnPlayerSpawned();
|
||||
}
|
||||
}
|
||||
|
||||
OnPlayerSpawned()
|
||||
{
|
||||
self endon("disconnect");
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
if (isDefined(self.pers["isBot"]))
|
||||
{
|
||||
if (self.pers["isBot"])
|
||||
{
|
||||
self thread KillStuckBots();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
KillStuckBots()
|
||||
{
|
||||
self endon ("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
kills_before = self.pers["cur_kill_streak"];
|
||||
deaths_before = self.pers["deaths"];
|
||||
|
||||
wait 30;
|
||||
|
||||
kills_now = self.pers["cur_kill_streak"];
|
||||
deaths_now = self.pers["deaths"];
|
||||
|
||||
if (kills_now == kills_before && deaths_before == deaths_now)
|
||||
{
|
||||
self Suicide();
|
||||
}
|
||||
}
|
||||
|
||||
// Prints text in the bootstrapper
|
||||
Debug(text)
|
||||
{
|
||||
Print(text);
|
||||
}
|
Reference in New Issue
Block a user