AAAA - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AAAA (
/showthread.php?tid=156098)
AAAA -
Antonio [G-RP] - 21.06.2010
F..
Re: More errors (/buycar) -
Antonio [G-RP] - 21.06.2010
Re: More errors (/buycar) -
Antonio [G-RP] - 21.06.2010
Anybody?
Re: More errors (/buycar) -
Carlton - 21.06.2010
pawn Код:
format(price, strlen(price), strval(field[2]);
Re: More errors (/buycar) -
Antonio [G-RP] - 21.06.2010
Same error.
Re: More errors (/buycar) -
Carlton - 21.06.2010
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]));
Re: More errors (/buycar) -
DJDhan - 21.06.2010
You have declared "price" with the intention to use it as an integer right?
should be
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)
Re: More errors (/buycar) -
Carlton - 21.06.2010
Quote:
Originally Posted by DJDhan
You have declared "price" with the intention to use it as an integer right?
should be 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
Re: More errors (/buycar) -
Antonio [G-RP] - 21.06.2010
It complies, but for some reason it still isn't reading the price from the SQL table, keeps saying its 0$.
Re: More errors (/buycar) -
Hiddos - 21.06.2010
pawn Код:
format(price, sizeof(price),"%d", strval(field[2]);