float problems
#4

Make sure that PlayerInfo[playerid][pFloatt]* and KIP[eBuyPrice]* are both floats. Just to be safe, you could convert 4200 to float, therefore making it 4200.0 or float(4200).

pawn Код:
new Float:foo;
    foo += 4200.0/500000.0;
    printf("%.5f", foo);
This happens because integer division truncates (4200/500000 < 0, so it truncates — rounds down — to 0), so you need to make sure atleast one of the parameters is of type float.

* In your enums, set pFloatt to Float: pFloatt and eBuyPrice to Float:eBuyPrice.
Reply


Messages In This Thread
float problems - by IdonTmiss - 02.08.2018, 22:38
Re: float problems - by GRiMMREAPER - 02.08.2018, 22:45
Re: float problems - by IdonTmiss - 02.08.2018, 22:48
Re: float problems - by GRiMMREAPER - 02.08.2018, 23:00
Re: float problems - by IdonTmiss - 02.08.2018, 23:03
Re: float problems - by GRiMMREAPER - 02.08.2018, 23:10
Re: float problems - by IdonTmiss - 02.08.2018, 23:38

Forum Jump:


Users browsing this thread: 1 Guest(s)