18.02.2017, 04:42
Ja tentei de tudo quanto й maneira, verifiquei se tinha algum erro no OnPlayerSave, e nгo achei, algume me ajuda por favor, toda vez q reinicio o server perde os lideres, adm fica, dinheiro fica, so sai o lider.
Codigo do OnPlayerSave
[center][spoiler]forward OnPlayerSave22(playerid);
public OnPlayerSave22(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Contas/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "HelperLevel=%d\n",PlayerInfo[playerid][pHelper]);fwrite(hFile, var);
format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pVIP]);fwrite(hFile, var);
format(var, 32, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
format(var, 32, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
format(var, 32, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pConta]);fwrite(hFile, var);
format(var, 32, "Crimes=%d\n",PlayerInfo[playerid][pCrimes]);fwrite(hFile, var);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 32, "Phonebook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
format(var, 32, "Emprego=%d\n",PlayerInfo[playerid][pEmprego]);fwrite(hFile, var);
format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pSalario]);fwrite(hFile, var);
format(var, 32, "HeadValue=%d\n",PlayerInfo[playerid][pHeadValue]);fwrite(hFile, var);
format(var, 32, "HeadValueT=%d\n",PlayerInfo[playerid][pHeadValueT]);fwrite(hFile, var);
format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
format(var, 32, "Materiais=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
format(var, 32, "Maconha=%d\n",PlayerInfo[playerid][pDrogas]);fwrite(hFile, var);
format(var, 32, "Cocaina=%d\n",PlayerInfo[playerid][pDrogas2]);fwrite(hFile, var);
format(var, 32, "Crack=%d\n",PlayerInfo[playerid][pDrogas3]);fwrite(hFile, var);
format(var, 32, "Lider=%d\n",PlayerInfo[playerid][pLider]);fwrite(hFile, var);
format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMembro]);fwrite(hFile, var);
format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pCargo]);fwrite(hFile, var);
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
format(var, 32, "origin=%d\n",PlayerInfo[playerid][pOrigem]);fwrite(hFile, var);
format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
format(var, 32, "DrogasSkill=%d\n",PlayerInfo[playerid][pDrogasSkill]);fwrite(hFile, var);
format(var, 32, "CookSkill=%d\n",PlayerInfo[playerid][pCookSkill]);fwrite(hFile, var);
format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
format(var, 32, "House=%d\n",PlayerInfo[playerid][pPHousekey]);fwrite(hFile, var);
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "Spawn=%d\n",PlayerInfo[playerid][pSpawn]);fwrite(hFile, var);
format(var, 32, "SafeMaconha=%d\n",PlayerInfo[playerid][pSafeDrogas]);fwrite(hFile, var);
format(var, 32, "SafeCocaina=%d\n",PlayerInfo[playerid][pSafeDrogas2]);fwrite(hFile, var);
format(var, 32, "SafeCrack=%d\n",PlayerInfo[playerid][pSafeDrogas3]);fwrite(hFile, var);
format(var, 32, "NivelProcurado=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
format(var, 32, "SafeMateriais=%d\n",PlayerInfo[playerid][psMats]);fwrite(hFile, var);
format(var, 32, "TestVip=%d\n",PlayerInfo[playerid][pTimeVIP]);fwrite(hFile, var);
format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
format(var, 32, "Ouros=%d\n",PlayerInfo[playerid][pOuros]);fwrite(hFile, var);
format(var, 32, "Avisado=%d\n",PlayerInfo[playerid][pAviso]);fwrite(hFile, var);
format(var, 32, "Fome=%d\n",PlayerInfo[playerid][pFome]);fwrite(hFile, var);
format(var, 32, "PegouVIP=%d\n",PlayerInfo[playerid][pPVIP]);fwrite(hFile, var);
format(var, 32, "DiasBanTemp=%d\n",PlayerInfo[playerid][pDiaBanTemp]);fwrite(hFile, var);
format(var, 32, "MesBanTemp=%d\n",PlayerInfo[playerid][pMesBanTemp]);fwrite(hFile, var);
format(var, 32, "AnoBanTemp=%d\n",PlayerInfo[playerid][pAnoBanTemp]);fwrite(hFile, var);
format(var, 32, "DiasVIP=%d\n",PlayerInfo[playerid][pDiaVIP]);fwrite(hFile, var);
format(var, 32, "MesVIP=%d\n",PlayerInfo[playerid][pMesVIP]);fwrite(hFile, var);
format(var, 32, "AnoVIP=%d\n",PlayerInfo[playerid][pAnoVIP]);fwrite(hFile, var);
format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);
format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
format(var, 32, "Avisos=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
format(var, 32, "Luta=%d\n",PlayerInfo[playerid][pLuta]);fwrite(hFile, var);
format(var, 32, "Dorgado=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Dorgado2=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Doenca=%d\n",PlayerInfo[playerid][pDoenca]);fwrite(hFile, var);
format(var, 32, "LU=%s\n",PlayerInfo[playerid][pLastLogin]);fwrite(hFile, var);
format(var, 32, "Ban=%d\n",PlayerInfo[playerid][pBan]);fwrite(hFile, var);
format(var, 32, "TempoHospital=%d\n",PlayerInfo[playerid][pTempoHospitalizado]);fwrite(hFile, var);
format(var, 32, "HospitalID=%d\n",PlayerInfo[playerid][pHospitalID]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return true;[/spoiler][center]
Codigo do OnPlayerSave
[center][spoiler]forward OnPlayerSave22(playerid);
public OnPlayerSave22(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Contas/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "HelperLevel=%d\n",PlayerInfo[playerid][pHelper]);fwrite(hFile, var);
format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pVIP]);fwrite(hFile, var);
format(var, 32, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
format(var, 32, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
format(var, 32, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pConta]);fwrite(hFile, var);
format(var, 32, "Crimes=%d\n",PlayerInfo[playerid][pCrimes]);fwrite(hFile, var);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 32, "Phonebook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
format(var, 32, "Emprego=%d\n",PlayerInfo[playerid][pEmprego]);fwrite(hFile, var);
format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pSalario]);fwrite(hFile, var);
format(var, 32, "HeadValue=%d\n",PlayerInfo[playerid][pHeadValue]);fwrite(hFile, var);
format(var, 32, "HeadValueT=%d\n",PlayerInfo[playerid][pHeadValueT]);fwrite(hFile, var);
format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
format(var, 32, "Materiais=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
format(var, 32, "Maconha=%d\n",PlayerInfo[playerid][pDrogas]);fwrite(hFile, var);
format(var, 32, "Cocaina=%d\n",PlayerInfo[playerid][pDrogas2]);fwrite(hFile, var);
format(var, 32, "Crack=%d\n",PlayerInfo[playerid][pDrogas3]);fwrite(hFile, var);
format(var, 32, "Lider=%d\n",PlayerInfo[playerid][pLider]);fwrite(hFile, var);
format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMembro]);fwrite(hFile, var);
format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pCargo]);fwrite(hFile, var);
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
format(var, 32, "origin=%d\n",PlayerInfo[playerid][pOrigem]);fwrite(hFile, var);
format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
format(var, 32, "DrogasSkill=%d\n",PlayerInfo[playerid][pDrogasSkill]);fwrite(hFile, var);
format(var, 32, "CookSkill=%d\n",PlayerInfo[playerid][pCookSkill]);fwrite(hFile, var);
format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
format(var, 32, "House=%d\n",PlayerInfo[playerid][pPHousekey]);fwrite(hFile, var);
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "Spawn=%d\n",PlayerInfo[playerid][pSpawn]);fwrite(hFile, var);
format(var, 32, "SafeMaconha=%d\n",PlayerInfo[playerid][pSafeDrogas]);fwrite(hFile, var);
format(var, 32, "SafeCocaina=%d\n",PlayerInfo[playerid][pSafeDrogas2]);fwrite(hFile, var);
format(var, 32, "SafeCrack=%d\n",PlayerInfo[playerid][pSafeDrogas3]);fwrite(hFile, var);
format(var, 32, "NivelProcurado=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
format(var, 32, "SafeMateriais=%d\n",PlayerInfo[playerid][psMats]);fwrite(hFile, var);
format(var, 32, "TestVip=%d\n",PlayerInfo[playerid][pTimeVIP]);fwrite(hFile, var);
format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
format(var, 32, "Ouros=%d\n",PlayerInfo[playerid][pOuros]);fwrite(hFile, var);
format(var, 32, "Avisado=%d\n",PlayerInfo[playerid][pAviso]);fwrite(hFile, var);
format(var, 32, "Fome=%d\n",PlayerInfo[playerid][pFome]);fwrite(hFile, var);
format(var, 32, "PegouVIP=%d\n",PlayerInfo[playerid][pPVIP]);fwrite(hFile, var);
format(var, 32, "DiasBanTemp=%d\n",PlayerInfo[playerid][pDiaBanTemp]);fwrite(hFile, var);
format(var, 32, "MesBanTemp=%d\n",PlayerInfo[playerid][pMesBanTemp]);fwrite(hFile, var);
format(var, 32, "AnoBanTemp=%d\n",PlayerInfo[playerid][pAnoBanTemp]);fwrite(hFile, var);
format(var, 32, "DiasVIP=%d\n",PlayerInfo[playerid][pDiaVIP]);fwrite(hFile, var);
format(var, 32, "MesVIP=%d\n",PlayerInfo[playerid][pMesVIP]);fwrite(hFile, var);
format(var, 32, "AnoVIP=%d\n",PlayerInfo[playerid][pAnoVIP]);fwrite(hFile, var);
format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);
format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
format(var, 32, "Avisos=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
format(var, 32, "Luta=%d\n",PlayerInfo[playerid][pLuta]);fwrite(hFile, var);
format(var, 32, "Dorgado=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Dorgado2=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Doenca=%d\n",PlayerInfo[playerid][pDoenca]);fwrite(hFile, var);
format(var, 32, "LU=%s\n",PlayerInfo[playerid][pLastLogin]);fwrite(hFile, var);
format(var, 32, "Ban=%d\n",PlayerInfo[playerid][pBan]);fwrite(hFile, var);
format(var, 32, "TempoHospital=%d\n",PlayerInfo[playerid][pTempoHospitalizado]);fwrite(hFile, var);
format(var, 32, "HospitalID=%d\n",PlayerInfo[playerid][pHospitalID]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return true;[/spoiler][center]