SA-MP Forums Archive
[Help] MySQL variables in text. - 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: [Help] MySQL variables in text. (/showthread.php?tid=162680)



[Help] MySQL variables in text. - Kastranova - 24.07.2010

Hello,

i'm busy making my own gamemode with mysql, i'm new with this. i'm trying to fetch data from a database and than use them ingame

i have this code :
Код:
mysql_get_field("cash", Field);
PlayerInfo[playerid][pCash] = strval(Field);
Now i get a good result in numbers but i cant get them in a text like :
Код:
format(message, 256, "You have $ : %s", PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, COLOR_WHITE, message);
but than i get a empty value than.

Please help me with this.


Re: [Help] MySQL variables in text. - armyoftwo - 24.07.2010

%s - is for text
%d - is for numbers

so you should use %d instead of %s!


Re: [Help] MySQL variables in text. - Kastranova - 24.07.2010

but when i use a phonenumber it says just 1 but it have's 6 numbers


Re: [Help] MySQL variables in text. - Kastranova - 24.07.2010

I just get totaly other numbers a 1 becomes a 3 and my phonenumber becomes a 1 while this is a much higher number