01.01.2013, 21:35
No, it's just if, because the player can be pressing two keys at the same time.
Try:
Try:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_FIRE) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicle, 1010);
}
if ((newkeys & KEY_SECONDARY_ATTACK) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(vehicle, 1010);
}
return 1;
}