pawn Code:
stock OnPlayerSave(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SaveAccount1(playerid);
SaveAccount2(playerid);
SaveAccount3(playerid);
SaveAccount4(playerid);
}
}
//return 1;
}
stock SaveAccount1(playerid)
{
new escname[MAX_PLAYER_NAME];
new Pname[MAX_PLAYER_NAME];
new string[800];
new Query[800];
GetPlayerName(playerid, Pname, sizeof(Pname));
mysql_real_escape_string(Pname, escname);
new Banned = PlayerInfo[playerid][pBanned];
new Level = PlayerInfo[playerid][pLevel];
new Admin = PlayerInfo[playerid][pAdmin];
new Helper = PlayerInfo[playerid][pHelper];
new DonateRank = PlayerInfo[playerid][pDonateRank];
new Upgrade = PlayerInfo[playerid][gPupgrade];
new ConnectTime = PlayerInfo[playerid][pConnectTime];
new Reg = PlayerInfo[playerid][pReg];
new Sex = PlayerInfo[playerid][pSex];
new Age = PlayerInfo[playerid][pAge];
new Origin = PlayerInfo[playerid][pOrigin];
new Mute = PlayerInfo[playerid][pMuted];
new MuteTime = PlayerInfo[playerid][pMuteTime];
new Exp = PlayerInfo[playerid][pExp];
new Money = PlayerInfo[playerid][pCash];
new Bank = PlayerInfo[playerid][pBank];
new Crimes = PlayerInfo[playerid][pCrimes];
new Kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new Arrested = PlayerInfo[playerid][pArrested];
strcat(string,"UPDATE `accounts` SET `Banned` = '%d' , `Level` = '%d' , `AdminLevel` = '%d' , `Helper` = '%d' , `DonateRank` = '%d' , `UpgradePoints` = '%d' , `ConnectedTime` = '%d' , `Registered` = '%d', `Sex` = '%d'",sizeof(string));
strcat(string,", `Age` = '%d' , `Origin` = '%d' , `Muted` = '%d' , `MuteTime` = '%d' , `Respect` = '%d' , `Money` = '%d' , `Bank` = '%d' , `Crimes` = '%d' , `Kills` = '%d' , `Deaths` = '%d',`Arrested` = '%d' WHERE `Nickname` = '%s'",sizeof(string));
format(Query, sizeof(Query),string,Banned,Level,Admin,Helper,DonateRank,Upgrade,ConnectTime,Reg,Sex,Age,Origin,Mute,MuteTime,Exp,Money,Bank,Crimes,Kills,Deaths,Arrested,escname);
mysql_query(Query); // 1 запрос
mysql_free_result();
}
stock SaveAccount2(playerid)
{
new escname[MAX_PLAYER_NAME];
new Pname[MAX_PLAYER_NAME];
new string[1024];
new Query[1024];
GetPlayerName(playerid, Pname, sizeof(Pname));
mysql_real_escape_string(Pname, escname);
new WantedDeaths = PlayerInfo[playerid][pWantedDeaths];
new PhoneBook = PlayerInfo[playerid][pPhoneBook];
new LottoNr = PlayerInfo[playerid][pLottoNr];
new sFishes = PlayerInfo[playerid][pFishes];
new BiggestFish = PlayerInfo[playerid][pBiggestFish];
new Job = PlayerInfo[playerid][pJob];
new PayCheck = PlayerInfo[playerid][pPayCheck];
new HeadValue = PlayerInfo[playerid][pHeadValue];
new Jailed = PlayerInfo[playerid][pJailed];
new JailTime = PlayerInfo[playerid][pJailTime];
new Mats = PlayerInfo[playerid][pMats];
new Drugs = PlayerInfo[playerid][pDrugs];
new Leader = PlayerInfo[playerid][pLeader];
new Member = PlayerInfo[playerid][pMember];
new Rank = PlayerInfo[playerid][pRank];
new MedicTime = PlayerInfo[playerid][pMedicTime];
new NeedTime = PlayerInfo[playerid][pNeedTime];
new ContractTime = PlayerInfo[playerid][pContractTime];
new DetSkill = PlayerInfo[playerid][pDetSkill];
new SexSkill = PlayerInfo[playerid][pSexSkill];
new BoxSkill = PlayerInfo[playerid][pBoxSkill];
new LawSkill = PlayerInfo[playerid][pLawSkill];
new MechSkill = PlayerInfo[playerid][pMechSkill];
new JackSkill = PlayerInfo[playerid][pJackSkill];
new CarSkill = PlayerInfo[playerid][pCarSkill];
new NewsSkill = PlayerInfo[playerid][pNewsSkill];
strcat(string,"UPDATE `accounts` SET `WantedDeaths` = '%d' , `Phonebook` = '%d' , `LottoNr` = '%d' , `Fishes` = '%d' , `BiggestFish` = '%d' , `Job` = '%d' , `Paycheck` = '%d' , `HeadValue` = '%d' ",sizeof(string));
strcat(string,", `Jailed` = '%d' , `JailTime` = '%d' , `Materials` = '%d' , `Drugs` = '%d' , `Leader` = '%d' , `Member` = '%d' , `Rank` = '%d' , `MedicTime` = '%d' , `NeedTime` = '%d' ,`ContractTime` = '%d' ",sizeof(string));
strcat(string,", `DetSkill` = '%d' , `SexSkill` = '%d' , `BoxSkill` = '%d' , `LawSkill` = '%d' , `MechSkill` = '%d' , `JackSkill` = '%d' , `CarSkill` = '%d' , `NewsSkill` = '%d' WHERE `Nickname` = '%s'",sizeof(string));
format(Query, sizeof(Query),string, WantedDeaths,PhoneBook,LottoNr,sFishes,BiggestFish,Job,PayCheck,HeadValue,Jailed,JailTime,Mats,Drugs,Leader,Member,Rank,MedicTime,NeedTime,ContractTime,DetSkill,SexSkill,BoxSkill,LawSkill,MechSkill,JackSkill,CarSkill,NewsSkill,escname);
mysql_query(Query); // 2запрос
mysql_free_result();
}
stock SaveAccount3(playerid)
{
new escname[MAX_PLAYER_NAME];
new Pname[MAX_PLAYER_NAME];
new string[1024];
new Query[1024];
GetPlayerName(playerid, Pname, sizeof(Pname));
mysql_real_escape_string(Pname, escname);
new DrugsSkill = PlayerInfo[playerid][pDrugsSkill];
new CookSkill = PlayerInfo[playerid][pCookSkill];
new FishSkill = PlayerInfo[playerid][pFishSkill];
new Float:SHealth = PlayerInfo[playerid][pSHealth];
new Int = PlayerInfo[playerid][pInt];
new Local = PlayerInfo[playerid][pLocal];
new Model = PlayerInfo[playerid][pModel];
new Pnumber = PlayerInfo[playerid][pPnumber];
new TA = PlayerInfo[playerid][pTA];
new Flat = PlayerInfo[playerid][pFlatKey];
new Phousekey = PlayerInfo[playerid][pPhousekey];
new Rent = PlayerInfo[playerid][pRent];
new Pbiskey = PlayerInfo[playerid][pPbiskey];
new Float:Pos_x = PlayerInfo[playerid][pPos_x];
new Float:Pos_y = PlayerInfo[playerid][pPos_y];
new Float:Pos_z = PlayerInfo[playerid][pPos_z];
new CarLicA = PlayerInfo[playerid][pCarLicA];
new CarLicB = PlayerInfo[playerid][pCarLicB];
new CarLicC = PlayerInfo[playerid][pCarLicC];
new FlyLic = PlayerInfo[playerid][pFlyLic];
new BoatLic = PlayerInfo[playerid][pBoatLic];
new FishLic = PlayerInfo[playerid][pFishLic];
new GunLic = PlayerInfo[playerid][pGunLic];
new CarTime = PlayerInfo[playerid][pCarTime];
strcat(string,"UPDATE `accounts` SET `DrugsSkill` = '%d' , `CookSkill` = '%d' , `FishSkill` = '%d' , `pSHealth` = '%f', `Int` = '%d' , `Local` = '%d' ",sizeof(string));
strcat(string,", `Model` = '%d' , `PhoneNr` = '%d' , `TA` = '%d' , `Flat` = '%d' , `House` = '%d' , `Rent` = '%d' , `Bizz` = '%d' , `Pos_x` = '%f', `Pos_y` = '%f', `Pos_z` = '%f', `CarLicA` = '%d' , `CarLicB` = '%d' , `CarLicC` = '%d' , `FlyLic` = '%d' ",sizeof(string));
strcat(string,", `BoatLic` = '%d' , `FishLic` = '%d' , `GunLic` = '%d' , `CarTime` = '%d' WHERE `Nickname` = '%s'",sizeof(string));
format(Query, sizeof(Query),string, DrugsSkill,CookSkill, FishSkill,SHealth,Int,Local,Model,Pnumber,TA,Flat,Phousekey,Rent,Pbiskey,Pos_x,Pos_y,Pos_z,CarLicA,CarLicB,CarLicC,FlyLic,BoatLic,FishLic,GunLic,CarTime,escname);
mysql_query(Query); // 3запрос
mysql_free_result();
}
stock SaveAccount4(playerid)
{
new escname[MAX_PLAYER_NAME];
new Pname[MAX_PLAYER_NAME];
new string[1024];
new Query[1024];
GetPlayerName(playerid, Pname, sizeof(Pname));
mysql_real_escape_string(Pname, escname);
new sPayDay = PlayerInfo[playerid][pPayDay];
new PayDayHad = PlayerInfo[playerid][pPayDayHad];
new CDPlayer = PlayerInfo[playerid][pCDPlayer];
new Wins = PlayerInfo[playerid][pWins];
new Loses = PlayerInfo[playerid][pLoses];
new AlcoholPerk = PlayerInfo[playerid][pAlcoholPerk];
new DrugPerk = PlayerInfo[playerid][pDrugPerk];
new MiserPerk = PlayerInfo[playerid][pMiserPerk];
new PainPerk = PlayerInfo[playerid][pPainPerk];
new TraderPerk = PlayerInfo[playerid][pTraderPerk];
new Tut = PlayerInfo[playerid][pTut];
new Warns = PlayerInfo[playerid][pWarns];
new Fwarnings = PlayerInfo[playerid][pFWarns];
new Fuel = PlayerInfo[playerid][pFuel];
new Married = PlayerInfo[playerid][pMarried];
new Wanted = PlayerInfo[playerid][pWanted];
new gClock = PlayerInfo[playerid][pClock];
new CarKey = PlayerInfo[playerid][pPcarkey];
new CarKey2 = PlayerInfo[playerid][pPcarkey2];
new CarKey3 = PlayerInfo[playerid][pPcarkey3];
new Chips = PlayerInfo[playerid][pChips];
new Pivo = PlayerInfo[playerid][pPivo];
new Cigarettes = PlayerInfo[playerid][pCigarettes];
new Style = PlayerInfo[playerid][pStyle];
new Pasport = PlayerInfo[playerid][pPasport];
new SD = PlayerInfo[playerid][pSD];
new Lighter = PlayerInfo[playerid][pLighter];
new BanTime = PlayerInfo[playerid][pBanTime];
new BanData = PlayerInfo[playerid][pBanData];
new DrugsBuy = PlayerInfo[playerid][pDrugsBuy];
new Zakon = PlayerInfo[playerid][pZakon];
new gPlayerCuffed = PlayerInfo[playerid][pPlayerCuffed];
new Ochki = PlayerInfo[playerid][pOchki];
new Email[128];
new strmarried[24];
mysql_real_escape_string(PlayerInfo[playerid][pEmail], Email);
mysql_real_escape_string(PlayerInfo[playerid][pMarriedTo], strmarried);
strcat(string,"UPDATE `accounts` SET `PayDay` = '%d' , `PayDayHad` = '%d' , `CDPlayer` = '%d' , `Wins` = '%d' ",sizeof(string));
strcat(string,", `Loses` = '%d' , `AlcoholPerk` = '%d' , `DrugPerk` = '%d' , `MiserPerk` = '%d' , `PainPerk` = '%d' , `TraderPerk` = '%d' , `Tutorial` = '%d' , `Warnings` = '%d' ",sizeof(string));
strcat(string,", `FWarnings` = '%d' , `Fuel` = '%d' , `Married` = '%d' , `MarriedTo` = '%s', `Wanted` = '%d' , `Pasport` = '%d' , `Clock` = '%d' , `Car` = '%d' , `Car2` = '%d' ",sizeof(string));
strcat(string,", `Car3` = '%d' , `Chips` = '%d' , `Pivo` = '%d' , `Style` = '%d' , `SD` = '%d' , `Lighter` = '%d' , `Cigarettes` = '%d' , `BanTime` = '%d' , `BanData` = '%d' , `DrugsBuy` = '%d' , `Zakon` = '%d' , `Email` = '%s', `PlayerCuffed` = '%d' , `Ochki` = '%d' WHERE `Nickname` = '%s'",sizeof(string));
format(Query, sizeof(Query),string, sPayDay,PayDayHad,CDPlayer,Wins, Loses,AlcoholPerk,DrugPerk,MiserPerk,PainPerk,TraderPerk,Tut,Warns,Fwarnings,Fuel,Married,strmarried, Wanted,Pasport,gClock,CarKey,CarKey2,CarKey3,Chips,Pivo,Style,SD,Lighter,Cigarettes,BanTime,BanData,DrugsBuy,Zakon,Email,gPlayerCuffed,Ochki,escname);
mysql_query(Query); // 4запрос
mysql_free_result();
}