Reducing a Variable OnPlayerUpdate -
MikeEd - 29.07.2014
Hi, i'm new to this forum.
I just need help on this following code.
This code is placed under OnPlayerUpdate and i'd like to know if there is anyway to reduce it by 0.5
Thanks in Advance.
Re: Reducing a Variable OnPlayerUpdate -
Tamer - 29.07.2014
It must be a float. Change the definition to:
pawn Код:
new Float:FireHealth;
FireHealth -= 0.5;
Re: Reducing a Variable OnPlayerUpdate -
MikeEd - 29.07.2014
Mhm, tired that and the it set the fire health to about 126253526/100 and i was trying to put it out and it went out before it went to 0.
Re: Reducing a Variable OnPlayerUpdate -
MikeEd - 31.07.2014
bump.
Re: Reducing a Variable OnPlayerUpdate -
MikeEd - 11.09.2014
This problem is still not solved, i'd love some help.
Re: Reducing a Variable OnPlayerUpdate -
Ihateyou - 11.09.2014
because when u display the variable u need to use %f (float) not %d (integer)
Re: Reducing a Variable OnPlayerUpdate -
MikeEd - 11.09.2014
Thanks, one last question... It prints our something like 100.000/100 how am i suppose to change that to just the integer, i've tried float round but it results in 0.00000
Re: Reducing a Variable OnPlayerUpdate -
Tamer - 12.09.2014
Quote:
Originally Posted by MikeEd
Thanks, one last question... It prints our something like 100.000/100 how am i suppose to change that to just the integer, i've tried float round but it results in 0.00000
|
Hey again,
which round method did you use? Also are you sure if your float was actually a float, or was it set? Because if the number is not a float or it is not set you'll get 0.
Edit: One second I'm on this.
Instead of using %f use : %0.3f now that will only give 3 digits, if you need more adjust the number, or decrease it.
Re: Reducing a Variable OnPlayerUpdate -
RedCrossER - 12.09.2014
https://sampwiki.blast.hk/wiki/Floatround
Re: Reducing a Variable OnPlayerUpdate -
Ihateyou - 12.09.2014
delete this post