01.01.2013, 18:21
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_FIRE) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicle, 1010);
}
else if ((newkeys & KEY_SECONDARY_ATTACK) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(vehicle, 1010);
}
}
Why doesnt the second attack works?
{
if ((newkeys & KEY_FIRE) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicle, 1010);
}
else if ((newkeys & KEY_SECONDARY_ATTACK) && (IsPlayerInAnyVehicle(playerid)) && (GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
new vehicle = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(vehicle, 1010);
}
}
Why doesnt the second attack works?