MySQL: Server says account exists when it does not
#7

Try something like this to save the info,but you may need to mess around with it to perfect it

Код:
stock SavePlayerStats(playerid)
{
        new squery[1000], username[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
        PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
        GetPlayerName(playerid, username, sizeof(username));
        format(squery, sizeof(squery), "UPDATE Users SET Sex = %d,Age = %d, Origin = %d, Warns = %d, Money = %d, Level = %d, VIP = %d, Admin = %d",PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pOrigin], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pAdmin]);
        format(squery, sizeof(squery), "%s,Tester = %d, Kills = %d, Deaths = %d, Muted = %d, Jailed = %d, Banned = %d, X = %f, Y = %f", szQuery, PlayerInfo[playerid][pTester], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pBanned], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY]);
	format(squery, sizeof(squery), "%s,Z = %f, Job = %d, Faction = %d, Rank = %d, WHERE username='%s'", szQuery, PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pRank], username);
        mysql_function_query(dbconnect, squery, false, "OnQueryFinish", "");
        mysql_free_result();
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)