29.09.2014, 16:22
Код:
forward SavePlayerData(playerid); public SavePlayerData(playerid) { AntiDeAMX(); if(gIsPlayerLoggedIn[playerid] == 1) { if(gIsPlayerDead[playerid] == 1) { PlayerData[playerid][Dead] = 1; } GetPlayerWeaponData(playerid, 1, PlayerData[playerid][Weapon1], PlayerData[playerid][Weapon1a]); GetPlayerWeaponData(playerid, 2, PlayerData[playerid][Weapon2], PlayerData[playerid][Weapon2a]); GetPlayerWeaponData(playerid, 3, PlayerData[playerid][Weapon3], PlayerData[playerid][Weapon3a]); GetPlayerWeaponData(playerid, 4, PlayerData[playerid][Weapon4], PlayerData[playerid][Weapon4a]); GetPlayerWeaponData(playerid, 5, PlayerData[playerid][Weapon5], PlayerData[playerid][Weapon5a]); GetPlayerWeaponData(playerid, 6, PlayerData[playerid][Weapon6], PlayerData[playerid][Weapon6a]); GetPlayerWeaponData(playerid, 7, PlayerData[playerid][Weapon7], PlayerData[playerid][Weapon7a]); GetPlayerWeaponData(playerid, 8, PlayerData[playerid][Weapon8], PlayerData[playerid][Weapon8a]); GetPlayerWeaponData(playerid, 9, PlayerData[playerid][Weapon9], PlayerData[playerid][Weapon9a]); GetPlayerWeaponData(playerid, 10, PlayerData[playerid][Weapon10], PlayerData[playerid][Weapon10a]); GetPlayerWeaponData(playerid, 11, PlayerData[playerid][Weapon11], PlayerData[playerid][Weapon11a]); GetPlayerWeaponData(playerid, 12, PlayerData[playerid][Weapon12], PlayerData[playerid][Weapon12a]); //GetPlayerSkin(playerid); new Float:X, Float:Z, Float:Y, Float:A, Float:H, Float:Ar; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,A); GetPlayerHealth(playerid, H); GetPlayerArmour(playerid, Ar); mysql_format(Mysql_users, query, sizeof(query), "UPDATE `"ZAIDEJU_LENTELE"` SET Fullname='%e', Password='%e', PositionX='%f', PositionY='%f', PositionZ='%f', PositionA='%f', Health='%f', Armour='%f', Interior='%d', VirtualWorld='%d', AdminLevel='%d', AdminKey='%d', AdminTime='%d', Banned='%d', BannedBy='%e', BanReason='%e'",\ PlayerData[playerid][Fullname], PlayerData[playerid][Password], X, Y, Z, A, H, Ar, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), PlayerData[playerid][AdminLevel], PlayerData[playerid][AdminKey], PlayerData[playerid][AdminTime], PlayerData[playerid][Banned], PlayerData[playerid][BannedBy], PlayerData[playerid][BanReason]); mysql_format(Mysql_users, query, sizeof(query), "%s, Warnings='%d', Warning1Reason='%e', Warning2Reason='%e', Warning3Reason='%e', WarnedBy1='%e', WarnedBy2='%e', WarnedBy3='%e', Dead='%d', HospitalTime='%d', Telefonas='%d', Tinklas='%d', Numeris='%d', tBaterija='%d', tBaterijosBukle='%d', tBukle='%d', tPakrovejas='%d'",\ query, PlayerData[playerid][Warnings], PlayerData[playerid][Warning1Reason], PlayerData[playerid][Warning2Reason], PlayerData[playerid][Warning3Reason], PlayerData[playerid][WarnedBy1], PlayerData[playerid][WarnedBy2], PlayerData[playerid][WarnedBy3], PlayerData[playerid][Dead], PlayerData[playerid][HospitalTime], PlayerData[playerid][Telefonas], PlayerData[playerid][Tinklas], PlayerData[playerid][Numeris], PlayerData[playerid][tBaterija], PlayerData[playerid][tBaterijosBukle], PlayerData[playerid][tBukle], PlayerData[playerid][tPakrovejas]); mysql_format(Mysql_users, query, sizeof(query), "%s, Helper='%d', Money='%d', MoneyBank='%d', Score='%d', Skin='%d', Hour='%d', Min='%d', Sec='%d', Kills='%d', Deaths='%d', Kreditai='%d', Taskai='%d', nLicenzija='%d', Navigacija='%d', Radijas='%d',VipLevel='%d',VipKey='%d',VipTime='%d', Premium='%d', PremiumTime='%d'",\ query, PlayerData[playerid][Helper], GetPlayerMoney(playerid), PlayerData[playerid][MoneyBank], GetPlayerScore(playerid), PlayerData[playerid][Skin], PlayerData[playerid][Hour], PlayerData[playerid][Min], PlayerData[playerid][Sec], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][Kreditai], PlayerData[playerid][Taskai], PlayerData[playerid][nLicenzija], PlayerData[playerid][Navigacija], PlayerData[playerid][Radijas], PlayerData[playerid][VipLevel], PlayerData[playerid][VipKey], PlayerData[playerid][VipTime], PlayerData[playerid][Premium], PlayerData[playerid][PremiumTime]); mysql_format(Mysql_users, query, sizeof(query), "%s, Weapon1='%d', Weapon1a='%d', Weapon2='%d', Weapon2a='%d', Weapon3='%d', Weapon3a='%d', Weapon4='%d', Weapon4a='%d', Weapon5='%d', Weapon5a='%d', Weapon6='%d', Weapon6a='%d', Wanted='%d', Muted='%d', MutedTime='%d', Job='%d', JobSkin='%d', Alga='%d', Picos='%d'",\ query, PlayerData[playerid][Weapon1], PlayerData[playerid][Weapon1a], PlayerData[playerid][Weapon2], PlayerData[playerid][Weapon2a], PlayerData[playerid][Weapon3], PlayerData[playerid][Weapon3a], PlayerData[playerid][Weapon4], PlayerData[playerid][Weapon4a], PlayerData[playerid][Weapon5], PlayerData[playerid][Weapon5a], PlayerData[playerid][Weapon6], PlayerData[playerid][Weapon6a], GetPlayerWantedLevel(playerid), PlayerData[playerid][Muted], PlayerData[playerid][MutedTime], PlayerData[playerid][Job], PlayerData[playerid][JobSkin], PlayerData[playerid][Alga], JobInventorData[playerid][Picos]); mysql_format(Mysql_users, query, sizeof(query), "%s, Weapon7='%d', Weapon7a='%d', Weapon8='%d', Weapon8a='%d', Weapon9='%d', Weapon9a='%d', Weapon10='%d', Weapon10a='%d', Weapon11='%d', Weapon11a='%d', Weapon12='%d', Weapon12a='%d', Gender='%d', UseJobSkin='%d', HouseID='%d', BusinessID='%d', tSaskaitoje='%d'",\ query, PlayerData[playerid][Weapon7], PlayerData[playerid][Weapon7a], PlayerData[playerid][Weapon8], PlayerData[playerid][Weapon8a], PlayerData[playerid][Weapon9], PlayerData[playerid][Weapon9a], PlayerData[playerid][Weapon10], PlayerData[playerid][Weapon10a], PlayerData[playerid][Weapon11], PlayerData[playerid][Weapon11a], PlayerData[playerid][Weapon12], PlayerData[playerid][Weapon12a], PlayerData[playerid][Gender], PlayerData[playerid][UseJobSkin], PlayerData[playerid][pHouseID], PlayerData[playerid][pBusinessID], PlayerData[playerid][tSaskaitoje]); mysql_tquery(Mysql_users, query, "", ""); mysql_format(Mysql_users, query, sizeof(query), "%s, Misija1='%d', Misija2='%d', Misija3='%d', Misija4='%d', Misija5='%d', Misija6='%d', Misija7='%d', Misija8='%d', Misija9='%d', Misija10='%d', Misija11='%d', Misija12='%d', Misija13='%d', Misija14='%d', Misija15='%d', Misija16='%d', Misija17='%d', tPapildymas='%d'",\ query, MissionData[playerid][Misija1], MissionData[playerid][Misija2], MissionData[playerid][Misija3], MissionData[playerid][Misija4], MissionData[playerid][Misija5], MissionData[playerid][Misija6], MissionData[playerid][Misija7], MissionData[playerid][Misija8], MissionData[playerid][Misija9], MissionData[playerid][Misija10], MissionData[playerid][Misija11], MissionData[playerid][Misija12], MissionData[playerid][Misija13], MissionData[playerid][Misija14], MissionData[playerid][Misija15], MissionData[playerid][Misija16], MissionData[playerid][Misija17], PlayerData[playerid][tPapildymas]); mysql_tquery(Mysql_users, query, "", ""); mysql_format(Mysql_users, query, sizeof(query), "%s, Misija18='%d', Misija19='%d', Misija20='%d', Misija21='%d', Misija22='%d', Misija23='%d', Misija24='%d', Misija25='%d', Misija26='%d', Misija27='%d', Misija28='%d', Misija29='%d', Misija30='%d', EventGold='%d', EventSilver='%d', EventBronze='%d' WHERE Fullname='%e'",\ query, MissionData[playerid][Misija18], MissionData[playerid][Misija19], MissionData[playerid][Misija20], MissionData[playerid][Misija21], MissionData[playerid][Misija22], MissionData[playerid][Misija23], MissionData[playerid][Misija24], MissionData[playerid][Misija25], MissionData[playerid][Misija26], MissionData[playerid][Misija27], MissionData[playerid][Misija28], MissionData[playerid][Misija29], MissionData[playerid][Misija30], PlayerData[playerid][EventGold], PlayerData[playerid][EventSilver], PlayerData[playerid][EventBronze], GetPlayersName(playerid)); mysql_tquery(Mysql_users, query, "", ""); } }