From dab91970129fa5e6c815b42d123d7c8ed9f977e3 Mon Sep 17 00:00:00 2001 From: Stev Date: Sun, 17 Feb 2019 21:13:32 +0000 Subject: [PATCH 1/3] disabling some commands for battle royale --- gamemodes/irresistible/cnr/features/cop/arrest.pwn | 7 +++++-- gamemodes/irresistible/cnr/features/damage_feed.pwn | 3 +++ gamemodes/irresistible/cnr/features/perks.pwn | 2 +- gamemodes/sf-cnr.pwn | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 43bdeff..1d74c5b 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -235,7 +235,8 @@ stock TazePlayer( victimid, playerid ) //else if ( victimid == playerid ) return SendError( playerid, "You cannot taze yourself." ); else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "There are no players around to taze." ); else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 5.0 && IsPlayerConnected( victimid ) ) + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); + else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 5.0 && IsPlayerConnected( victimid ) ) { if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); @@ -288,7 +289,8 @@ stock ArrestPlayer( victimid, playerid ) // else if ( victimid == playerid ) return SendError( playerid, "You cannot arrest yourself." ); else if ( !IsPlayerConnected( victimid ) ) return SendError( playerid, "This player is not connected." ); else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); + else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) { if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" ); @@ -347,6 +349,7 @@ stock CuffPlayer( victimid, playerid ) //else if ( victimid == playerid ) return SendError( playerid, "You cannot cuff yourself." ); else if ( !IsPlayerConnected( victimid ) || IsPlayerNPC( victimid ) ) return SendError( playerid, "This player is not connected." ); else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) { if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player is in your team." ); diff --git a/gamemodes/irresistible/cnr/features/damage_feed.pwn b/gamemodes/irresistible/cnr/features/damage_feed.pwn index 2b952f9..78f9cfd 100644 --- a/gamemodes/irresistible/cnr/features/damage_feed.pwn +++ b/gamemodes/irresistible/cnr/features/damage_feed.pwn @@ -568,6 +568,9 @@ CMD:sync( playerid, params[ ] ) if ( IsPlayerPassive( playerid ) ) return SendError( playerid, "You cannot use this feature while in passive mode." ); + if ( IsPlayerInBattleRoyale( playerid ) ) + return SendError( playerid, "You cannot use this command while in Battle Royale." ); + new curr_server_time = GetServerTime( ); diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index 9b26fcd..457950f 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -217,7 +217,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) /* ** Commands ** */ CMD:perks( playerid, params[ ] ) { - if ( IsPlayerInEvent( playerid ) ) { + if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) { return SendError( playerid, "You cannot use this command since you're in an event." ); } return ShowPlayerDialog( playerid, DIALOG_PERKS, DIALOG_STYLE_LIST, "{FFFFFF}Game Perks", "Player Perks\nVehicle Perks", "Select", "Cancel" ); diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index d992a20..d78bc9c 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2363,6 +2363,7 @@ CMD:mech( playerid, params[ ] ) if ( p_Class[ playerid ] != CLASS_CIVILIAN ) return SendError( playerid, "You must be a civilian to use this command." ); else if ( !IsPlayerJob( playerid, JOB_DIRTY_MECHANIC ) ) return SendError( playerid, "You are not a dirty mechanic." ); else if ( IsPlayerBelowSeaLevel( playerid ) ) return SendError( playerid, "You cannot use this command while below sea level." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); else if ( isnull( params ) ) return SendUsage( playerid, "/(mech)anic [FIX/NOS/REMP/FLIP/FLIX/PRICE/NEARBY]" ); else if ( strmatch( params, "fix" ) ) { @@ -3442,6 +3443,7 @@ CMD:track( playerid, params[ ] ) if ( p_Class[ playerid ] != CLASS_CIVILIAN ) return SendError( playerid, "This is restricted to civilians only." ); else if ( !IsPlayerJob( playerid, JOB_HITMAN ) ) return SendError( playerid, "You have to be a hitman to use this command." ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/track [PLAYER_ID]" ); else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "This player isn't connected!" ); else if ( pID == playerid ) return SendError( playerid, "You cannot apply this to yourself." ); From 5bcd13c1b255a6ab45ece5dfd51a9eab2f431e03 Mon Sep 17 00:00:00 2001 From: Stev Date: Sun, 17 Feb 2019 21:38:10 +0000 Subject: [PATCH 2/3] disable /search from br --- gamemodes/sf-cnr.pwn | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index d78bc9c..402b21e 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -3796,6 +3796,7 @@ CMD:search( playerid, params[ ] ) else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/search [PLAYER_ID]" ); else if ( GetDistanceBetweenPlayers( playerid, pID ) > 10.0 || !IsPlayerConnected( pID ) ) return SendError( playerid, "This player is not around." ); else if ( p_Class[ pID ] == CLASS_POLICE ) return SendError( playerid, "This player is in your team!" ); + else if ( IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command while in Battle Royale." ); else if ( !IsPlayerCuffed( pID ) ) return SendError( playerid, "This player must be cuffed." ); else if ( IsPlayerJailed( pID ) ) return SendError( playerid, "You cannot " ); else From 01985dff05701b07eaac125b380349b1723e1382 Mon Sep 17 00:00:00 2001 From: Stev Date: Sun, 17 Feb 2019 21:40:50 +0000 Subject: [PATCH 3/3] allowing cops to play br hurting civilians --- gamemodes/sf-cnr.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 402b21e..223f809 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -830,7 +830,7 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 ) p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; - if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) ) + if ( p_Class[ playerid ] == CLASS_POLICE && p_Class[ hitid ] != CLASS_POLICE && !p_WantedLevel[ hitid ] && GetPlayerState( hitid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( playerid ) && ! IsPlayerInBattleRoyale( playerid ) ) return ShowPlayerHelpDialog( playerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; // CIA Exposure when weapon is shot