21.11.2011, 11:51
Someone can create me a query mysql to save player stats when a player quit the game?
Here u are the line of DB:
I need to know where I have to put the query that u'll create. Under OnPlayerDisconnect?
I need this query because when a player quit the game and relog, his account are restored. House and business result at the name of the player that bought these but in /stats appear house 999 and the house menu and business menu don't go.
Thanks for your help.
Here u are the line of DB:
PHP код:
mysql_get_field("Money", fetch);
PlayerAccount[playerid][Money] = strval(fetch);
mysql_get_field("CurrentHealth", fetch);
PlayerAccount[playerid][Health] = strval(fetch);
mysql_get_field("Level", fetch);
PlayerAccount[playerid][Level] = strval(fetch);
mysql_get_field("HouseKey", fetch);
PlayerAccount[playerid][HouseKey] = strval(fetch);
mysql_get_field("BizKey", fetch);
PlayerAccount[playerid][BizKey] = strval(fetch);
mysql_get_field("Cigarettes", fetch);
PlayerAccount[playerid][Cigarettes] = strval(fetch);
mysql_get_field("Rope", fetch);
PlayerAccount[playerid][Rope] = strval(fetch);
mysql_get_field("HasGlasses", fetch);
PlayerAccount[playerid][HasGlasses] = strval(fetch);
mysql_get_field("Skin", fetch);
PlayerAccount[playerid][Skin] = strval(fetch);
mysql_get_field("CurrentX", fetch);
PlayerAccount[playerid][pPos][0] = strval(fetch);
mysql_get_field("CurrentY", fetch);
PlayerAccount[playerid][pPos][1] = strval(fetch);
mysql_get_field("CurrentZ", fetch);
PlayerAccount[playerid][pPos][2] = strval(fetch);
mysql_get_field("CurrentInt", fetch);
PlayerAccount[playerid][CurrentInt] = strval(fetch);
mysql_get_field("CurrentVW", fetch);
PlayerAccount[playerid][CurrentVW] = strval(fetch);
mysql_get_field("ID", fetch);
PlayerAccount[playerid][ID] = strval(fetch);
mysql_get_field("HasMask", fetch);
PlayerAccount[playerid][HasMask] = strval(fetch);
mysql_get_field("HasHelmet", fetch);
PlayerAccount[playerid][HasHelmet] = strval(fetch);
mysql_get_field("PhoneCredit", fetch);
PlayerAccount[playerid][PhoneCredit] = strval(fetch);
mysql_get_field("CurrentArmour", fetch);
AccountData[playerid][pArmour] = strval(fetch);
mysql_get_field("Sex", fetch);
PlayerAccount[playerid][psex] = strval(fetch);
mysql_get_field("Drug", fetch);
PlayerAccount[playerid][Drug] = strval(fetch);
mysql_get_field("Materials", fetch);
PlayerAccount[playerid][Materials] = strval(fetch);
mysql_get_field("FightStyle", fetch);
PlayerAccount[playerid][FightStyle] = strval(fetch);
mysql_get_field("Walk", fetch);
PlayerAccount[playerid][Walk] = strval(fetch);
mysql_get_field("Premium", fetch);
PlayerAccount[playerid][Premium] = strval(fetch);
mysql_get_field("WalkieTalkie", fetch);
PlayerAccount[playerid][WalkieTalkie] = strval(fetch);
mysql_get_field("Phone", fetch);
PlayerAccount[playerid][Phone] = strval(fetch);
mysql_get_field("Clan", fetch);
PlayerAccount[playerid][Clan] = strval(fetch);
mysql_get_field("ClanLeader", fetch);
PlayerAccount[playerid][ClanLeader] = strval(fetch);
mysql_get_field("Faction", fetch);
PlayerAccount[playerid][Faction] = strval(fetch);
mysql_get_field("CurrentDuty", fetch);
PlayerAccount[playerid][CurrentDuty] = strval(fetch);
mysql_get_field("Rank", fetch);
PlayerAccount[playerid][Rank] = strval(fetch);
mysql_get_field("CurrentDutySkin", fetch);
PlayerAccount[playerid][CurrentDutySkin] = strval(fetch);
mysql_get_field("Subfaction", fetch);
PlayerAccount[playerid][Subfaction] = strval(fetch);
mysql_get_field("Bank", fetch);
PlayerAccount[playerid][Bank] = strval(fetch);
mysql_get_field("Prestito", fetch);
PlayerAccount[playerid][Prestito] = strval(fetch);
mysql_get_field("Pay", fetch);
PlayerAccount[playerid][Pay] = strval(fetch);
mysql_get_field("Jailed", fetch);
PlayerAccount[playerid][Jailed] = strval(fetch);
mysql_get_field("JailTime", fetch);
PlayerAccount[playerid][JailCell] = strval(fetch);
mysql_get_field("JailCell", fetch);
PlayerAccount[playerid][JailTime] = strval(fetch);
mysql_get_field("Exp", fetch);
PlayerAccount[playerid][Exp] = strval(fetch);
mysql_get_field("Years", fetch);
PlayerAccount[playerid][Years] = strval(fetch);
mysql_get_field("Pills", fetch);
PlayerAccount[playerid][Pills] = strval(fetch);
mysql_get_field("TutorialDone", fetch);
PlayerAccount[playerid][TutorialDone] = strval(fetch);
mysql_get_field("Admin", fetch);
PlayerAccount[playerid][AdminLevel] = strval(fetch);
mysql_get_field("Banned", fetch);
PlayerAccount[playerid][Banned] = strval(fetch);
mysql_get_field("GPS", fetch);
PlayerAccount[playerid][GPS] = strval(fetch);
mysql_get_field("Clock", fetch);
PlayerAccount[playerid][Clock] = strval(fetch);
mysql_get_field("Poste", fetch);
PlayerAccount[playerid][Poste] = strval(fetch);
mysql_get_field("Worker", fetch);
PlayerAccount[playerid][Worker] = strval(fetch);
mysql_get_field("Capelli", fetch);
PlayerAccount[playerid][Capelli] = strval(fetch);
mysql_get_field("Helper", fetch);
PlayerAccount[playerid][Helper] = strval(fetch);
mysql_get_field("MotorBikeLic", fetch);
PlayerAccount[playerid][License][0] = strval(fetch);
mysql_get_field("CarLic", fetch);
PlayerAccount[playerid][License][1] = strval(fetch);
mysql_get_field("TruckLic", fetch);
PlayerAccount[playerid][License][2] = strval(fetch);
mysql_get_field("BusLic", fetch);
PlayerAccount[playerid][License][3] = strval(fetch);
mysql_get_field("BoatLic", fetch);
PlayerAccount[playerid][License][4] = strval(fetch);
mysql_get_field("FlyLic", fetch);
PlayerAccount[playerid][License][5] = strval(fetch);
mysql_get_field("Spawned", fetch);
PlayerAccount[playerid][Spawned] = strval(fetch);
mysql_get_field("Spawn", fetch);
PlayerAccount[playerid][Spawn] = strval(fetch);
mysql_get_field("Activity", fetch);
PlayerAccount[playerid][Activity] = strval(fetch);
mysql_get_field("ActivityLeader", fetch);
PlayerAccount[playerid][ActivityLeader] = strval(fetch);
mysql_get_field("exgm", fetch);
PlayerAccount[playerid][exgm] = strval(fetch);
mysql_get_field("WepLic", fetch);
PlayerAccount[playerid][License][6] = strval(fetch);
mysql_get_field("District", fetch);
PlayerAccount[playerid][District] = strval(fetch);
mysql_get_field("SubDistrict", fetch);
PlayerAccount[playerid][SubDistrict] = strval(fetch);
mysql_get_field("WeaponString", PlayerAccount[playerid][WepString]);
mysql_get_field("BanDays", PlayerAccount[playerid][BanDays]);
mysql_get_field("PremDays", PlayerAccount[playerid][PremDays]);
I need this query because when a player quit the game and relog, his account are restored. House and business result at the name of the player that bought these but in /stats appear house 999 and the house menu and business menu don't go.
Thanks for your help.