Help with vehicle health on speedometer
#1

Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
	new oststring[100];
	new Float:Ostetenost;
	GetVehicleHealth(vehicleid, Ostetenost);
	format(oststring,256,"~%s~%.0f.0", Ostetenost);
	TextDrawSetString(SpeedoGPS[playerid], oststring);
    return 1;
}
http://i.imgur.com/pV7TdXa.png

Ignore that SpeedoGPS this is my fault with name

Look Under Gorivo:100.. Why its .0 not under 1000.00 like example:768.24
Reply
#2

I declared a variable in which I stored the rounded value

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new oststring[32], Float:Ostetenost, healthveh;
   
    GetVehicleHealth(vehicleid, Ostetenost);
    helthveh = floatround(Ostetenost, floatround_tozero);
   
    format(oststring, 32, "~%s~%d.0", healthveh);
    TextDrawSetString(SpeedoGPS[playerid], oststring);
    return 1;
}
Reply
#3

http://i.imgur.com/4h1piSU.png again :@@@@@@@@@
Reply
#4

Aaaaah I understood
Код:
format(oststring, 32, "~%s~%d.0", healthveh);
You see ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)