SA-MP Forums Archive
right floatsqroot vehicle health param? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: right floatsqroot vehicle health param? (/showthread.php?tid=170102)



[SOLVED]right floatsqroot vehicle health param? - pmk1 - 21.08.2010

hello people, since i'm kind noobish with floatsqroot, what should i put as value there:
Код:
final_vehicle_health = floatsqroot(vehicle_health*vehicle_health)*0.1; // veh's health
at the *0.1, if i keep it like this, in game it shows health: 100, but it takes in fire at 25 since cars get in fire at 250 or 249 w/e.. what must i do so it takes in fire at 0 and not at 25?


Re: right floatsqroot vehicle health param? - [NWA]Hannes - 21.08.2010

A car takes fire when it has vehicle health 249. Black smoke is at 250.
No, this cant be changed.


Re: right floatsqroot vehicle health param? - pmk1 - 21.08.2010

yes i know, but i mean so that on my string it shows 0 when it blows...


Re: right floatsqroot vehicle health param? - pmk1 - 22.08.2010

bummmmmmmp


Re: right floatsqroot vehicle health param? - [NWA]Hannes - 22.08.2010

You mean like, something that sets the textdraw to 0 when vehicle has 249 or less?
If thats the case then its not possible.


Re: right floatsqroot vehicle health param? - pmk1 - 22.08.2010

that's what i mean, so if it's impossible with floatsqroot, with what can i do it?


Re: right floatsqroot vehicle health param? - pmk1 - 22.08.2010

you mean to *0.1 ? if yes it would show health as 75 :\

otherwise i dont know what ur talking about xD


Re: right floatsqroot vehicle health param? - Slice - 22.08.2010

pawn Код:
new Float:health;

GetVehicleHealth( vehicleid, health );

health = ( health < 250.0 ) ? 0.0 : health - 250.0;

if ( health != 0.0 )
    health = health / 7.5;
(or something like that)


Re: right floatsqroot vehicle health param? - pmk1 - 22.08.2010

yea its getting better, but the problem is that it will show 25 health be4 it gets in fire, then sudently go down to 0 :\

you were right, i fixed it with that, thx slice


Re: right floatsqroot vehicle health param? - Mauzen - 22.08.2010

adjustedhealth = (health - 250) / 7.5
if(adjustedhealth < 0) adjustedhealth = 0;

should go down smoothly from 100 (full health) to 0 (starts burning).