Mysql Problem
#6

Код:
stock SaveAccount(playerid) {
    // The query threads continue in the callback for finished queries.
	if(GetPVarInt(playerid, "TempName") != 1 && gPlayerLogged[playerid] && AdminDuty[playerid] == 0) {
	    
		new
			szPlayerName[MAX_PLAYER_NAME],
			szPlayerName2[MAX_PLAYER_NAME],
			szAdminName[MAX_PLAYER_NAME],
		    szQuery[2048];

		GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
		
		mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);
		mysql_real_escape_string(PlayerInfo[playerid][pAdminName], szAdminName, g_MySQLConnections[0]);

		format(szQuery, sizeof(szQuery), "UPDATE players SET Username = '%s', Password = '%s', Level = %d, AdminLevel = %d, AdminName = '%s', BanAppealer = %d, Donator = %d, Banned = %d, Permabanned = %d, Disabled = %d, LastIP = '%s', Registered = %d, \
		Tutorial = %d, Sex = %d, Age = %d, Skin = %d, PosX = '%f', PosY = '%f', PosZ = '%f', PosR = '%f', ConnectTime = %d, Respect = %d, PhoneNumber = %d, Warnings = %d, Gang = %d, Faction = %d, Leader = %d, Rank = %d WHERE ID = %d",
		szPlayerName, PlayerInfo[playerid][pKey], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], szAdminName, PlayerInfo[playerid][pBanAppealer], PlayerInfo[playerid][pDonator], PlayerInfo[playerid][pBanned],
		PlayerInfo[playerid][pPermaBanned], PlayerInfo[playerid][pDisabled], PlayerInfo[playerid][pIP], PlayerInfo[playerid][pReg], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x],
		PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pPos_r], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pRespect], PlayerInfo[playerid][pNumber], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pGang],
		PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pID]);

		mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_1, playerid, g_MySQLConnections[0]);
	}
	return 1;
}
Reply


Messages In This Thread
Mysql Problem - by IndependentGaming - 01.12.2014, 21:17
Re: Mysql Problem - by Raweresh - 01.12.2014, 21:21
Re: Mysql Problem - by AnthonyTimmers - 01.12.2014, 21:29
Re: Mysql Problem - by IndependentGaming - 01.12.2014, 21:33
Re: Mysql Problem - by Raweresh - 01.12.2014, 21:40
Re: Mysql Problem - by IndependentGaming - 01.12.2014, 21:41
Re: Mysql Problem - by Raweresh - 01.12.2014, 21:45
Re: Mysql Problem - by AnthonyTimmers - 01.12.2014, 21:46
Re: Mysql Problem - by IndependentGaming - 01.12.2014, 21:49
Re: Mysql Problem - by IndependentGaming - 01.12.2014, 22:02

Forum Jump:


Users browsing this thread: 1 Guest(s)