MYSQL problem
#4

Ok i found where is the problem,
When i connect on server everything is ok, looks good in DB
But when i disconnect it sets the previous player data.

Is something wrong?

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pnamee[24];
	new string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pnamee, sizeof(pnamee));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pnamee);
        case 1: format(string, sizeof(string), "%s has left the server.", pnamee);
    }
    SendClientMessageToAll(COLOR_GREY, string);
	//================================================================//
    //                              MySQL part                        //
    //================================================================//
    if(Logged[playerid] == 1)
	{
		new score = GetPlayerScore(playerid);
        new money = GetPlayerMoney(playerid);
        new query[300], pname[24];
        GetPlayerName(playerid, pname, 24);
        format(query, sizeof(query), "UPDATE playedata SET score=%d, money=%d, admin=%d, vip=%d, skin=%d, banned=%d, bannedby='%s' WHERE user='%s'",score, money, PlayerInfo[playerid][pAdmin] ,PlayerInfo[playerid][pVIP] ,PlayerInfo[playerid][pSkin] ,
		PlayerInfo[playerid][pBanned],
		PlayerInfo[playerid][pBannedBy],
		pname);
        mysql_query(query);
  	}
    return 1;
Reply


Messages In This Thread
MYSQL problem - by FrostDoggy - 10.12.2011, 11:37
Re: MYSQL problem - by THE_KNOWN - 10.12.2011, 11:40
Re: MYSQL problem - by Calgon - 10.12.2011, 11:41
Re: MYSQL problem - by FrostDoggy - 12.12.2011, 12:56
Re: MYSQL problem - by THE_KNOWN - 12.12.2011, 12:58
Re: MYSQL problem - by aniol16 - 12.12.2011, 13:03
Re: MYSQL problem - by FrostDoggy - 12.12.2011, 13:08
Re: MYSQL problem - by THE_KNOWN - 12.12.2011, 13:15
Re: MYSQL problem - by aniol16 - 12.12.2011, 13:19
Re: MYSQL problem - by FrostDoggy - 12.12.2011, 13:32

Forum Jump:


Users browsing this thread: 1 Guest(s)