mySQL money load does not work
#1

Код:
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?
Reply
#2

I thing the problem is here am not sure

Quote:

mysql_query(query);
new sqlname[25];
new sqlpass[50];
new sqlcash;

Reply
#3

why would that be a problem? Im just declaring variables. first 2 are strings and third one is a integer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)