SA-MP Forums Archive
SQL DOESN'T 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: SQL DOESN'T WORK!! (/showthread.php?tid=409595)



SQL DOESN'T WORK!! - PaulDinam - 22.01.2013

the message not showing up

Код:
public OnAccountCheck(playerid)
{
	new str[256];
	new rows, fields;
	cache_get_data(rows, fields);
	if(rows)
	{
        SendClientMessage(playerid, -1, "Hey,");
	}
	else
	{
	
	}
        return 1;
}

stock CheckAccount(playerid)
{
	new query[256],escapedPlayerName[MAX_PLAYER_NAME];
	mysql_real_escape_string(GetName(playerid), escapedPlayerName);
	format(query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%s' LIMIT 1", escapedPlayerName);
	mysql_function_query(dbHandle, query, true, "OnAccountCheck", "d", playerid);
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	CheckAccount(playerid);
	return 1;
}