From a64c91663788f56fd85354c4979353494d872243 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Mon, 22 Oct 2018 00:32:10 +1100 Subject: [PATCH] prevent NPCs from continuing with OnPlayerSpawn --- gamemodes/irresistible/cnr/classes.pwn | 5 +++++ gamemodes/irresistible/cnr/features/chuffsec.pwn | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gamemodes/irresistible/cnr/classes.pwn b/gamemodes/irresistible/cnr/classes.pwn index 5092e60..6ec2e8b 100644 --- a/gamemodes/irresistible/cnr/classes.pwn +++ b/gamemodes/irresistible/cnr/classes.pwn @@ -246,6 +246,11 @@ hook OnScriptInit( ) hook OnPlayerSpawn( playerid ) { + // prevent npcs from being treated like players + if ( IsPlayerNPC( playerid ) ) { + return Y_HOOKS_BREAK_RETURN_1; // add a callback otherwise OnNpcSpawn + } + // check if this spawn is even approved if ( ! IsPlayerClassApproved( playerid ) ) { diff --git a/gamemodes/irresistible/cnr/features/chuffsec.pwn b/gamemodes/irresistible/cnr/features/chuffsec.pwn index 3c74a07..da6f9e6 100644 --- a/gamemodes/irresistible/cnr/features/chuffsec.pwn +++ b/gamemodes/irresistible/cnr/features/chuffsec.pwn @@ -205,13 +205,13 @@ hook OnPlayerUpdate( playerid ) return Y_HOOKS_CONTINUE_RETURN_1; } -hook OnPlayerSpawn( playerid ) +/*hook OnPlayerSpawn( playerid ) { if ( IsPlayerSecurityDriver( playerid ) ) { return Y_HOOKS_BREAK_RETURN_1; } return Y_HOOKS_CONTINUE_RETURN_1; -} +}*/ hook OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ ) {