27.09.2015, 17:05
Fixed it. I removed the loop under OnPlayerUpdate
Код:
public OnPlayerUpdate(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vspeed[25]; format(vspeed, sizeof(vspeed), "Speed: ~y~%d ~g~KM/H", GetVehicleSpeed(playerid)); PlayerTextDrawSetString(playerid, VehicleSpeed[playerid], vspeed); new vhealthtd[32], Float:vHealth; GetVehicleHealth(GetPlayerVehicleID(playerid), vHealth); new Float:percentage = (((vHealth - 250.0) / (1000.0 - 250.0)) * 100.0); format(vhealthtd, sizeof(vhealthtd), "Vehicle Health: ~g~%.0f%", percentage); PlayerTextDrawSetString(playerid, VehicleHealth[playerid], vhealthtd); } return 1; }