removes ability to use /perks will in army vehicles

This commit is contained in:
Damen 2019-04-09 01:06:06 -04:00
parent 654b304d2f
commit c95767b7fa
2 changed files with 18 additions and 2 deletions

View File

@ -217,9 +217,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
/* ** Commands ** */
CMD:perks( playerid, params[ ] )
{
if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) {
if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) )
return SendError( playerid, "You cannot use this command since you're in an event." );
}
if ( IsPlayerInArmyVehicle( playerid ) )
return SendError( playerid, "You cannot use this command while in an army vehicle." );
return ShowPlayerDialog( playerid, DIALOG_PERKS, DIALOG_STYLE_LIST, "{FFFFFF}Game Perks", "Player Perks\nVehicle Perks", "Select", "Cancel" );
}

View File

@ -7063,4 +7063,17 @@ stock IsPlayerDead( playerid )
return health <= 0.0;
return GetPlayerState( playerid ) == PLAYER_STATE_WASTED;
}
stock IsPlayerInArmyVehicle( playerid )
{
new
vehicleid = GetPlayerVehicleID( playerid ),
vehiclemodelid = GetVehicleModel( vehicleid )
;
if ( vehiclemodelid == 425 || vehiclemodelid == 432 || vehiclemodelid == 520 ) //Rhino, Tank, Hydra
return true;
else
return false;
}