SA-MP Forums Archive
float retuns nothing... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: float retuns nothing... (/showthread.php?tid=437189)



float retuns nothing... - Terminator1 - 14.05.2013

i made a topic about this before thinking i knew the solution which i didnt but i need your help fixing the real problem

pawn Код:
new Float:Money2 = 12.34,
                      Doll = floatround(Money, floatround_floor),
                      Cent = floatround(floatfract(Money2)*100));

    //Remove Once Finished.
    new TestString[150];
    format(TestString, sizeof(TestString), "Starter: %f Doll: %i Cent: %i", Doll, Cent);
well the whole string returns nothing...

Quote:

Starter: 0.00000 Doll: 84 Cent:

now the money2 is set to 12.34 as a debug which returns the same empty space yet should be the 34

another problem is that the float gets erased to 0.000000 when i use it once and i need to use it twice which is what the money variable was created for suggested by a friend

can anyone help?


Re: float retuns nothing... - [HiC]TheKiller - 14.05.2013

Take a quick look at the format line.
pawn Код:
"Starter: %f Doll: %i Cent: %i"
You're noting that there should be three values in the format but you only have 2 there, Doll and Cent.

Try
pawn Код:
format(TestString, sizeof(TestString), "Starter: %f Doll: %i Cent: %i", Money2, Doll, Cent);



AW: float retuns nothing... - HurtLocker - 14.05.2013

I think I answered to this, some hours ago and thats what I said about number of variables and specifiers.

EDIT: why did you create 2 threads? https://sampforum.blast.hk/showthread.php?tid=437191