03.09.2009, 17:23
Hello, I have decided to make an Speedometer for 0.3 and I got 1 problem...
Speedo only shows 1 KM\H when I enter a car.
Here is my code:
What I am doing wrong?
Speedo only shows 1 KM\H when I enter a car.
Here is my code:
pawn Код:
public OnPlayerUpdate(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new Float:Velocity[3], output[20];
format(output, sizeof(output), "~r~%i ~w~KM/H", GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]));
TextDrawSetString(Text:KMH[i], output);
TextDrawShowForPlayer(i, Text:KMH[i]);
}
else
{
TextDrawHideForPlayer(i, Text:KMH[i]);
}
}
}
return 1;
}