Problems with name change on MySQL !!!
#1

Hey guy! I have problems with MySQL on my server. When i use command /nrn for player . Dialog will show for player but i can't /approvename [playerid] . Name of player can't change ... Help me
http://pastebin.com/szFVjmDc
Command /approvename
Код:
CMD:approvename(playerid, params[])
{
	new query[128], giveplayerid;
	if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /approvename [player]");

	if(IsPlayerConnected(giveplayerid))
	{
		if (PlayerInfo[playerid][pAdmin] >= 3)
		{
			if(GetPVarInt(giveplayerid, "RequestingNameChange") == 0)
			{
				SendClientMessageEx(playerid, COLOR_GRAD2, "That person isn't requesting a namechange!");
				return 1;
			}
			new newname[MAX_PLAYER_NAME], tmpName[24];
			GetPVarString(giveplayerid, "NewNameRequest", newname, MAX_PLAYER_NAME);
			mysql_real_escape_string(newname, tmpName);
			SetPVarString(giveplayerid, "NewNameRequest", tmpName);

			format(query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `Username`='%s'", tmpName);
			mysql_function_query(MainPipeline, query, true, "OnApproveName", "ii", playerid, giveplayerid);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GRAD2, "You aren't authorized to use this command.");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "No Such Player");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)