12.12.2011, 12:56
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?
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;