diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index 457950f..f3993be 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -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" ); } diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index f66a3bb..0e5566a 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -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; } \ No newline at end of file