removes passive dialog selection on account creation, adds passive unable to damage vehicles by weapons, adds leos unable to attack innocent vehicles unles they have wanted players alongside them

This commit is contained in:
Damen 2018-12-26 01:11:02 -05:00
parent d2d0bfd8f7
commit e22aa5022b
2 changed files with 48 additions and 3 deletions

View File

@ -191,3 +191,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;
} }
} }
} }
@ -5937,6 +5975,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;
@ -6026,9 +6066,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;
@ -6044,7 +6085,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", "" );
@ -6056,7 +6097,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