14.03.2019, 23:19
Hi, how i can get a float number from random? Like random(1) to get 0.52.
There's a much better version in y_utils. The one in that post takes `(max, min)` as parameters, which makes no sense. The one in y_utils either takes `(max)` or `(min, max)`:
https://github.com/pawn-lang/YSI-Inc....inc#L421-L454 |
floatround(0.99, floatround_floor); //returns 0
Just check the wiki: https://sampwiki.blast.hk/wiki/Floatround
There you see, that you have diffrent rounding Methods: https://sampwiki.blast.hk/wiki/Floatround_method For example: PHP код:
|
floatround(x, floatround_floor);
Yes dude, i understood that.
But it seems, you dont understand the use of a function, so read some basics: https://sampwiki.blast.hk/wiki/Scripting_Basics You just have to write: PHP код:
|