26.05.2017, 05:35
PHP код:
public SpeedoUpdate()
{
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new Float:x,Float:y,Float:z,string[24];
new vid = GetPlayerVehicleID(i);
TextDrawShowForPlayer(i,box[i]);
TextDrawShowForPlayer(i,speed[i]);
GetVehicleVelocity(vid,x,y,z);
format(string,sizeof(string),"Speed: %dmph\nFuel:%i",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*156.666667), Fuel[vid]);
TextDrawSetString(speed[i], string);
}
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i,box[i]);
TextDrawHideForPlayer(i,speed[i]);
}
}
}

