SA-MP Forums Archive
Strange bug - 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: Strange bug (/showthread.php?tid=85909)



Strange bug - Paranoja - 10.07.2009

Strange bug... I have maded myself a mysql based Characters system. And it takes the rows from the database and cuts them into arrays, one of them is cmoney, means characterpocketmoney. The New smth; thing of it is new cmoney[MAX_PLAYERS]; , MAX_PLAYERS because there will be other characters for this array so i will use cmoney[playerid];
So everything is fine, character gets money when i use GivePlayerMoney();... But when i use a function printf(cmoney[playerid]); it gives me some random letter, or even blank space... How to solve it ? Because i need this array to update my database.

format query, sizeof(query), "UPDATE `something` SET `cmoney` = '%s' WHERE `username` = '%s'", cmoney[playerid], username;
print (query);
Returns me UPDATE `something` SET `cmoney` = '' WHERE `username` = 'Paranoja'
Even know cmoney[playerid] works perfectly on adding the money or somth.