07.06.2011, 23:23
EDIT: Same error
heres the code. It uses a timer under OnGameModeInit
heres the code. It uses a timer under OnGameModeInit
pawn Код:
public UpdateSpeedoMeter()
{
for(new playerid; playerid < GetMaxPlayers(); playerid++ )
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:vVelocity[3], string[200];
GetVehicleVelocity(GetPlayerVehicleID(playerid), vVelocity[0], vVelocity[1], vVelocity[2]);
new Float: vSpeed = floatsqroot(floatpower(vVelocity[0], 2) + floatpower(vVelocity[1], 2) + floatpower(vVelocity[2], 2)) * 99;
format(string, sizeof(string), "MPH: %f", vSpeed);
Speedo[playerid] = TextDrawCreate(497 ,397 , string);
TextDrawShowForPlayer(playerid, Speedo[playerid]);
}
}
}