29.04.2014, 20:35
Why don't you just put that to OnPlayerUpdate? Or to a global timer.
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid)) // if the player is in vehicle?
{
// Show them speed information
new vid = GetPlayerVehicleID(playerid);
CarInfo[vid][Metres] += (vitesse[playerid]*10)/36;
if(CarInfo[vid][Metres] > 999)
{
CarInfo[vid][Kilometres] += 1;
CarInfo[vid][Metres] = 0;
}
format(string, sizeof(string), "M: %d - KM: %d", CarInfo[vid][Metres], CarInfo[vid][Kilometres]);
SendClientMessage(playerid, -1, string);
}
return true;
}