From 6afea53a89e91edc4078510c959d20df0f541090 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 23 Feb 2019 18:42:08 +1100 Subject: [PATCH] auto kill afk player out of area --- .../cnr/features/battleroyale/battleroyale.pwn | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn b/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn index d2adb0c..8ba4d3a 100644 --- a/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn +++ b/gamemodes/irresistible/cnr/features/battleroyale/battleroyale.pwn @@ -963,13 +963,21 @@ function BattleRoyale_GameUpdate( lobbyid ) // hurt players outside the zone if ( IsPlayerSpawned( x ) && ! IsPlayerInArea( x, br_lobbyData[ lobbyid ] [ E_B_MIN_X ], br_lobbyData[ lobbyid ] [ E_B_MAX_X ], br_lobbyData[ lobbyid ] [ E_B_MIN_Y ], br_lobbyData[ lobbyid ] [ E_B_MAX_Y ] ) ) { - new - Float: health; + // force kill afk player out of zone + if ( IsPlayerAFK( x ) ) + { + SetPlayerHealth( x, -1 ); + } + else + { + new + Float: health; - GetPlayerHealth( x, health ); + GetPlayerHealth( x, health ); - GameTextForPlayer( x, "~r~STAY IN THE AREA!", 5000, 3 ); - SetPlayerHealth( x, health - 10.0 ); + GameTextForPlayer( x, "~r~STAY IN THE AREA!", 5000, 3 ); + SetPlayerHealth( x, health - 10.0 ); + } } }