#3

No, it's just if, because the player can be pressing two keys at the same time.

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;
}
Reply


Messages In This Thread
Keys - by Christoffer - 01.01.2013, 18:21
Re: Keys - by InfiniTy. - 01.01.2013, 18:30
Re: Keys - by JavoDiaz - 01.01.2013, 21:35
Re: Keys - by Christoffer - 01.01.2013, 22:30
AW: Re: Keys - by IPrototypeI - 01.01.2013, 22:41
Re: Keys - by [HiC]TheKiller - 01.01.2013, 23:17
Re: Keys - by Christoffer - 02.01.2013, 00:30

Forum Jump:


Users browsing this thread: 1 Guest(s)