% from sum
#1

Hello, I want create, what give me 30 % from sum.

Try this: new stars=GetPlayerWantedLevel(playerid)*30/100*30;

GetPlayerWantedLevel(playerid)*30 - is sum fine.

And me wrote, what result is 0. But should be 27.

What's wrong?
Reply
#2

If you want to calculate 30% of the current wanted level to a specific level, you should probably do it like:

pawn Код:
new stars = floatround((GetPlayerWantedLevel(playerid) * 0.3), floatround_ceil);
Reply
#3

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)