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);