Advertisement
Guest User

Untitled

a guest
May 26th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.38 KB | None | 0 0
  1. if(IsPlayerConnected(playerid))
  2. {
  3. if(gPlayerLogged[playerid])
  4. {
  5. MySQLCheckConnection();
  6. new query[MAX_STRING];
  7. format(query, MAX_STRING, "UPDATE players SET ");
  8. MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
  9. PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
  10. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PlayerLevel", PlayerInfo[playerid][pLevel]);
  11. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "AdminLevel", PlayerInfo[playerid][pAdmin]);
  12. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DonateRank", PlayerInfo[playerid][pDonateRank]);
  13. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
  14. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "ConnectedTime", PlayerInfo[playerid][pConnectTime]);
  15. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Tutorial", PlayerInfo[playerid][pTut]);
  16. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Registered", PlayerInfo[playerid][pReg]);
  17. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Origin", PlayerInfo[playerid][pOrigin]);
  18. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CK", PlayerInfo[playerid][pCK]);
  19. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SacDos", PlayerInfo[playerid][pSac]);
  20. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Muted", PlayerInfo[playerid][pMuted]);
  21. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Respect", PlayerInfo[playerid][pExp]);
  22. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Money", PlayerInfo[playerid][pCash]);
  23. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Bank", PlayerInfo[playerid][pAccount]);
  24. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Crimes", PlayerInfo[playerid][pCrimes]);
  25. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Kills", PlayerInfo[playerid][pKills]);
  26. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Deaths", PlayerInfo[playerid][pDeaths]);
  27. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Arrested", PlayerInfo[playerid][pArrested]);
  28. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "WantedDeaths", PlayerInfo[playerid][pWantedDeaths]);
  29. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Phonebook", PlayerInfo[playerid][pPhoneBook]);
  30. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "LottoNr", PlayerInfo[playerid][pLottoNr]);
  31. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Fishes", PlayerInfo[playerid][pFishes]);
  32. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BiggestFish", PlayerInfo[playerid][pBiggestFish]);
  33. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Job", PlayerInfo[playerid][pJob]);
  34. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Paycheck", PlayerInfo[playerid][pPayCheck]);
  35. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "HeadValue", PlayerInfo[playerid][pHeadValue]);
  36. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Jailed", PlayerInfo[playerid][pJailed]);
  37. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "JailTime", PlayerInfo[playerid][pJailTime]);
  38. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Materials", PlayerInfo[playerid][pMats]);
  39. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Drugs", PlayerInfo[playerid][pDrugs]);
  40. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Leader", PlayerInfo[playerid][pLeader]);
  41. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Member", PlayerInfo[playerid][pMember]);
  42. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FMember", PlayerInfo[playerid][pFMember]);
  43. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Rank", PlayerInfo[playerid][pRank]);
  44. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Chara", PlayerInfo[playerid][pChar]);
  45. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "ContractTime", PlayerInfo[playerid][pContractTime]);
  46. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DetSkill", PlayerInfo[playerid][pDetSkill]);
  47. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "TrkSkill", PlayerInfo[playerid][pTruckSkill]);
  48. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SexSkill", PlayerInfo[playerid][pSexSkill]);
  49. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BoxSkill", PlayerInfo[playerid][pBoxSkill]);
  50. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "LawSkill", PlayerInfo[playerid][pLawSkill]);
  51. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MechSkill", PlayerInfo[playerid][pMechSkill]);
  52. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "JackSkill", PlayerInfo[playerid][pJackSkill]);
  53. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarSkill", PlayerInfo[playerid][pCarSkill]);
  54. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "NewsSkill", PlayerInfo[playerid][pNewsSkill]);
  55. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DrugsSkill", PlayerInfo[playerid][pDrugsSkill]);
  56. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CookSkill", PlayerInfo[playerid][pCookSkill]);
  57. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FishSkill", PlayerInfo[playerid][pFishSkill]);
  58. MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "pSHealth", PlayerInfo[playerid][pSHealth]);
  59. GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
  60. MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "pHealth", PlayerInfo[playerid][pHealth]);
  61. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Inte", PlayerInfo[playerid][pInt]);
  62. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Local", PlayerInfo[playerid][pLocal]);
  63. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Team", PlayerInfo[playerid][pTeam]);
  64. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Model", PlayerInfo[playerid][pModel]);
  65. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PhoneNr", PlayerInfo[playerid][pPnumber]);
  66. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "House", PlayerInfo[playerid][pPhousekey]);
  67. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Appt", PlayerInfo[playerid][pPapptkey]);
  68. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Bizz", PlayerInfo[playerid][pPbiskey]);
  69. if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
  70. {
  71. PlayerInfo[playerid][pPos_x] = 1684.9;
  72. PlayerInfo[playerid][pPos_y] = -2244.5;
  73. PlayerInfo[playerid][pPos_z] = 13.5;
  74. }
  75. if(Spectate[playerid] != 255)
  76. {
  77. PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
  78. PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
  79. PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
  80. PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
  81. PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
  82. }
  83. MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_x", PlayerInfo[playerid][pPos_x]);
  84. MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_y", PlayerInfo[playerid][pPos_y]);
  85. MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_z", PlayerInfo[playerid][pPos_z]);
  86. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarLic", PlayerInfo[playerid][pCarLic]);
  87. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FlyLic", PlayerInfo[playerid][pFlyLic]);
  88. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BoatLic", PlayerInfo[playerid][pBoatLic]);
  89. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FishLic", PlayerInfo[playerid][pFishLic]);
  90. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "GunLic", PlayerInfo[playerid][pGunLic]);
  91. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun1", PlayerInfo[playerid][pGun1]);
  92. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun2", PlayerInfo[playerid][pGun2]);
  93. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun3", PlayerInfo[playerid][pGun3]);
  94. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun4", PlayerInfo[playerid][pGun4]);
  95. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo1", PlayerInfo[playerid][pAmmo1]);
  96. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo2", PlayerInfo[playerid][pAmmo2]);
  97. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo3", PlayerInfo[playerid][pAmmo3]);
  98. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo4", PlayerInfo[playerid][pAmmo4]);
  99. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Deagle", PlayerInfo[playerid][pDeagle]);
  100. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Shotgun", PlayerInfo[playerid][pShotgun]);
  101. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Rifle", PlayerInfo[playerid][pRifle]);
  102. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SDPistol", PlayerInfo[playerid][pSDPistol]);
  103. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MP5", PlayerInfo[playerid][pMP5]);
  104. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "M4", PlayerInfo[playerid][pM4]);
  105. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "AK47", PlayerInfo[playerid][pAK47]);
  106. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarTime", PlayerInfo[playerid][pCarTime]);
  107. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PayDay", PlayerInfo[playerid][pPayDay]);
  108. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PayDayHad", PlayerInfo[playerid][pPayDayHad]);
  109. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CDPlayer", PlayerInfo[playerid][pCDPlayer]);
  110. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Wins", PlayerInfo[playerid][pWins]);
  111. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Loses", PlayerInfo[playerid][pLoses]);
  112. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "AlcoholPerk", PlayerInfo[playerid][pAlcoholPerk]);
  113. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DrugPerk", PlayerInfo[playerid][pDrugPerk]);
  114. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MiserPerk", PlayerInfo[playerid][pMiserPerk]);
  115. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PainPerk", PlayerInfo[playerid][pPainPerk]);
  116. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "TraderPerk", PlayerInfo[playerid][pTraderPerk]);
  117. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Tutorial", PlayerInfo[playerid][pTut]);
  118. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Mission", PlayerInfo[playerid][pMissionNr]);
  119. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Warnings", PlayerInfo[playerid][pWarns]);
  120. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Adjustable", PlayerInfo[playerid][pAdjustable]);
  121. if(PlayerInfo[playerid][pDonateRank] < 1) { PlayerInfo[playerid][pFuel] = 0; }
  122. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Fuel", PlayerInfo[playerid][pFuel]);
  123. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Married", PlayerInfo[playerid][pMarried]);
  124. MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Locked", PlayerInfo[playerid][pLocked]);
  125. MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);
  126. printf("Compte sauvegardé : %d.",PlayerInfo[playerid][pSQLID]);
  127. }
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement