Help with...ehm floatround
#1

"tag missmatch"

I got:

Код:
new Float:b;
b = m/20;
floatround(b, floatround_floor);
p = (b * 20);
m is defined as player money and the warning is at the p = (b * 20) line
Reply
#2

What variable type is p?

Also the floatround(); function doesn't actually store the final result in the variable, it returns the value instead. So it should be used like so, although I don't understand why you'd convert it to a float, so I recommend doing it like this if there's no other reason..

pawn Код:
new b;
b = m/20;
p = (b * 20);
Reply
#3

well the problem is I use it to refuel... 1 gallon = 20$... the m = GetPlayerMoney(playerid);
if he has e.g. 46$ I want the system to find out how many gallons the player can get...so:
new Float: p;
p = m/20; //so Money/price;
but now p is no rounded number... it's 2.4
so I want to round down to 2.0
Reply
#4

Quote:
Originally Posted by Sascha
Посмотреть сообщение
well the problem is I use it to refuel... 1 gallon = 20$... the m = GetPlayerMoney(playerid);
if he has e.g. 46$ I want the system to find out how many gallons the player can get...so:
new Float: p;
p = m/20; //so Money/price;
but now p is no rounded number... it's 2.4
so I want to round down to 2.0
Ok I understand, then you can try this

pawn Код:
new b = floatround(m/20, floatround_floor);
p = (b * 20);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)