#1

F..
Reply
#2

Reply
#3

Anybody?
Reply
#4

pawn Код:
format(price, strlen(price), strval(field[2]);
Reply
#5

Same error.
Reply
#6

Works for me. I can use strlen and not get an error at all. Are you completely sure it's that line? You can also ignore the error if you just do.

pawn Код:
format(price, 64, strval(field[2]);
Edit: Oh wait! Use the one below.

pawn Код:
format(price, strlen(price), strval(field[2]));
Reply
#7

You have declared "price" with the intention to use it as an integer right?

Код:
price[64];
should be
Код:
price;
Why declare an array?

Код:
format(price, sizeof(price), strval(field[2]);
should be

Код:
price = strval(field[2]);
and

Код:
if(PlayerInfo[playerid][pCash] > strval(price))
should be
Код:
if(PlayerInfo[playerid][pCash] > price)
Reply
#8

Quote:
Originally Posted by DJDhan
You have declared "price" with the intention to use it as an integer right?

Код:
price[64];
should be
Код:
price;
Why declare an array?

Код:
format(price, sizeof(price), strval(field[2]);
should be

Код:
price = strval(field[2]);
and

Код:
if(PlayerInfo[playerid][pCash] > strval(price))
should be
Код:
if(PlayerInfo[playerid][pCash] > price)
I just remembered about strlen doesn't format when you mentioned it should be changed, any still the code I put in my edit should work if you change strlen to sizeof
Reply
#9

It complies, but for some reason it still isn't reading the price from the SQL table, keeps saying its 0$.
Reply
#10

pawn Код:
format(price, sizeof(price),"%d", strval(field[2]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)