29.06.2012, 17:18
pawn Код:
new Text:SPEEDOS[MAX_PLAYERS];
new Text:HEALTH[MAX_PLAYERS];
pawn Код:
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
format(speed_string,256,"~y~Speed: ~w~%i",final_speed_int);
PlayerTextDrawSetString(playerid,SPEEDOS[playerid], speed_string);
PlayerTextDrawShow(playerid,SPEEDOS[playerid]);
GetVehicleHealth(vehicleid,vehicle_health);
final_vehicle_health = floatround(floatround(vehicle_health - 250)/ 7.5); //This will make the health show at 100 when the vehicle is not damaged and at 0 when it is in fire.
format(health_string,256,"~r~Health: ~w~%i", final_vehicle_health);
PlayerTextDrawSetString(playerid,HEALTH[playerid], health_string);
PlayerTextDrawShow(playerid,HEALTH[playerid]);