Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.52 KB | None | 0 0
  1. public LoadPlayerDataSequence(playerid, l_step)
  2. {
  3. switch(l_step)
  4. {
  5. case 1:
  6. {
  7. new count = cache_get_field_content_int(0, "count");
  8. if(count)
  9. {
  10. strdel(DialogString, 0, sizeof(DialogString));
  11. strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
  12. format(DialogString, sizeof(DialogString), COLOR_HEX_WHITE"%sDein Name lautet: "COLOR_HEX_BLUE"%s"COLOR_HEX_WHITE".\n", DialogString, GetName(playerid));
  13. strcat(DialogString, COLOR_HEX_WHITE"Du kannst dich nun mit deinem Passwort anmelden.\n\n");
  14. strcat(DialogString, COLOR_HEX_YELLOW"INFO: Wenn du dein Passwort vergessen hast, melde dich im Forum bei einem Team-Mitglied!");
  15. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, COLOR_HEX_BLUE""SERVER_NAME": Anmeldung", DialogString, "Anmelden", "Abbrechen");
  16. return 1;
  17. }
  18. else
  19. {
  20. strdel(DialogString, 0, sizeof(DialogString));
  21. strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
  22. strcat(DialogString, COLOR_HEX_WHITE"Da du neu auf unserem Server bist, solltest du dir zuerst einen Account anlegen.\n");
  23. strcat(DialogString, COLOR_HEX_WHITE"Gebe dazu in dem unteren Feld dein gewünschtes Passwort ein.\n");
  24. strcat(DialogString, COLOR_HEX_YELLOW"\nINFO: Wähle ein Passwort was du nicht überall bbenutzt, besonders auf anderen Servern.\n");
  25. strcat(DialogString, COLOR_HEX_YELLOW"Nutze am besten Sonderzeichen, Zahlen sowie Große und Kleine Buchstaben.");
  26. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, COLOR_HEX_BLUE""SERVER_NAME": Registration", DialogString, "Registrieren", "Abbrechen");
  27. return 1;
  28. }
  29. }
  30. case 2:
  31. {
  32. new count = cache_get_field_content_int(0, "count");
  33. if(count)
  34. {
  35. new query[64+MAX_PLAYER_NAME+1];
  36. mysql_format(myCon, query, sizeof(query), "SELECT * FROM `script_accounts` WHERE `Name` = '%s'", GetName(playerid));
  37. mysql_function_query(myCon, query, true, "LoadPlayerDataSequence", "dd", playerid, 3);
  38. }
  39. else
  40. {
  41. strdel(DialogString, 0, sizeof(DialogString));
  42. strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
  43. format(DialogString, sizeof(DialogString), COLOR_HEX_WHITE"%sDein Name lautet: "COLOR_HEX_BLUE"%s"COLOR_HEX_WHITE".\n", DialogString, GetName(playerid));
  44. strcat(DialogString, COLOR_HEX_WHITE"Du kannst dich nun mit deinem Passwort anmelden.\n\n");
  45. strcat(DialogString, COLOR_HEX_YELLOW"INFO: Wenn du dein Passwort vergessen hast, melde dich im Forum bei einem Team-Mitglied!");
  46. strcat(DialogString, COLOR_HEX_SERVER"\n\nFEHLER: Du hast ein falsches Passwort angegeben.");
  47. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, COLOR_HEX_BLUE""SERVER_NAME": Anmeldung", DialogString, "Anmelden", "Abbrechen");
  48. return 1;
  49. }
  50. }
  51. case 3:
  52. {
  53. new query[128];
  54. Spieler[playerid][pLevel] = cache_get_field_content_int(0, "Level");
  55. Spieler[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
  56. Spieler[playerid][pSpawnHealth] = cache_get_field_content_float(0, "SpawnHealth");
  57. Spieler[playerid][pOrgMember] = cache_get_field_content_int(0, "OrgMember");
  58. Spieler[playerid][pSkillDrug] = cache_get_field_content_float(0, "SkillDrug");
  59. Spieler[playerid][pPayDay] = cache_get_field_content_int(0, "PayDay");
  60. Spieler[playerid][pExp] = cache_get_field_content_int(0, "Exp");
  61. Spieler[playerid][pFraktion] = cache_get_field_content_int(0, "Fraktion");
  62. Spieler[playerid][pTutorial] = cache_get_field_content_int(0, "Tutorial");
  63. Spieler[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
  64. Spieler[playerid][pFrakSkin] = cache_get_field_content_int(0, "FrakSkin");
  65. Spieler[playerid][pGeschlecht] = cache_get_field_content_int(0, "Geschlecht");
  66. Spieler[playerid][pHitsound] = cache_get_field_content_int(0, "Hitsound");
  67. Spieler[playerid][pMessages] = cache_get_field_content_int(0, "Messages");
  68. Spieler[playerid][pPerso] = cache_get_field_content_int(0, "Perso");
  69. Spieler[playerid][pCarLicense] = cache_get_field_content_int(0, "CarLicense");
  70. Spieler[playerid][pContract] = cache_get_field_content_int(0, "Contract");
  71. Spieler[playerid][pContractCount] = cache_get_field_content_int(0, "ContractCount");
  72. Spieler[playerid][pCarLicensePoints] = cache_get_field_content_int(0, "CarLicensePoints");
  73. Spieler[playerid][pFlyLicense] = cache_get_field_content_int(0, "FlyLicense");
  74. Spieler[playerid][pBoatLicense] = cache_get_field_content_int(0, "BoatLicense");
  75. Spieler[playerid][pFishLicense] = cache_get_field_content_int(0, "FishLicense");
  76. Spieler[playerid][pGunLicense] = cache_get_field_content_int(0, "GunLicense");
  77. Spieler[playerid][pZollpass] = cache_get_field_content_int(0, "Zollpass");
  78. Spieler[playerid][pJob] = cache_get_field_content_int(0, "Job");
  79. Spieler[playerid][pWanteds] = cache_get_field_content_int(0, "Wanteds");
  80. Spieler[playerid][pMoney] = cache_get_field_content_int(0, "Money");
  81. Spieler[playerid][pIsEhrenhaft] = cache_get_field_content_int(0, "IsEhrenhaft");
  82. Spieler[playerid][pQuitJob] = cache_get_field_content_int(0, "QuitJob");
  83. Spieler[playerid][pJobMoney] = cache_get_field_content_int(0, "JobMoney");
  84. Spieler[playerid][pJobCount] = cache_get_field_content_int(0, "JobCount");
  85. Spieler[playerid][pBusSkill] = cache_get_field_content_int(0, "BusSkill");
  86. Spieler[playerid][pTruckSkill] = cache_get_field_content_int(0, "TruckSkill");
  87. Spieler[playerid][pTruckSkillEXP] = cache_get_field_content_int(0, "TruckSkillEXP");
  88. Spieler[playerid][pBusSkillEXP] = cache_get_field_content_int(0, "BusSkillEXP");
  89. Spieler[playerid][pDetektivSkill] = cache_get_field_content_int(0, "DetektivSkill");
  90. Spieler[playerid][pDetektivSkillEXP] = cache_get_field_content_int(0, "DetektivSkillEXP");
  91. Spieler[playerid][pTot] = cache_get_field_content_int(0, "Tot");
  92. Spieler[playerid][pTotUnix] = cache_get_field_content_int(0, "TotUnix");
  93. Spieler[playerid][pTotX] = cache_get_field_content_float(0, "TotX");
  94. Spieler[playerid][pTotY] = cache_get_field_content_float(0, "TotY");
  95. Spieler[playerid][pTotZ] = cache_get_field_content_float(0, "TotZ");
  96. Spieler[playerid][pTotWorld] = cache_get_field_content_int(0, "TotWorld");
  97. Spieler[playerid][pKills] = cache_get_field_content_int(0, "Kills");
  98. Spieler[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
  99. Spieler[playerid][pJailed] = cache_get_field_content_int(0, "Jailed");
  100. Spieler[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime");
  101. Spieler[playerid][pRank] = cache_get_field_content_int(0, "Rank");
  102. Spieler[playerid][pVerbrechen] = cache_get_field_content_int(0, "Verbrechen");
  103. Spieler[playerid][pJailType] = cache_get_field_content_int(0, "JailType");
  104. Spieler[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
  105. cache_get_field_content(0, "BanReason", Spieler[playerid][pBanReason], myCon, 64);
  106. cache_get_field_content(0, "BanAdmin", Spieler[playerid][pBanAdmin], myCon, MAX_PLAYER_NAME);
  107. cache_get_field_content(0, "MuteReason", Spieler[playerid][pMuteReason], myCon, 32);
  108. Spieler[playerid][pMuted] = cache_get_field_content_int(0, "Muted");
  109. Spieler[playerid][pHouseKey] = cache_get_field_content_int(0, "HouseKey");
  110. Spieler[playerid][pErstehilfe] = cache_get_field_content_int(0, "Erstehilfe");
  111. Spieler[playerid][pNumber] = cache_get_field_content_int(0, "Number");
  112. Spieler[playerid][pBank] = cache_get_field_content_int(0, "Bank");
  113. Spieler[playerid][pHandy] = cache_get_field_content_int(0, "Handy");
  114. Spieler[playerid][pHandyStatus] = cache_get_field_content_int(0, "HandyStatus");
  115. Spieler[playerid][pHandyGuthaben] = cache_get_field_content_int(0, "HandyGuthaben");
  116. Spieler[playerid][pAkku] = cache_get_field_content_float(0, "Akku");
  117. Spieler[playerid][pPlayTime] = cache_get_field_content_int(0, "PlayTime");
  118. Spieler[playerid][pWarns] = cache_get_field_content_int(0, "Warns");
  119. Spieler[playerid][pCrimes] = cache_get_field_content_int(0, "Crimes");
  120. Spieler[playerid][pJailVisits] = cache_get_field_content_int(0, "JailVisits");
  121. Spieler[playerid][pEisen] = cache_get_field_content_int(0, "Eisen");
  122. Spieler[playerid][pEisenSafe] = cache_get_field_content_int(0, "EisenSafe");
  123. Spieler[playerid][pMarihuana] = cache_get_field_content_int(0, "Marihuana");
  124. Spieler[playerid][pMarihuanaSafe] = cache_get_field_content_int(0, "MarihuanaSafe");
  125. Spieler[playerid][pKanister] = cache_get_field_content_int(0, "Kanister");
  126. Spieler[playerid][pPremium] = cache_get_field_content_int(0, "Premium");
  127. Spieler[playerid][pLastLogin] = cache_get_field_content_int(0, "LastLogin");
  128. Spieler[playerid][pPremiumZeit] = cache_get_field_content_int(0, "PremiumZeit");
  129. Spieler[playerid][pSpawnChange] = cache_get_field_content_int(0, "SpawnChange");
  130. Spieler[playerid][pSkillPoints] = cache_get_field_content_int(0, "SkillPoints");
  131. Spieler[playerid][pVerheiratet] = cache_get_field_content_int(0, "Verheiratet");
  132. Spieler[playerid][pFished] = cache_get_field_content_int(0, "Fished");
  133. Spieler[playerid][pFishTime] = cache_get_field_content_int(0, "FishTime");
  134. Spieler[playerid][pFishSperre] = cache_get_field_content_int(0, "FishSperre");
  135. Spieler[playerid][pFishSkill] = cache_get_field_content_int(0, "FishSkill");
  136. Spieler[playerid][pFishSkillEXP] = cache_get_field_content_int(0, "FishSkillEXP");
  137. new loadstring[30];
  138. for(new i=1;i<MAX_FISHING_FISHES;i++)
  139. {
  140. format(loadstring, sizeof(loadstring), "FishID%d", i);
  141. Spieler[playerid][pFishID][i] = cache_get_field_content_int(0, loadstring);
  142. format(loadstring, sizeof(loadstring), "Fishweight%d", i);
  143. Spieler[playerid][pFishweight][i] = cache_get_field_content_int(0, loadstring);
  144. }
  145. for(new i=1;i<MAX_FISHING_FISHES;i++)
  146. {
  147. format(loadstring, sizeof(loadstring), "CookID%d", i);
  148. Spieler[playerid][pCookID][i] = cache_get_field_content_int(0, loadstring);
  149. format(loadstring, sizeof(loadstring), "CookHP%d", i);
  150. Spieler[playerid][pCookHP][i] = cache_get_field_content_int(0, loadstring);
  151. }
  152. if(Spieler[playerid][pSkillDrug] < 1)Spieler[playerid][pSkillDrug] = 1;
  153.  
  154.  
  155.  
  156. cache_get_field_content(0, "VerheiratetName", Spieler[playerid][pVerheiratetName], myCon, MAX_PLAYER_NAME+1);
  157. for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
  158. {
  159. format(query, sizeof(query), "SELECT * FROM `script_vehicles` WHERE `vehBesitzer`='%s' AND `Slot` = '%d'", GetName(playerid), vehSlot);
  160. mysql_function_query(myCon, query, true, "LoadPlayerVehicles", "ii", playerid, vehSlot);
  161. }
  162. if(Spieler[playerid][pBanned] == 1)
  163. {
  164. strdel(DialogString, 0, sizeof(DialogString));
  165. format(DialogString, sizeof(DialogString), "Dieser Account wurde gebannt.\nGebannt von: %s\nBanngrund: %s\n\nWenn der Bann zu Unrecht war, erstelle bitte einen Entbann Antrag im Forum!", Spieler[playerid][pBanAdmin], Spieler[playerid][pBanReason]);
  166. ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "Bann", DialogString, "Schließen", "");
  167. KickEx(playerid);
  168. return 1;
  169. }
  170. SetPlayerScore(playerid, Spieler[playerid][pLevel]);
  171. Spieler[playerid][pLoggedIn] = true;
  172. PlayerPlaySound(playerid, 1188, 0.0, 0.0, 0.0);
  173. SpawnPlayerEx(playerid);
  174. SetMoney(playerid, Spieler[playerid][pMoney]);
  175. if(Spieler[playerid][pNumber] == 0)
  176. {
  177. Spieler[playerid][pNumber] = random(10000) + random(45542);
  178. SendClientMessage(playerid, COLOR_YELLOW, "* Da du noch keine Nummer hast, wird dir nun eine zugewiesen.");
  179. format(query, sizeof(query), COLOR_HEX_YELLOW"* Deine Nummer: "COLOR_HEX_WHITE"%d", Spieler[playerid][pNumber]);
  180. SendClientMessage(playerid, COLOR_YELLOW, query);
  181. }
  182.  
  183. format(query, sizeof(query), "%02d:%02d", stunde, minute);
  184.  
  185. PlayerTextDrawSetString(playerid, pTextHUD[playerid][1], query);
  186. PlayerTextDrawShow(playerid, pTextHUD[playerid][1]);
  187. PlayerTextDrawShow(playerid, pTextHUD[playerid][3]);
  188. PlayerTextDrawShow(playerid, pTextHUD[playerid][6]);
  189. PlayerTextDrawShow(playerid, pTextHUD[playerid][2]);
  190. UpdateWantedTD(playerid);
  191.  
  192. ShowPlayerChangelog(playerid);
  193.  
  194. if(Spieler[playerid][pPremium] == 1)
  195. {
  196. new string[128], xZhours, xZminutes, xZdays;
  197. new zTime = Spieler[playerid][pPremiumZeit];
  198. if(gettime() < zTime)
  199. {
  200. new xTime = (zTime - gettime());
  201. xZdays = xTime / 86400;
  202. xTime -= xZdays * 86400;
  203. xZhours = xTime / 3600;
  204. xTime -= xZhours * 3600;
  205. xZminutes = xTime / 60;
  206. xTime -= xZminutes * 60;
  207. if(xZhours < 1 && xZdays == 0){
  208. format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZminutes);
  209. SendClientMessage(playerid, COLOR_YELLOW, string);
  210. }else if(xZdays < 1 && xZhours > 0){
  211. format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Stunden und %d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZhours, xZminutes);
  212. SendClientMessage(playerid, COLOR_YELLOW, string);
  213. }else if(xZdays > 0){
  214. format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Tage, %d Stunden und %d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZdays, xZhours, xZminutes);
  215. SendClientMessage(playerid, COLOR_YELLOW, string);
  216. }
  217. }
  218. else SendClientMessage(playerid, COLOR_YELLOW, "Dein Premium-Rang ist abgelaufen!");
  219. }
  220. if(Spieler[playerid][pPremium] == 2)
  221. {
  222. SendClientMessage(playerid, COLOR_YELLOW, "Du hast "COLOR_HEX_DARKORANGE"Premium (permanent)"COLOR_HEX_YELLOW".");
  223. }
  224. if(Spieler[playerid][pLastLogin] < (gettime()-86400))
  225. {
  226. if(Spieler[playerid][pLastLogin] > 0)
  227. {
  228. SendClientMessage(playerid, COLOR_YELLOW, "Dir wurde "COLOR_HEX_DARKORANGE"1 Respektpunkt"COLOR_HEX_YELLOW" gutgeschrieben da du mindestens 1 Tag nicht online warst.");
  229. Spieler[playerid][pExp]++;
  230. }
  231. }
  232. SendClientMessage(playerid, COLOR_YELLOW, "");
  233. if(Others[sDoppelRP] == 1)
  234. {
  235. new string[128], xZhours, xZminutes, xZdays;
  236. new zTime = Others[sDoppelRPTime];
  237. new xTime = (zTime - gettime());
  238. xZdays = xTime / 86400;
  239. xTime -= xZdays * 86400;
  240. xZhours = xTime / 3600;
  241. xTime -= xZhours * 3600;
  242. xZminutes = xTime / 60;
  243. xTime -= xZminutes * 60;
  244. if(xZhours < 1 && xZdays == 0){
  245. format(string, sizeof(string), "[Doppel RP Event]"COLOR_HEX_YELLOW" Das Doppel RP Event wurde gestartet (noch %d Minuten).", xZminutes);
  246. SendClientMessage(playerid, COLOR_DARKORANGE, string);
  247. }else if(xZdays < 1 && xZhours > 0){
  248. format(string, sizeof(string), "[Doppel RP Event]"COLOR_HEX_YELLOW" Das Doppel RP Event wurde gestartet (noch %d Stunden und %d Minuten).", xZhours, xZminutes);
  249. SendClientMessage(playerid, COLOR_DARKORANGE, string);
  250. }else if(xZdays > 0){
  251. format(string, sizeof(string), "[Doppel RP Event]"COLOR_HEX_YELLOW" Das Doppel RP Event wurde gestartet (noch %d Tage, %d Stunden und %d Minuten).",xZdays, xZhours, xZminutes);
  252. SendClientMessage(playerid, COLOR_DARKORANGE, string);
  253. }
  254. SendClientMessage(playerid, COLOR_DARKORANGE, "[Doppel RP Event]"COLOR_HEX_YELLOW" Du erhälst am Payday einen zusätzlichen Respekt Punkt.");
  255. }
  256. OnWantedChange(playerid, 0, Spieler[playerid][pWanteds]);
  257. OnContractChange(playerid, 0, Spieler[playerid][pContract]);
  258. return 1;
  259. }
  260. default:
  261. {
  262. SendClientMessage(playerid, COLOR_GREY, "** Es ist ein Fehler aufgetreten, bitte verbinde neu zum Server!");
  263. Kick(playerid);
  264. return 1;
  265. }
  266. }
  267. return 1;
  268. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement