mySQL money load does not work - 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)
+--- Thread: mySQL money load does not work (
/showthread.php?tid=404857)
mySQL money load does not work -
PDChaseOfficial - 04.01.2013
Код:
stock LoadPlayerStats(playerid)
{
new query[100];
new name[25];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"SELECT * FROM `Users` WHERE `Username` = '%s' LIMIT 1",name);
mysql_query(query);
new sqlname[25];
new sqlpass[50];
new sqlcash;
new sqlstring[100];
sscanf(sqlstring,"p<|>s[25]s[50]i",sqlname,sqlpass,sqlcash);
mysql_free_result();
format(sqlstring,sizeof(sqlstring),"Name: %s, Pass: %s, Cash: %i.",sqlname,sqlpass,sqlcash);
SendClientMessage(playerid,COLOR_RED,sqlstring);
return 1;
}
It writes Name: ,Pass: , Cash:0.
Do you know where im making the mistake?
Re: mySQL money load does not work -
aslan890 - 04.01.2013
I thing the problem is here am not sure
Quote:
mysql_query(query);
new sqlname[25];
new sqlpass[50];
new sqlcash;
|
Re: mySQL money load does not work -
PDChaseOfficial - 04.01.2013
why would that be a problem? Im just declaring variables. first 2 are strings and third one is a integer.