SA-MP Forums Archive
Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question (/showthread.php?tid=585981)



Question - TheLegend1 - 18.08.2015

hey guys.
Well im asking about car heal
is there a way to define it like 100% and not 1000?
i am already doing but i have it with 1000% and not 100% any one give me a suggest


Re: Question - Beckett - 18.08.2015

Multiple it by 0.1.

pawn Код:
new Float:hp;
GetVehicleHealth(vehicleid,hp);
new Float:percent;
percent = hp*0.1;
printf("Vehicle Health: %%.1f",percent);
1000 becomes %100.
752 becomes %75.2 and so on.


Re: Question - TheLegend1 - 18.08.2015

Thanks man.


Re: Question - Beckett - 18.08.2015

Are you trying to heal the specified player when they type pay? Because if you are, I am not seeing anywhere in the response code where you are setting the player's health, however have you tried debugging it to spot where the error is occuring? Put a print("something to tell the difference from line to another here"); between every response line, print the formats, everything. Then see which print(); doesn't show up in the console and inform me about it.