31.01.2012, 20:03
so i changed the code a bit,
and now i got this, but the weird thing is, the handbrake works,
but the up and down keys don't even though it's the same code
and now i got this, but the weird thing is, the handbrake works,
but the up and down keys don't even though it's the same code
Quote:
if ((newkeys & CCKey) && !(oldkeys & CCKey) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if (GetVehicleSpeed(vid) == 0) return false; new Float, Float:y, Float:z; GetVehicleVelocity(vid, x, y, z); GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]); DistanceFlat(0, 0, x, y, PlayerCruiseSpeed[playerid]); SetTimerEx("CruiseControl", 500, false, "d", playerid); APlayerData[playerid][CruiseControlState] = 1; } else if (PlayerCruiseSpeed[playerid] != 0.00 && (newkeys & KEY_HANDBRAKE)) { PlayerCruiseSpeed[playerid] = 0.00; APlayerData[playerid][CruiseControlState] = 0; } else if (PlayerCruiseSpeed[playerid] != 0.00 && (newkeys & KEY_UP)) { PlayerCruiseSpeed[playerid] = 0.00; APlayerData[playerid][CruiseControlState] = 0; } else if ((newkeys & KEY_DOWN)) { PlayerCruiseSpeed[playerid] = 0.00; APlayerData[playerid][CruiseControlState] = 0; } |