Query isnt working
#1

Код:
	public OnPlayerConnect(playerid)
	{
		GetPlayerName(playerid, Name[playerid], (24 + 1));
		GetPlayerIp(playerid, PlayerIP[playerid], (15+1));
		LoadMappings(playerid);
		TogglePlayerSpectating(playerid, true);
		
		CrashCheckTimer[playerid] = SetTimerEx("CheckSpeed", 100, 1, "i", playerid);
		
		IsPlayerNameNonRP(Name[playerid]);
		SetPlayerColor(playerid, COLOR_WHITE);

		LoadPlayerTextDraws(playerid);

		if(!IsPlayerNPC(playerid))
		{
			new query[128];
			mysql_format(sqlHandle, query, sizeof(query), "SELECT `Password`, `ID` FROM `samp_users` WHERE `Username` = '%e'", Name[playerid]);
			mysql_tquery(sqlHandle, query, "OnPlayerConnectMessage", "i", playerid);
			
			print(query);

			SendClientMessage(playerid, COLOR_GREEN, "Welcome to "GAMEMODE_NAME". © "SERVER_OWNER" and "SERVER_DEVELOPER"");
		}
		return 1;
	}
The "SELECT `PASSWORD`, `ID` FROM `samp_users" query isnt wokring :

Код:
	Function:OnPlayerConnectMessage(playerid)
	{
		new rows, fields;
		
		cache_get_data(rows, fields);
		
			cache_get_field_content(0, "Password", Account[playerid][Password]);
			printf("PASS: %s", Account[playerid][Password]);
		
		new string[255];
		
		if(rows)
		{

			if(!isnull(string)) format(string, sizeof(string), "%s", EOS);
			format(string, sizeof(string), "{FFFFFF}Welcome back to {0080C0}"GAMEMODE_NAME"{FFFFFF}, {C0C0C0}%s{FFFFFF}.\n\nPlease enter your {FF0000}password below.{000000}\n{FFFFFF}", GetNameWithSpace(playerid));
			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Welcome to {008080}"GAMEMODE_NAME"", string, "Login", "Quit");

		}
		else
		{
			if(!isnull(string)) format(string, sizeof(string), "%s", EOS);
			format(string, sizeof(string), "{00FF00}Welcome to {008000}"GAMEMODE_NAME"{00FF00}, {008000}%s{00FF00}.\n\n{FFFFFF}We are glad to have you registering here at our server.\n\nYour registration process is simple: \n\n{FFFFFF}1) Type your desired password\n2) Go through the quiz\n", GetNameWithSpace(playerid));
			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{FFFFFF}Welcome to {0080C0}"GAMEMODE_NAME"", string, "Register", "Quit");
		}
		return 1;
	}
cache_get_field_content(0, "Password", Account[playerid][Password]);
printf("PASS: %s", Account[playerid][Password]);

That isn't working, it just prints "PASS:"
Reply


Messages In This Thread
Query isnt working - by sammp - 19.02.2016, 22:38
Re: Query isnt working - by LukeCourt - 20.02.2016, 00:10
Re: Query isnt working - by sammp - 20.02.2016, 00:15
Re: Query isnt working - by AmigaBlizzard - 20.02.2016, 11:51
Re: Query isnt working - by sammp - 20.02.2016, 13:45
Re: Query isnt working - by Misiur - 20.02.2016, 16:43

Forum Jump:


Users browsing this thread: 2 Guest(s)