Merged in passive-adjustment (pull request #37)

Passive Removal and LEO-Innocent Attacking Protection
This commit is contained in:
Damen DeBerry 2018-12-27 01:46:23 +00:00 committed by Lorenc Pekaj
commit 30b9846d10
2 changed files with 48 additions and 3 deletions

View File

@ -198,3 +198,7 @@ stock IsPlayerSettingToggled( playerid, settingid ) {
stock IsPlayerVIPSkinToggled( playerid ) { stock IsPlayerVIPSkinToggled( playerid ) {
return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN }; return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN };
} }
stock DisablePassiveMode( playerid ) {
return p_PlayerSettings[ playerid ] { SETTING_PASSIVE_MODE } = true;
}

View File

@ -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 ) 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 ); 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_JobSet{ playerid } = false;
//p_CitySet{ playerid } = false; //p_CitySet{ playerid } = false;
p_SpawningCity{ playerid } = CITY_SF; p_SpawningCity{ playerid } = CITY_SF;
DisablePassiveMode( playerid );
p_Uptime[ playerid ] = 0; p_Uptime[ playerid ] = 0;
ShowAchievement( playerid, "Registering to SF-CnR!", 1 ); ShowAchievement( playerid, "Registering to SF-CnR!", 1 );
p_PlayerLogged{ playerid } = true; p_PlayerLogged{ playerid } = true;
@ -6043,9 +6083,10 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
TogglePlayerControllable( playerid, 1 ); TogglePlayerControllable( playerid, 1 );
/* Passive Mode - Removed E:\SF-CNR\gamemodes\sf-cnr.pwn
if ( ! p_JobSet{ playerid } ) { 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", "" ); 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; 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 ) { 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", "" ); 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 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!" ); SendServerMessage( playerid, "Since you like deathmatch, passive mode has been automatically enabled for you!" );
} }
} }*/
if ( ( dialogid == DIALOG_BANK_MENU ) && response ) if ( ( dialogid == DIALOG_BANK_MENU ) && response )
{ {
new new