diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index dc3e07a..22b872b 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -198,3 +198,7 @@ stock IsPlayerSettingToggled( playerid, settingid ) { stock IsPlayerVIPSkinToggled( playerid ) { return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN }; } + +stock DisablePassiveMode( playerid ) { + return p_PlayerSettings[ playerid ] { SETTING_PASSIVE_MODE } = true; +} \ No newline at end of file diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 8f8c9d2..c4a49ff 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1264,6 +1264,44 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: if ( p_WantedLevel[ playerid ] <= 2 && p_Class[ playerid ] != CLASS_POLICE && p_Class[ iDriver ] == CLASS_POLICE && GetPVarInt( playerid, "ShotCopWantedCD" ) < g_iTime ) SendServerMessage( playerid, "You have physically touched an officer, thus you have been wanted." ), GivePlayerWantedLevel( playerid, 6 ), SetPVarInt( playerid, "ShotCopWantedCD", g_iTime + 120 ); + + // Cops Cannot Damage Innocent Vehicles, Unless Wanted Players Occupy Alongside Them + if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ iDriver ] == 0 ) + { + + new + innocentVehicleID = GetPlayerVehicleID( iDriver ); + + foreach ( new i : Player ) + { + + if ( !IsPlayerConnected( i ) ) + continue; + + if ( i == iDriver ) + continue; + + new + iTargetVehicle = GetPlayerVehicleID( i ); + + if ( iTargetVehicle == innocentVehicleID ) + { + if ( GetPlayerWantedLevel( i ) > 0 ) + return 1; + } + else + { + continue; + } + + } + + return ShowPlayerHelpDialog( playerid, 2000, "You cannot damage an innocent player's vehicle unless they have wanted players alongside them!" ), 0; + } + + // Passive Players can't damage normal players vehicles + if ( IsPlayerPassive( playerid ) ) + return 0; } } } @@ -5954,6 +5992,8 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) p_JobSet{ playerid } = false; //p_CitySet{ playerid } = false; p_SpawningCity{ playerid } = CITY_SF; + + DisablePassiveMode( playerid ); p_Uptime[ playerid ] = 0; ShowAchievement( playerid, "Registering to SF-CnR!", 1 ); p_PlayerLogged{ playerid } = true; @@ -6043,9 +6083,10 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) TogglePlayerControllable( playerid, 1 ); + /* Passive Mode - Removed E:\SF-CNR\gamemodes\sf-cnr.pwn if ( ! p_JobSet{ playerid } ) { ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" ); - } + }*/ p_JobSet{ playerid } = true; @@ -6061,7 +6102,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } } - if ( dialogid == DIALOG_PASSIVE_MODE ) + /*if ( dialogid == DIALOG_PASSIVE_MODE ) { if ( ! response || ! listitem ) { ShowPlayerDialog( playerid, DIALOG_PASSIVE_MODE, DIALOG_STYLE_LIST, "{FFFFFF}What is your type of style?", "{555555}Choose Below Below:\nI Like Roleplaying\nI Like Deathmatching", "Select", "" ); @@ -6073,7 +6114,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) CallLocalFunction( "OnDialogResponse", "dddds", playerid, DIALOG_CP_MENU, 1, SETTING_PASSIVE_MODE + 1, "ignore" ); // cunning way SendServerMessage( playerid, "Since you like deathmatch, passive mode has been automatically enabled for you!" ); } - } + }*/ if ( ( dialogid == DIALOG_BANK_MENU ) && response ) { new