Difference
#1

What's the difference?
Код HTML:
mysql_format(MySQLCon, qMYSQL[8], 290, "UPDATE `players` SET `BankMoney`=%d WHERE `ID`=%d", plInfo[playerid][pBankMoney],plInfo[playerid][pID]), mysql_tquery(MySQLCon, qMYSQL[8]);
Код HTML:
mysql_format(MySQLCon, qMYSQL[8], 290, "UPDATE `players` SET `BankMoney`=%i WHERE `ID`=%d", plInfo[playerid][pBankMoney],plInfo[playerid][pID]), mysql_tquery(MySQLCon, qMYSQL[8]);
%d / %i?

%d inserts and large numbers? Exemple: 192230192334
Reply
#2

%d stands for double. A double will allow your script to save numbers with a . in that specific variable. For example: 1.2 or 23.451. Usually used for cash.

%i stands for int (integer). An integer will allow your script to save complete numbers. For example 2 or 254 or 85478.
Reply
#3

I don't know where you got this whole float value thing for %d, but %d literally is the same as %i. They are both used for integers, not floats.

If you want a number with a decimal value in it, you should be using %f not %d.

https://sampwiki.blast.hk/wiki/Format

In short, there is no difference.
Reply
#4

Quote:
Originally Posted by TheDrx
Посмотреть сообщение
A double will allow your script to save numbers with a . in that specific variable. For example: 1.2 or 23.451. Usually used for cash.
Not in PAWN. In PAWN, the f (%f) is for numbers with a point, d and i are in PAWN the same.
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Not in PAWN. In PAWN, the f (%f) is for numbers with a point, d and i are in PAWN the same.
My bad then. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)