From b2c10884e8cf7af099334dc853e235f3f635218d Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Mon, 15 Oct 2018 18:11:20 +1100 Subject: [PATCH] bug fixes with sync --- gamemodes/irresistible/cnr/features/damage_feed.pwn | 4 ++++ gamemodes/irresistible/cnr/wanted_level.pwn | 10 ---------- gamemodes/sf-cnr.pwn | 2 ++ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/damage_feed.pwn b/gamemodes/irresistible/cnr/features/damage_feed.pwn index f8e9e7a..c4f4cb9 100644 --- a/gamemodes/irresistible/cnr/features/damage_feed.pwn +++ b/gamemodes/irresistible/cnr/features/damage_feed.pwn @@ -157,6 +157,7 @@ hook SetPlayerRandomSpawn( playerid ) SetPlayerArmedWeapon( playerid, g_syncData[ playerid ] [ E_CURRENT_WEAPON ] ); SetCameraBehindPlayer( playerid ); + DisablePlayerSpawnProtection( playerid ); p_SyncingPlayer{ playerid } = false; return Y_HOOKS_BREAK_RETURN_1; @@ -536,6 +537,9 @@ CMD:sync( playerid, params[ ] ) if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot synchronize yourself in a vehicle." ); + if ( IsPlayerTazed( playerid ) || IsPlayerCuffed( playerid ) || IsPlayerKidnapped( playerid ) || IsPlayerTied( playerid ) || IsPlayerLoadingObjects( playerid ) || IsPlayerSpawnProtected( playerid ) ) + return SendError( playerid, "You cannot synchronize yourself at the moment." ); + if ( GetPlayerWeapon( playerid ) == WEAPON_SNIPER ) return SendError( playerid, "You cannot synchronize yourself holding a sniper." ); diff --git a/gamemodes/irresistible/cnr/wanted_level.pwn b/gamemodes/irresistible/cnr/wanted_level.pwn index 51e10a6..9ab15e4 100644 --- a/gamemodes/irresistible/cnr/wanted_level.pwn +++ b/gamemodes/irresistible/cnr/wanted_level.pwn @@ -21,16 +21,6 @@ hook OnPlayerConnect( playerid ) return 1; } -#if defined AC_INCLUDED -hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart ) -#else -hook OnPlayerDeath( playerid, killerid, reason ) -#endif -{ - ClearPlayerWantedLevel( playerid ); - return 1; -} - /* ** Hooked Functions ** */ stock CNR_GetPlayerWantedLevel( playerid ) { diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index bb09a01..05f7816 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -3251,6 +3251,8 @@ public OnPlayerDeath( playerid, killerid, reason ) p_Deaths[ playerid ] ++; // Usually other events do nothing GivePlayerSeasonalXP( playerid, -10.0 ); // Deduct points, it's meant to be hard!!! } + + ClearPlayerWantedLevel( playerid ); return 1; }