Help with Float
#9

Quote:
Originally Posted by mokinys98
Посмотреть сообщение
Thanks for your code worked great
but now i faced with other problemn how to add float to int?
Because player have money (int) and i want add business profit(float)??
You can use https://sampwiki.blast.hk/wiki/Floatround to round the values with one of the methods https://sampwiki.blast.hk/wiki/Floatround_method. Probably rounding down would be the best answer as players will lose a little bit of money but it will be less than 1$ so nobody will be terribly upset (you could even not display decimal values to players so they wouldn't even know they're losing anything).

something like this:
PHP код:
PlayerCash[playerid] += floatround(PlayerProfit[playerid], floatround_floor); 
Reply


Messages In This Thread
Help with Float - by mokinys98 - 26.04.2018, 11:13
Re: Help with Float - by Xportaler - 26.04.2018, 11:17
Re: Help with Float - by mokinys98 - 26.04.2018, 12:00
Re: Help with Float - by CodeStyle175 - 26.04.2018, 12:14
Re: Help with Float - by mokinys98 - 26.04.2018, 12:24
Re: Help with Float - by Bruno13 - 26.04.2018, 13:08
Re: Help with Float - by AdamsLT - 26.04.2018, 13:35
Re: Help with Float - by mokinys98 - 26.04.2018, 14:05
Re: Help with Float - by AdamsLT - 26.04.2018, 14:21
Re: Help with Float - by mokinys98 - 26.04.2018, 14:34

Forum Jump:


Users browsing this thread: 3 Guest(s)