Код:
SetTimer("scalc",500,true);
forward scalc();
public scalc()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new Float:p[3],Float:Speed;
GetVehicleVelocity(GetPlayerVehicleID(i), p[0], p[1], p[2]);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(p[0], 2), floatpower(p[1], 2)), floatpower(p[2], 2))), 100.0);
new Float:tmp = Speed / 1.6;
new mph=floatround(tmp,floatround_round);
new s[128];
format(s,128,"Speed: %d MPH",mph);
TextDrawSetString(speedtd[i],s);
}
}
return 1;
}
the problem is it gets stuck after some time, after about 10 secs. any idea why?