pawn Код:
//Func to check if it's not something like a bike
static invalid_nos_vehicle[] =
{
430,446,448,449,452,453,454,461,462,463,468,472,473,481,484,
493,509,510,520,521,522,523,537,538,569,570,581,586,590,595,429,461
};
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Vid = GetPlayerVehicleId(playerid);
new model = GetVehicleModel(playerid);
new invalid_model;
for (new i = 0; i < sizeof(invalid_nos_vehicle); i++)
{
if(model == invalid_nos_vehicle[i]) invalid_model = 1;
}
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && newkeys & KEY_FIRE)
{
if(!invalid_model) AddVehicleComponent(Vid,1010);
}
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && oldkeys & KEY_FIRE)
{
if(!invalid_model) RemoveVehicleComponent(Vid,1010);
}
return 1;
}