07.06.2011, 22:53
Hey guys. I am working on a speedo and I cant get it to work. It shows a whole bunch of numbers overlapping. Could anyone help?
pawn Код:
public UpdateSpeedoMeter()
{
for(new playerid; playerid < GetMaxPlayers(); playerid++ )
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:CurPos[4]Float:OldPos[4];
GetVehiclePos(GetPlayerVehicleID(playerid), CurPos[1], CurPos[2], CurPos[3]);
new Float:A = OldPos[1] - CurPos[1];
if(A < 0.0) A = -A;
new Float:B = OldPos[2] - CurPos[2];
if(B < 0.0) B = -B;
new Float:C = OldPos[3] - CurPos[3];
if(C < 0.0) C = -C;
new Float:vSpeed = A + B + C;
vSpeed *= 2;
format(string, sizeof(string), "MPH: %i", vSpeed);
Speedo[playerid] = TextDrawCreate(497 ,397 , string);
TextDrawShowForPlayer(playerid, Speedo[playerid]);
}
}
}