Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LoadPlayerDataSequence(playerid, l_step)
- {
- switch(l_step)
- {
- case 1:
- {
- new count = cache_get_field_content_int(0, "count");
- if(count)
- {
- strdel(DialogString, 0, sizeof(DialogString));
- strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
- format(DialogString, sizeof(DialogString), COLOR_HEX_WHITE"%sDein Name lautet: "COLOR_HEX_BLUE"%s"COLOR_HEX_WHITE".\n", DialogString, GetName(playerid));
- strcat(DialogString, COLOR_HEX_WHITE"Du kannst dich nun mit deinem Passwort anmelden.\n\n");
- strcat(DialogString, COLOR_HEX_YELLOW"INFO: Wenn du dein Passwort vergessen hast, melde dich im Forum bei einem Team-Mitglied!");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, COLOR_HEX_BLUE""SERVER_NAME": Anmeldung", DialogString, "Anmelden", "Abbrechen");
- return 1;
- }
- else
- {
- strdel(DialogString, 0, sizeof(DialogString));
- strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
- strcat(DialogString, COLOR_HEX_WHITE"Da du neu auf unserem Server bist, solltest du dir zuerst einen Account anlegen.\n");
- strcat(DialogString, COLOR_HEX_WHITE"Gebe dazu in dem unteren Feld dein gewünschtes Passwort ein.\n");
- strcat(DialogString, COLOR_HEX_YELLOW"\nINFO: Wähle ein Passwort was du nicht überall bbenutzt, besonders auf anderen Servern.\n");
- strcat(DialogString, COLOR_HEX_YELLOW"Nutze am besten Sonderzeichen, Zahlen sowie Große und Kleine Buchstaben.");
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, COLOR_HEX_BLUE""SERVER_NAME": Registration", DialogString, "Registrieren", "Abbrechen");
- return 1;
- }
- }
- case 2:
- {
- new count = cache_get_field_content_int(0, "count");
- if(count)
- {
- new query[64+MAX_PLAYER_NAME+1];
- mysql_format(myCon, query, sizeof(query), "SELECT * FROM `script_accounts` WHERE `Name` = '%s'", GetName(playerid));
- mysql_function_query(myCon, query, true, "LoadPlayerDataSequence", "dd", playerid, 3);
- }
- else
- {
- strdel(DialogString, 0, sizeof(DialogString));
- strcat(DialogString, COLOR_HEX_WHITE"Herzlich Willkommen auf "COLOR_HEX_BLUE""SERVER_NAME"."COLOR_HEX_WHITE"\n");
- format(DialogString, sizeof(DialogString), COLOR_HEX_WHITE"%sDein Name lautet: "COLOR_HEX_BLUE"%s"COLOR_HEX_WHITE".\n", DialogString, GetName(playerid));
- strcat(DialogString, COLOR_HEX_WHITE"Du kannst dich nun mit deinem Passwort anmelden.\n\n");
- strcat(DialogString, COLOR_HEX_YELLOW"INFO: Wenn du dein Passwort vergessen hast, melde dich im Forum bei einem Team-Mitglied!");
- strcat(DialogString, COLOR_HEX_SERVER"\n\nFEHLER: Du hast ein falsches Passwort angegeben.");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, COLOR_HEX_BLUE""SERVER_NAME": Anmeldung", DialogString, "Anmelden", "Abbrechen");
- return 1;
- }
- }
- case 3:
- {
- new query[128];
- Spieler[playerid][pLevel] = cache_get_field_content_int(0, "Level");
- Spieler[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
- Spieler[playerid][pSpawnHealth] = cache_get_field_content_float(0, "SpawnHealth");
- Spieler[playerid][pOrgMember] = cache_get_field_content_int(0, "OrgMember");
- Spieler[playerid][pSkillDrug] = cache_get_field_content_float(0, "SkillDrug");
- Spieler[playerid][pPayDay] = cache_get_field_content_int(0, "PayDay");
- Spieler[playerid][pExp] = cache_get_field_content_int(0, "Exp");
- Spieler[playerid][pFraktion] = cache_get_field_content_int(0, "Fraktion");
- Spieler[playerid][pTutorial] = cache_get_field_content_int(0, "Tutorial");
- Spieler[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
- Spieler[playerid][pFrakSkin] = cache_get_field_content_int(0, "FrakSkin");
- Spieler[playerid][pGeschlecht] = cache_get_field_content_int(0, "Geschlecht");
- Spieler[playerid][pHitsound] = cache_get_field_content_int(0, "Hitsound");
- Spieler[playerid][pMessages] = cache_get_field_content_int(0, "Messages");
- Spieler[playerid][pPerso] = cache_get_field_content_int(0, "Perso");
- Spieler[playerid][pCarLicense] = cache_get_field_content_int(0, "CarLicense");
- Spieler[playerid][pContract] = cache_get_field_content_int(0, "Contract");
- Spieler[playerid][pContractCount] = cache_get_field_content_int(0, "ContractCount");
- Spieler[playerid][pCarLicensePoints] = cache_get_field_content_int(0, "CarLicensePoints");
- Spieler[playerid][pFlyLicense] = cache_get_field_content_int(0, "FlyLicense");
- Spieler[playerid][pBoatLicense] = cache_get_field_content_int(0, "BoatLicense");
- Spieler[playerid][pFishLicense] = cache_get_field_content_int(0, "FishLicense");
- Spieler[playerid][pGunLicense] = cache_get_field_content_int(0, "GunLicense");
- Spieler[playerid][pZollpass] = cache_get_field_content_int(0, "Zollpass");
- Spieler[playerid][pJob] = cache_get_field_content_int(0, "Job");
- Spieler[playerid][pWanteds] = cache_get_field_content_int(0, "Wanteds");
- Spieler[playerid][pMoney] = cache_get_field_content_int(0, "Money");
- Spieler[playerid][pIsEhrenhaft] = cache_get_field_content_int(0, "IsEhrenhaft");
- Spieler[playerid][pQuitJob] = cache_get_field_content_int(0, "QuitJob");
- Spieler[playerid][pJobMoney] = cache_get_field_content_int(0, "JobMoney");
- Spieler[playerid][pJobCount] = cache_get_field_content_int(0, "JobCount");
- Spieler[playerid][pBusSkill] = cache_get_field_content_int(0, "BusSkill");
- Spieler[playerid][pTruckSkill] = cache_get_field_content_int(0, "TruckSkill");
- Spieler[playerid][pTruckSkillEXP] = cache_get_field_content_int(0, "TruckSkillEXP");
- Spieler[playerid][pBusSkillEXP] = cache_get_field_content_int(0, "BusSkillEXP");
- Spieler[playerid][pDetektivSkill] = cache_get_field_content_int(0, "DetektivSkill");
- Spieler[playerid][pDetektivSkillEXP] = cache_get_field_content_int(0, "DetektivSkillEXP");
- Spieler[playerid][pTot] = cache_get_field_content_int(0, "Tot");
- Spieler[playerid][pTotUnix] = cache_get_field_content_int(0, "TotUnix");
- Spieler[playerid][pTotX] = cache_get_field_content_float(0, "TotX");
- Spieler[playerid][pTotY] = cache_get_field_content_float(0, "TotY");
- Spieler[playerid][pTotZ] = cache_get_field_content_float(0, "TotZ");
- Spieler[playerid][pTotWorld] = cache_get_field_content_int(0, "TotWorld");
- Spieler[playerid][pKills] = cache_get_field_content_int(0, "Kills");
- Spieler[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
- Spieler[playerid][pJailed] = cache_get_field_content_int(0, "Jailed");
- Spieler[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime");
- Spieler[playerid][pRank] = cache_get_field_content_int(0, "Rank");
- Spieler[playerid][pVerbrechen] = cache_get_field_content_int(0, "Verbrechen");
- Spieler[playerid][pJailType] = cache_get_field_content_int(0, "JailType");
- Spieler[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
- cache_get_field_content(0, "BanReason", Spieler[playerid][pBanReason], myCon, 64);
- cache_get_field_content(0, "BanAdmin", Spieler[playerid][pBanAdmin], myCon, MAX_PLAYER_NAME);
- cache_get_field_content(0, "MuteReason", Spieler[playerid][pMuteReason], myCon, 32);
- Spieler[playerid][pMuted] = cache_get_field_content_int(0, "Muted");
- Spieler[playerid][pHouseKey] = cache_get_field_content_int(0, "HouseKey");
- Spieler[playerid][pErstehilfe] = cache_get_field_content_int(0, "Erstehilfe");
- Spieler[playerid][pNumber] = cache_get_field_content_int(0, "Number");
- Spieler[playerid][pBank] = cache_get_field_content_int(0, "Bank");
- Spieler[playerid][pHandy] = cache_get_field_content_int(0, "Handy");
- Spieler[playerid][pHandyStatus] = cache_get_field_content_int(0, "HandyStatus");
- Spieler[playerid][pHandyGuthaben] = cache_get_field_content_int(0, "HandyGuthaben");
- Spieler[playerid][pAkku] = cache_get_field_content_float(0, "Akku");
- Spieler[playerid][pPlayTime] = cache_get_field_content_int(0, "PlayTime");
- Spieler[playerid][pWarns] = cache_get_field_content_int(0, "Warns");
- Spieler[playerid][pCrimes] = cache_get_field_content_int(0, "Crimes");
- Spieler[playerid][pJailVisits] = cache_get_field_content_int(0, "JailVisits");
- Spieler[playerid][pEisen] = cache_get_field_content_int(0, "Eisen");
- Spieler[playerid][pEisenSafe] = cache_get_field_content_int(0, "EisenSafe");
- Spieler[playerid][pMarihuana] = cache_get_field_content_int(0, "Marihuana");
- Spieler[playerid][pMarihuanaSafe] = cache_get_field_content_int(0, "MarihuanaSafe");
- Spieler[playerid][pKanister] = cache_get_field_content_int(0, "Kanister");
- Spieler[playerid][pPremium] = cache_get_field_content_int(0, "Premium");
- Spieler[playerid][pLastLogin] = cache_get_field_content_int(0, "LastLogin");
- Spieler[playerid][pPremiumZeit] = cache_get_field_content_int(0, "PremiumZeit");
- Spieler[playerid][pSpawnChange] = cache_get_field_content_int(0, "SpawnChange");
- Spieler[playerid][pSkillPoints] = cache_get_field_content_int(0, "SkillPoints");
- Spieler[playerid][pVerheiratet] = cache_get_field_content_int(0, "Verheiratet");
- Spieler[playerid][pFished] = cache_get_field_content_int(0, "Fished");
- Spieler[playerid][pFishTime] = cache_get_field_content_int(0, "FishTime");
- Spieler[playerid][pFishSperre] = cache_get_field_content_int(0, "FishSperre");
- Spieler[playerid][pFishSkill] = cache_get_field_content_int(0, "FishSkill");
- Spieler[playerid][pFishSkillEXP] = cache_get_field_content_int(0, "FishSkillEXP");
- new loadstring[30];
- for(new i=1;i<MAX_FISHING_FISHES;i++)
- {
- format(loadstring, sizeof(loadstring), "FishID%d", i);
- Spieler[playerid][pFishID][i] = cache_get_field_content_int(0, loadstring);
- format(loadstring, sizeof(loadstring), "Fishweight%d", i);
- Spieler[playerid][pFishweight][i] = cache_get_field_content_int(0, loadstring);
- }
- for(new i=1;i<MAX_FISHING_FISHES;i++)
- {
- format(loadstring, sizeof(loadstring), "CookID%d", i);
- Spieler[playerid][pCookID][i] = cache_get_field_content_int(0, loadstring);
- format(loadstring, sizeof(loadstring), "CookHP%d", i);
- Spieler[playerid][pCookHP][i] = cache_get_field_content_int(0, loadstring);
- }
- if(Spieler[playerid][pSkillDrug] < 1)Spieler[playerid][pSkillDrug] = 1;
- cache_get_field_content(0, "VerheiratetName", Spieler[playerid][pVerheiratetName], myCon, MAX_PLAYER_NAME+1);
- for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
- {
- format(query, sizeof(query), "SELECT * FROM `script_vehicles` WHERE `vehBesitzer`='%s' AND `Slot` = '%d'", GetName(playerid), vehSlot);
- mysql_function_query(myCon, query, true, "LoadPlayerVehicles", "ii", playerid, vehSlot);
- }
- if(Spieler[playerid][pBanned] == 1)
- {
- strdel(DialogString, 0, sizeof(DialogString));
- 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]);
- ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "Bann", DialogString, "Schließen", "");
- KickEx(playerid);
- return 1;
- }
- SetPlayerScore(playerid, Spieler[playerid][pLevel]);
- Spieler[playerid][pLoggedIn] = true;
- PlayerPlaySound(playerid, 1188, 0.0, 0.0, 0.0);
- SpawnPlayerEx(playerid);
- SetMoney(playerid, Spieler[playerid][pMoney]);
- if(Spieler[playerid][pNumber] == 0)
- {
- Spieler[playerid][pNumber] = random(10000) + random(45542);
- SendClientMessage(playerid, COLOR_YELLOW, "* Da du noch keine Nummer hast, wird dir nun eine zugewiesen.");
- format(query, sizeof(query), COLOR_HEX_YELLOW"* Deine Nummer: "COLOR_HEX_WHITE"%d", Spieler[playerid][pNumber]);
- SendClientMessage(playerid, COLOR_YELLOW, query);
- }
- format(query, sizeof(query), "%02d:%02d", stunde, minute);
- PlayerTextDrawSetString(playerid, pTextHUD[playerid][1], query);
- PlayerTextDrawShow(playerid, pTextHUD[playerid][1]);
- PlayerTextDrawShow(playerid, pTextHUD[playerid][3]);
- PlayerTextDrawShow(playerid, pTextHUD[playerid][6]);
- PlayerTextDrawShow(playerid, pTextHUD[playerid][2]);
- UpdateWantedTD(playerid);
- ShowPlayerChangelog(playerid);
- if(Spieler[playerid][pPremium] == 1)
- {
- new string[128], xZhours, xZminutes, xZdays;
- new zTime = Spieler[playerid][pPremiumZeit];
- if(gettime() < zTime)
- {
- new xTime = (zTime - gettime());
- xZdays = xTime / 86400;
- xTime -= xZdays * 86400;
- xZhours = xTime / 3600;
- xTime -= xZhours * 3600;
- xZminutes = xTime / 60;
- xTime -= xZminutes * 60;
- if(xZhours < 1 && xZdays == 0){
- format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZminutes);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }else if(xZdays < 1 && xZhours > 0){
- format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Stunden und %d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZhours, xZminutes);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }else if(xZdays > 0){
- format(string, sizeof(string), "Du hast "COLOR_HEX_DARKORANGE"Premium (%d Tage, %d Stunden und %d Minuten verbleibend)"COLOR_HEX_YELLOW".", xZdays, xZhours, xZminutes);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- }
- else SendClientMessage(playerid, COLOR_YELLOW, "Dein Premium-Rang ist abgelaufen!");
- }
- if(Spieler[playerid][pPremium] == 2)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Du hast "COLOR_HEX_DARKORANGE"Premium (permanent)"COLOR_HEX_YELLOW".");
- }
- if(Spieler[playerid][pLastLogin] < (gettime()-86400))
- {
- if(Spieler[playerid][pLastLogin] > 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Dir wurde "COLOR_HEX_DARKORANGE"1 Respektpunkt"COLOR_HEX_YELLOW" gutgeschrieben da du mindestens 1 Tag nicht online warst.");
- Spieler[playerid][pExp]++;
- }
- }
- SendClientMessage(playerid, COLOR_YELLOW, "");
- if(Others[sDoppelRP] == 1)
- {
- new string[128], xZhours, xZminutes, xZdays;
- new zTime = Others[sDoppelRPTime];
- new xTime = (zTime - gettime());
- xZdays = xTime / 86400;
- xTime -= xZdays * 86400;
- xZhours = xTime / 3600;
- xTime -= xZhours * 3600;
- xZminutes = xTime / 60;
- xTime -= xZminutes * 60;
- if(xZhours < 1 && xZdays == 0){
- format(string, sizeof(string), "[Doppel RP Event]"COLOR_HEX_YELLOW" Das Doppel RP Event wurde gestartet (noch %d Minuten).", xZminutes);
- SendClientMessage(playerid, COLOR_DARKORANGE, string);
- }else if(xZdays < 1 && xZhours > 0){
- format(string, sizeof(string), "[Doppel RP Event]"COLOR_HEX_YELLOW" Das Doppel RP Event wurde gestartet (noch %d Stunden und %d Minuten).", xZhours, xZminutes);
- SendClientMessage(playerid, COLOR_DARKORANGE, string);
- }else if(xZdays > 0){
- 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);
- SendClientMessage(playerid, COLOR_DARKORANGE, string);
- }
- SendClientMessage(playerid, COLOR_DARKORANGE, "[Doppel RP Event]"COLOR_HEX_YELLOW" Du erhälst am Payday einen zusätzlichen Respekt Punkt.");
- }
- OnWantedChange(playerid, 0, Spieler[playerid][pWanteds]);
- OnContractChange(playerid, 0, Spieler[playerid][pContract]);
- return 1;
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, "** Es ist ein Fehler aufgetreten, bitte verbinde neu zum Server!");
- Kick(playerid);
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement