Saving Player Data Make The Server Crash
#1

When Player Was Disconnected it alaways crash at SaveChar(playerid);

pawn Код:
stock SaveChar(playerid)
{
    if(IsPlayerLoggedIn(playerid))
    {
        if(PlayerInfo[playerid][pTutorial])
        {
            new file[64];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            if(!dini_Exists(file)) dini_Create(file);
            if(!Event[playerid])
            {
                PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
                PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
                GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
                GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
            }
            if(PlayerInfo[playerid][pLevel] == 0) PlayerInfo[playerid][pLevel] = 1;
            PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
            if(PlayerInfo[playerid][vModel])
            {
                GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
            }
            if(PlayerInfo[playerid][vVModel])
            {
                GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]);
            }
            if(PlayerInfo[playerid][vBModel])
            {
                GetVehiclePos(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBA]);
            }
            SaveDodAmmo(playerid);
            // Save
            //dini_Set(file, "AdminName", PlayerInfo[playerid][pAname]);
            dini_Set(file, "IP", PlayerInfo[playerid][pIP]);
            dini_IntSet(file, "Gender", PlayerInfo[playerid][pGender]);
            dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
            dini_IntSet(file, "UpgradePoints", PlayerInfo[playerid][pUpgradePoints]);
            dini_IntSet(file, "ArmorUpgrade", PlayerInfo[playerid][pArmorUpgrade]);
            dini_IntSet(file, "Minutes", PlayerInfo[playerid][pMinutes]);
            dini_IntSet(file, "TMinutes", PlayerInfo[playerid][pTMinutes]);
            dini_IntSet(file, "Hours", PlayerInfo[playerid][pHours]);
            dini_IntSet(file, "Age", PlayerInfo[playerid][pAge]);
            dini_IntSet(file, "Cash", PlayerInfo[playerid][pMoney]);
            dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank]);
            dini_IntSet(file, "Model", PlayerInfo[playerid][pModel]);
            dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]);
            dini_IntSet(file, "Mapper", PlayerInfo[playerid][pMapper]);
            dini_IntSet(file, "pBanned", PlayerInfo[playerid][pBanned]);
            dini_IntSet(file, "Phnumber", PlayerInfo[playerid][pNumber]);
            dini_IntSet(file, "AdMute", PlayerInfo[playerid][pADMute]);
            dini_IntSet(file, "JackSkill", PlayerInfo[playerid][pJackSkill]);
            dini_IntSet(file, "Death", PlayerInfo[playerid][pDeath]);
            dini_IntSet(file, "Kill", PlayerInfo[playerid][pKill]);
            dini_FloatSet(file, "X", PlayerInfo[playerid][pX]);
            dini_FloatSet(file, "Y", PlayerInfo[playerid][pY]);
            dini_FloatSet(file, "Z", PlayerInfo[playerid][pZ]);
            dini_IntSet(file, "Int", PlayerInfo[playerid][pInt]);
            dini_IntSet(file, "Hours", PlayerInfo[playerid][pExp]);
            dini_IntSet(file, "VW", PlayerInfo[playerid][pVW]);
            dini_IntSet(file, "VehVW", PlayerInfo[playerid][pVehVW]);
            dini_IntSet(file, "WalkStyle", PlayerInfo[playerid][pWalkStyle]);
            dini_IntSet(file, "Neon", PlayerInfo[playerid][pNeon]);
            dini_IntSet(file, "vNeon", PlayerInfo[playerid][pVNeon]);
            dini_IntSet(file, "Fac", PlayerInfo[playerid][pFac]);
            dini_IntSet(file, "FacRank", PlayerInfo[playerid][pFacRank]);
            dini_IntSet(file, "FacLeader", PlayerInfo[playerid][pFacLeader]);
            dini_IntSet(file, "FacDiv", PlayerInfo[playerid][pFacDiv]);
            dini_IntSet(file, "FacDivLeader", PlayerInfo[playerid][pFacDivLeader]);
            dini_IntSet(file, "Duty", PlayerInfo[playerid][pFacDuty]);
            dini_IntSet(file, "wSlot0", PlayerInfo[playerid][pWeapon][0]);
            dini_IntSet(file, "wSlot0Ammo", PlayerInfo[playerid][pWeaponAmmo][0]);
            dini_IntSet(file, "wSlot1", PlayerInfo[playerid][pWeapon][1]);
            dini_IntSet(file, "wSlot1Ammo", PlayerInfo[playerid][pWeaponAmmo][1]);
            dini_IntSet(file, "wSlot2", PlayerInfo[playerid][pWeapon][2]);
            dini_IntSet(file, "wSlot2Ammo", PlayerInfo[playerid][pWeaponAmmo][2]);
            dini_IntSet(file, "wSlot3", PlayerInfo[playerid][pWeapon][3]);
            dini_IntSet(file, "wSlot3Ammo", PlayerInfo[playerid][pWeaponAmmo][3]);
            dini_IntSet(file, "wSlot4", PlayerInfo[playerid][pWeapon][4]);
            dini_IntSet(file, "wSlot4Ammo", PlayerInfo[playerid][pWeaponAmmo][4]);
            dini_IntSet(file, "wSlot5", PlayerInfo[playerid][pWeapon][5]);
            dini_IntSet(file, "wSlot5Ammo", PlayerInfo[playerid][pWeaponAmmo][5]);
            dini_IntSet(file, "wSlot6", PlayerInfo[playerid][pWeapon][6]);
            dini_IntSet(file, "wSlot6Ammo", PlayerInfo[playerid][pWeaponAmmo][6]);
            dini_IntSet(file, "wSlot7", PlayerInfo[playerid][pWeapon][7]);
            dini_IntSet(file, "wSlot7Ammo", PlayerInfo[playerid][pWeaponAmmo][7]);
            dini_IntSet(file, "wSlot8", PlayerInfo[playerid][pWeapon][8]);
            dini_IntSet(file, "wSlot8Ammo", PlayerInfo[playerid][pWeaponAmmo][8]);
            dini_IntSet(file, "wSlot9", PlayerInfo[playerid][pWeapon][9]);
            dini_IntSet(file, "wSlot9Ammo", PlayerInfo[playerid][pWeaponAmmo][9]);
            dini_IntSet(file, "wSlot10", PlayerInfo[playerid][pWeapon][10]);
            dini_IntSet(file, "wSlot10Ammo", PlayerInfo[playerid][pWeaponAmmo][10]);
            dini_IntSet(file, "wSlot11", PlayerInfo[playerid][pWeapon][11]);
            dini_IntSet(file, "wSlot11Ammo", PlayerInfo[playerid][pWeaponAmmo][11]);
            dini_IntSet(file, "wSlot12", PlayerInfo[playerid][pWeapon][12]);
            dini_IntSet(file, "wSlot12Ammo", PlayerInfo[playerid][pWeaponAmmo][12]);
            dini_IntSet(file, "Hospital", PlayerInfo[playerid][pHospital]);
            dini_IntSet(file, "Business", PlayerInfo[playerid][pBiz]);
            dini_IntSet(file, "VBusiness", PlayerInfo[playerid][pVBiz]);
            dini_IntSet(file, "House", PlayerInfo[playerid][pHouse]);
            dini_IntSet(file, "Garage", PlayerInfo[playerid][pGarage]);
            dini_IntSet(file, "wtSlot1", PlayerInfo[playerid][pTGun][0]);
            dini_IntSet(file, "wtSlot1Ammo", PlayerInfo[playerid][pTGunAmmo][0]);
            dini_IntSet(file, "wtSlot2", PlayerInfo[playerid][pTGun][1]);
            dini_IntSet(file, "wtSlot2Ammo", PlayerInfo[playerid][pTGunAmmo][1]);
            dini_IntSet(file, "vwtSlot1", PlayerInfo[playerid][pvTGun][0]);
            dini_IntSet(file, "vwtSlot1Ammo", PlayerInfo[playerid][pvTGunAmmo][0]);
            dini_IntSet(file, "vwtSlot2", PlayerInfo[playerid][pvTGun][1]);
            dini_IntSet(file, "vwtSlot2Ammo", PlayerInfo[playerid][pvTGunAmmo][1]);
            dini_IntSet(file, "HouseOwner", PlayerInfo[playerid][pSafeAdmin]);
            dini_IntSet(file, "vHouse", PlayerInfo[playerid][pVHouse]);
            dini_IntSet(file, "BizOwner", PlayerInfo[playerid][pOwner]);
            dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
            dini_IntSet(file, "Mechanic", PlayerInfo[playerid][pJobSkill][JOB_MECHANIC]);
            dini_IntSet(file, "Lawyer", PlayerInfo[playerid][pJobSkill][JOB_LAWYER]);
            dini_IntSet(file, "Trucker", PlayerInfo[playerid][pJobSkill][JOB_TRUCKER]);
            dini_IntSet(file, "Courier", PlayerInfo[playerid][pJobSkill][JOB_COURIER]);
            dini_IntSet(file, "Fisher", PlayerInfo[playerid][pJobSkill][JOB_FISHER]);
            dini_IntSet(file, "WDealer", PlayerInfo[playerid][pJobSkill][JOB_WDEALER]);
            dini_IntSet(file, "WSmuggler", PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER]);
            dini_IntSet(file, "DDealer", PlayerInfo[playerid][pJobSkill][JOB_DDEALER]);
            dini_IntSet(file, "DSmuggler", PlayerInfo[playerid][pJobSkill][JOB_DSMUGGLER]);
            dini_IntSet(file, "CarJacker", PlayerInfo[playerid][pJobSkill][JOB_CARJACKER]);
            dini_IntSet(file, "Boxer", PlayerInfo[playerid][pJobSkill][JOB_BOXER]);
            dini_IntSet(file, "Fisher", PlayerInfo[playerid][pJobSkill][JOB_FISHER]);
            dini_IntSet(file, "TPackages", PlayerInfo[playerid][pTPackages]);
            dini_IntSet(file, "WPackages", PlayerInfo[playerid][pMPackages]);
            dini_IntSet(file, "Materials", PlayerInfo[playerid][pMaterials]);
            dini_IntSet(file, "MedMaterials", PlayerInfo[playerid][pMMaterials]);
            dini_IntSet(file, "HighMaterials", PlayerInfo[playerid][pHMaterials]);
            dini_IntSet(file, "MWPackages", PlayerInfo[playerid][pMMPackages]);
            dini_IntSet(file, "HWPackages", PlayerInfo[playerid][pHPackages]);
            dini_IntSet(file, "HasCellphone", PlayerInfo[playerid][pHasCellphone]);
            dini_IntSet(file, "Cellphone", PlayerInfo[playerid][pCellphone]);
            dini_IntSet(file, "Stereo", PlayerInfo[playerid][pStereo]);
            dini_IntSet(file, "Phonebook", PlayerInfo[playerid][pPhonebook]);
            dini_IntSet(file, "Dice", PlayerInfo[playerid][pDice]);
            dini_IntSet(file, "Cigar", PlayerInfo[playerid][pCigar]);
            dini_IntSet(file, "Speedo", PlayerInfo[playerid][pSpeedo]);
            dini_IntSet(file, "Sprunk", PlayerInfo[playerid][pSprunk]);
            dini_IntSet(file, "Spray", PlayerInfo[playerid][pSpray]);
            dini_IntSet(file, "Rope", PlayerInfo[playerid][pRope]);
            dini_IntSet(file, "Blindfold", PlayerInfo[playerid][pBlindfold]);
            dini_IntSet(file, "WT", PlayerInfo[playerid][pWT]);
            dini_IntSet(file, "WTC", PlayerInfo[playerid][pWTC]);
            dini_IntSet(file, "Gas", PlayerInfo[playerid][pGas]);
            dini_IntSet(file, "Radio", PlayerInfo[playerid][pRadio]);
            dini_FloatSet(file, "Health", PlayerInfo[playerid][pHealth]);
            dini_FloatSet(file, "Armor", PlayerInfo[playerid][pArmor]);
            dini_IntSet(file, "Internet", PlayerInfo[playerid][pInternet]);
            dini_IntSet(file, "Prison", PlayerInfo[playerid][pPrison]);
            dini_IntSet(file, "PrisonTime", PlayerInfo[playerid][pPrisonTime]);
            dini_Set(file, "PrisonReason", PlayerInfo[playerid][pPrisonReason]);
            dini_IntSet(file, "Mask", PlayerInfo[playerid][pMask]);
            dini_IntSet(file, "Masked", PlayerInfo[playerid][pMasked]);
            dini_IntSet(file, "MaskID", PlayerInfo[playerid][pMaskID]);
            dini_Set(file, "PrisonBy", PlayerInfo[playerid][pPrisonBy]);
            dini_IntSet(file, "Wanted", PlayerInfo[playerid][pWanted]);
            dini_Set(file, "Wanted1", PlayerInfo[playerid][pWanted1]);
            dini_Set(file, "Wanted2", PlayerInfo[playerid][pWanted2]);
            dini_Set(file, "Wanted3", PlayerInfo[playerid][pWanted3]);
            dini_Set(file, "Wanted4", PlayerInfo[playerid][pWanted4]);
            dini_Set(file, "Wanted5", PlayerInfo[playerid][pWanted5]);
            dini_Set(file, "Wanted6", PlayerInfo[playerid][pWanted6]);
            dini_IntSet(file, "Crimes", PlayerInfo[playerid][pCrimes]);
            dini_IntSet(file, "Arrested", PlayerInfo[playerid][pArrested]);
            dini_IntSet(file, "DPackages", PlayerInfo[playerid][pDPackages]);
            dini_IntSet(file, "Weed", PlayerInfo[playerid][pWeed]);
            dini_IntSet(file, "cocaine", PlayerInfo[playerid][pcocaine]);
            dini_IntSet(file, "TrunkWeed", PlayerInfo[playerid][pTWeed]);
            dini_IntSet(file, "Trunkcocaine", PlayerInfo[playerid][pTcocaine]);
            dini_IntSet(file, "vTrunkWeed", PlayerInfo[playerid][pvTWeed]);
            dini_IntSet(file, "vTrunkcocaine", PlayerInfo[playerid][pvTcocaine]);
            dini_IntSet(file, "Contract", PlayerInfo[playerid][pContract]);
            dini_Set(file, "ContractBy", PlayerInfo[playerid][pContractBy]);
            dini_IntSet(file, "Tutorial", PlayerInfo[playerid][pTutorial]);
            dini_IntSet(file, "Warns", PlayerInfo[playerid][pWarns]);
            dini_Set(file, "Warn1", PlayerInfo[playerid][pWarn1]);
            dini_Set(file, "Warn2", PlayerInfo[playerid][pWarn2]);
            dini_Set(file, "Warn3", PlayerInfo[playerid][pWarn3]);
            dini_Set(file, "Flag", PlayerInfo[playerid][pFlag]);
            dini_IntSet(file, "NMute", PlayerInfo[playerid][pNMute]);
            dini_IntSet(file, "RMute", PlayerInfo[playerid][pRMute]);
            dini_IntSet(file, "SpawnFreeze", PlayerInfo[playerid][pSpawnFreeze]);
            dini_IntSet(file, "Fam", PlayerInfo[playerid][pFam]);
            dini_IntSet(file, "FamRank", PlayerInfo[playerid][pFamRank]);
            dini_IntSet(file, "CSuccess", PlayerInfo[playerid][pCSuccess]);
            dini_IntSet(file, "CFail", PlayerInfo[playerid][pCFail]);
            dini_IntSet(file, "Helper", PlayerInfo[playerid][pHelper]);
            dini_IntSet(file, "vModel", PlayerInfo[playerid][vModel]);
            dini_FloatSet(file, "vX", PlayerInfo[playerid][vX]);
            dini_FloatSet(file, "vY", PlayerInfo[playerid][vY]);
            dini_FloatSet(file, "vZ", PlayerInfo[playerid][vZ]);
            dini_FloatSet(file, "vA", PlayerInfo[playerid][vA]);
            dini_IntSet(file, "vC1", PlayerInfo[playerid][vC1]);
            dini_IntSet(file, "vC2", PlayerInfo[playerid][vC2]);
            dini_IntSet(file, "vPJ", PlayerInfo[playerid][vPJ]);
            dini_IntSet(file, "vLocked", PlayerInfo[playerid][vLocked]);
            dini_IntSet(file, "GangMod", PlayerInfo[playerid][pGangMod]);
            dini_IntSet(file, "FacMod", PlayerInfo[playerid][pFacMod]);
            dini_IntSet(file, "BanAppealer", PlayerInfo[playerid][pBanAppealer]);
            dini_IntSet(file, "CarLicense", PlayerInfo[playerid][pCarLic]);
            dini_IntSet(file, "FlyLicense", PlayerInfo[playerid][pFlyLic]);
            dini_IntSet(file, "WepLicense", PlayerInfo[playerid][pWepLic]);
            dini_IntSet(file, "Accent", PlayerInfo[playerid][pAccent]);
            dini_IntSet(file, "vModSlot0",PlayerInfo[playerid][pVehMod][0]);
            dini_IntSet(file, "vModSlot1",PlayerInfo[playerid][pVehMod][1]);
            dini_IntSet(file, "vModSlot2",PlayerInfo[playerid][pVehMod][2]);
            dini_IntSet(file, "vModSlot3",PlayerInfo[playerid][pVehMod][3]);
            dini_IntSet(file, "vModSlot4",PlayerInfo[playerid][pVehMod][4]);
            dini_IntSet(file, "vModSlot5",PlayerInfo[playerid][pVehMod][5]);
            dini_IntSet(file, "vModSlot6",PlayerInfo[playerid][pVehMod][6]);
            dini_IntSet(file, "vModSlot7",PlayerInfo[playerid][pVehMod][7]);
            dini_IntSet(file, "vModSlot8",PlayerInfo[playerid][pVehMod][8]);
            dini_IntSet(file, "vModSlot9",PlayerInfo[playerid][pVehMod][9]);
            dini_IntSet(file, "vModSlot10",PlayerInfo[playerid][pVehMod][10]);
            dini_IntSet(file, "vModSlot11",PlayerInfo[playerid][pVehMod][11]);
            dini_IntSet(file, "vModSlot12",PlayerInfo[playerid][pVehMod][12]);
            dini_IntSet(file, "vModSlot13",PlayerInfo[playerid][pVehMod][13]);
            dini_IntSet(file, "pDay", PlayerInfo[playerid][pDay]);
            dini_IntSet(file, "VIP", PlayerInfo[playerid][pVIP]);
            dini_IntSet(file, "VIPBuddy", PlayerInfo[playerid][pVIPBuddy]);
            dini_IntSet(file, "VIPDay", PlayerInfo[playerid][pVIPDay]);
            dini_IntSet(file, "VIPMonth", PlayerInfo[playerid][pVIPMonth]);
            dini_IntSet(file, "VIPHour", PlayerInfo[playerid][pVIPHour]);
            dini_IntSet(file, "VIPJob", PlayerInfo[playerid][pVIPJob]);
            dini_IntSet(file, "VIPTemp", PlayerInfo[playerid][pVIPTemp]);
            dini_IntSet(file, "vBModel", PlayerInfo[playerid][vBModel]);
            dini_FloatSet(file, "vBX", PlayerInfo[playerid][vBX]);
            dini_FloatSet(file, "vBY", PlayerInfo[playerid][vBY]);
            dini_FloatSet(file, "vBZ", PlayerInfo[playerid][vBZ]);
            dini_FloatSet(file, "vBA", PlayerInfo[playerid][vBA]);
            dini_IntSet(file, "vBC1", PlayerInfo[playerid][vBC1]);
            dini_IntSet(file, "vBC2", PlayerInfo[playerid][vBC2]);
            dini_IntSet(file, "vBPJ", PlayerInfo[playerid][vBPJ]);
            dini_IntSet(file, "vBLocked", PlayerInfo[playerid][vBLocked]);
            dini_IntSet(file, "vBModSlot0",PlayerInfo[playerid][pBVehMod][0]);
            dini_IntSet(file, "vBModSlot1",PlayerInfo[playerid][pBVehMod][1]);
            dini_IntSet(file, "vBModSlot2",PlayerInfo[playerid][pBVehMod][2]);
            dini_IntSet(file, "vBModSlot3",PlayerInfo[playerid][pBVehMod][3]);
            dini_IntSet(file, "vBModSlot4",PlayerInfo[playerid][pBVehMod][4]);
            dini_IntSet(file, "vBModSlot5",PlayerInfo[playerid][pBVehMod][5]);
            dini_IntSet(file, "vBModSlot6",PlayerInfo[playerid][pBVehMod][6]);
            dini_IntSet(file, "vBModSlot7",PlayerInfo[playerid][pBVehMod][7]);
            dini_IntSet(file, "vBModSlot8",PlayerInfo[playerid][pBVehMod][8]);
            dini_IntSet(file, "vBModSlot9",PlayerInfo[playerid][pBVehMod][9]);
            dini_IntSet(file, "vBModSlot10",PlayerInfo[playerid][pBVehMod][10]);
            dini_IntSet(file, "vBModSlot11",PlayerInfo[playerid][pBVehMod][11]);
            dini_IntSet(file, "vBModSlot12",PlayerInfo[playerid][pBVehMod][12]);
            dini_IntSet(file, "vBModSlot13",PlayerInfo[playerid][pBVehMod][13]);
            // VIP CAR
            dini_IntSet(file, "vVModel", PlayerInfo[playerid][vVModel]);
            dini_FloatSet(file, "vVX", PlayerInfo[playerid][vVX]);
            dini_FloatSet(file, "vVY", PlayerInfo[playerid][vVY]);
            dini_FloatSet(file, "vVZ", PlayerInfo[playerid][vVZ]);
            dini_FloatSet(file, "vVA", PlayerInfo[playerid][vVA]);
            dini_IntSet(file, "vVC1", PlayerInfo[playerid][vVC1]);
            dini_IntSet(file, "vVC2", PlayerInfo[playerid][vVC2]);
            dini_IntSet(file, "vVPJ", PlayerInfo[playerid][vVPJ]);
            dini_IntSet(file, "vVLocked", PlayerInfo[playerid][vVLocked]);
            dini_IntSet(file, "vVModSlot0",PlayerInfo[playerid][pVVehMod][0]);
            dini_IntSet(file, "vVModSlot1",PlayerInfo[playerid][pVVehMod][1]);
            dini_IntSet(file, "vVModSlot2",PlayerInfo[playerid][pVVehMod][2]);
            dini_IntSet(file, "vVModSlot3",PlayerInfo[playerid][pVVehMod][3]);
            dini_IntSet(file, "vVModSlot4",PlayerInfo[playerid][pVVehMod][4]);
            dini_IntSet(file, "vVModSlot5",PlayerInfo[playerid][pVVehMod][5]);
            dini_IntSet(file, "vVModSlot6",PlayerInfo[playerid][pVVehMod][6]);
            dini_IntSet(file, "vVModSlot7",PlayerInfo[playerid][pVVehMod][7]);
            dini_IntSet(file, "vVModSlot8",PlayerInfo[playerid][pVVehMod][8]);
            dini_IntSet(file, "vVModSlot9",PlayerInfo[playerid][pVVehMod][9]);
            dini_IntSet(file, "vVModSlot10",PlayerInfo[playerid][pVVehMod][10]);
            dini_IntSet(file, "vVModSlot11",PlayerInfo[playerid][pVVehMod][11]);
            dini_IntSet(file, "vVModSlot12",PlayerInfo[playerid][pVVehMod][12]);
            dini_IntSet(file, "vVModSlot13",PlayerInfo[playerid][pVVehMod][13]);
            dini_IntSet(file, "DeliverTruck", PlayerInfo[playerid][pDeliverTruck]);
            dini_IntSet(file, "New", PlayerInfo[playerid][pNew]);
            dini_IntSet(file, "RefPoints", PlayerInfo[playerid][pRefPoints]);
            dini_IntSet(file, "Tester", PlayerInfo[playerid][pTester]);
            dini_IntSet(file, "FightStyle", PlayerInfo[playerid][pFightStyle]);
            dini_IntSet(file, "Scope", PlayerInfo[playerid][pScope]);
            dini_IntSet(file, "Cookies", PlayerInfo[playerid][pCookies]);
            //dini_IntSet(file, "Oldskool", PlayerInfo[playerid][pOldskool]);
            dini_IntSet(file, "Reward", PlayerInfo[playerid][pReward]);
            dini_IntSet(file, "Fish1", PlayerInfo[playerid][pFish][0]);
            dini_IntSet(file, "Fish2", PlayerInfo[playerid][pFish][1]);
            dini_IntSet(file, "Fish3", PlayerInfo[playerid][pFish][2]);
            dini_IntSet(file, "Fish4", PlayerInfo[playerid][pFish][3]);
            dini_IntSet(file, "Fish5", PlayerInfo[playerid][pFish][4]);
            SaveToys(playerid, file);
            dini_IntSet(file, "Loyal", PlayerInfo[playerid][pLoyal]);
            dini_IntSet(file, "LoyalTag", PlayerInfo[playerid][pLoyalTag]);
            dini_IntSet(file, "LPoints", PlayerInfo[playerid][pLPoints]);
            dini_IntSet(file, "Gate1", PlayerInfo[playerid][pGate][0]);
            dini_IntSet(file, "Gate2", PlayerInfo[playerid][pGate][1]);
            dini_IntSet(file, "Gate3", PlayerInfo[playerid][pGate][2]);
            dini_FloatSet(file, "Hunger", PlayerInfo[playerid][pHunger]);
            //dini_FloatSet(file, "Energy", PlayerInfo[playerid][pEnergy]);
            dini_FloatSet(file, "Haus", PlayerInfo[playerid][pHaus]);
            dini_IntSet(file, "Pulsa", PlayerInfo[playerid][pPulsa]);
            print("User File saved successfully.");
        }
    }
    return 1;
}
BIG REP FOR WHO HELP THIS
Reply
#2

Do you have a folder called users in the scriptfiles folder?
Reply
#3

you did ?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
SaveChar(playerid);
return 1;
}
Reply
#4

Load crashdetect plugin: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile your scripts, start the server and test it once again. If it shuts the server down, then post your server log.
Reply
#5

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
Do you have a folder called users in the scriptfiles folder?
Yep
Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
you did ?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
SaveChar(playerid);
return 1;
}
Yes I Did That

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Load crashdetect plugin: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile your scripts, start the server and test it once again. If it shuts the server down, then post your server log.
Okay i will use this
Reply
#6

pawn Код:
[11:05:46] [debug] Run time error 4: "Array index out of bounds"
[11:05:46] [debug]  Accessing element at negative index -1
[11:05:46] [debug] AMX backtrace:
[11:05:46] [debug] #0 00065b28 in public Audio_OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
[11:05:46] [debug] #1 native CallLocalFunction () [080dbf60] from samp03svr
[11:05:46] [debug] #2 0001e9e0 in public FC_OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
[11:05:46] [debug] #3 native CallLocalFunction () [080dbf60] from samp03svr
[11:05:46] [debug] #4 0001dc24 in public Streamer_OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
[11:05:46] [debug] #5 native CallLocalFunction () [080dbf60] from samp03svr
[11:05:46] [debug] #6 00017ff0 in public SSCANF_OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
[11:05:46] [debug] #7 native CallLocalFunction () [080dbf60] from samp03svr
[11:05:46] [debug] #8 000117cc in public Itter_OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
[11:05:46] [debug] #9 native CallLocalFunction () [080dbf60] from samp03svr
[11:05:46] [debug] #10 00010ee0 in public OnPlayerDisconnect (0x00000003, 0x00000001) from project.amx
I GOT THIS
Reply
#7

Post OnPlayerDisconnect callback please. Are you sure you did the debug info correctly? It'd be really useful for the exact line causes the run time error 4.
Reply
#8

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if (GetPVarInt(playerid, "Renting") == 1)
    {
        IsRented[GetPVarInt(playerid, "CarRentID")] = 0,
        SetVehicleToRespawn(GetPVarInt(playerid, "CarRentID"));
        DeletePVar(playerid, "Renting");
        DeletePVar(playerid, "CarRentID");
    }
    KillTimer(HospitalCountDown[playerid]);
    Truckerjob[playerid] = 0;
    HospitalTime[playerid] = 0;
    IsDead[playerid] = -1;
    DestroyProgressBar(hungry[playerid]);
    if(PlayerInfo[playerid][pSpawnVehicle])
    {
        DestroyVehicle(PlayerInfo[playerid][pSpawnVehicle]);
    }
    if(aDuty[playerid] == 1)
    {
        new name[MAX_PLAYER_NAME];
        GetPVarString(playerid, "OldName", name, sizeof(name));
        SetPlayerName(playerid, name);
        aDuty[playerid] = 0;
    }
    new strings[128];
    switch(reason)
    {
        case 0: // Crashed
        {
            format(strings, sizeof(strings), "* %s {00C0FF}Telah Meninggalkan Server. {FF0000}(Koneksi Terputus)", RPN(playerid));
            SendClientMessageToAll(COLOR_YELLOW, strings);
        }
        case 1: // Leaving
        {
            format(strings, sizeof(strings), "* %s {00C0FF}Telah Meninggalkan Server. {FF0000}(/q atau exit)", RPN(playerid));
            SendClientMessageToAll(COLOR_YELLOW, strings);
        }
        case 2: // Kicked/Banned
        {
            format(strings, sizeof(strings), "* %s {00C0FF}Telah Meninggalkan Server. {FF0000}(Kicked atau Banned)", RPN(playerid));
            SendClientMessageToAll(COLOR_YELLOW, strings);
        }
    }
    if(PlayerInfo[playerid][pMasked] == 1)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 1); // ShowPlayerNameTagForPlayer(i, playerid, 1) show name back.
        }
    }
    ProdSell[playerid] = 0;
    PProdSell[playerid] = 0;
    //TextDrawDestroy(Fuelbox[playerid]);
    //TextDrawDestroy(Fspeed[playerid]);
    //TextDrawDestroy(Vhealth[playerid]);
    //TextDrawDestroy(fuel[playerid]);
    if(adostatus[playerid] == 1 || amestatus[playerid] == 1)
    {
        DestroyDynamic3DTextLabel(ado[playerid]);
        adostatus[playerid] = 0;
        DestroyDynamic3DTextLabel(ame[playerid]);
        amestatus[playerid] = 0;
    }
    //amestatus[playerid] = 0;
    //adostatus[playerid] = 0;
    MusicStereo[playerid] = 0;
    MusicStereoPlayer[playerid] = -1;
    MusicStereoStream[playerid] = 0;
    bpos[playerid][0] = 0; bpos[playerid][1] = 0; bpos[playerid][2] = 0; bpos[playerid][3] = 0;
    format(MusicStereoURL[playerid], 256, "");
    if(IsValidDynamicObject(MusicStereoObject[playerid]))
    {
        DestroyDynamicObject(MusicStereoObject[playerid]);
    }
    for(new pp=0; pp<MAX_PLAYERS; pp++)
    {
        if(IsPlayerConnected(pp))
        {
            if(MusicStereoPlayer[pp] == playerid)
            {
                    MusicStereoStream[pp] = 0;
                    MusicStereoPlayer[pp] = -1;
                    StopAudioStreamForPlayer(pp);
                    SendClientMessage(pp, COLOR_GREY, " The MusicStereo creator has disconnected from the server.");
            }
        }
    }
    if(BankRobber[playerid])
    {
        new Rob = BankRobber[playerid]-1, string[128];
        DisablePlayerCheckpoint(playerid);
        BankRobbersCount --;
        format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
        DeliverMoney[playerid] = 0;
        //
        format(string, sizeof(string), "** %s has disconnected and has failed the robbery. **", RPN(playerid));
        SendRobberyMessage(COLOR_LIGHTRED, string);
        SendCopMessage(COLOR_LIGHTRED, string);
        BankRobber[playerid] = 0;
        if(BankRobbersCount == 0)
        {
            TextDrawHideForAll(Textdraw0);
            TextDrawHideForAll(Textdraw1);
            TextDrawHideForAll(Textdraw2);
            TextDrawHideForAll(Textdraw3);
            TextDrawHideForAll(Textdraw4);
            TextDrawHideForAll(Textdraw5);
//          BankRobbery = 0;
            RobberyStarted = 0;
            format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
            SendClientMessageToAll(COLOR_YELLOW, string);
            TotalRobbers = 0;
            //new copsonline;
        }
    }
    RemovePlayerAttachedObject(playerid, 0);
    //paintball
    if(PlayerPaintballing[playerid] == 1)
    {
        ResetPlayerWeapons(playerid);
        ResetDodWeapons(playerid);
        SetPlayerPos(playerid,1310.1110,-1368.5656,13.517786);
        for(new w = 0; w < 13; w++)
        {
            GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
        }
    }
    // Boxing
    new string[128];
    if(Boxing[playerid])
    {
        // Getting other boxer's ID
        new playerb = -1;
        if(playerb != -1)
        {
            format(string, sizeof(string), "Boxing Ring: The boxing match has ended, %s has won the match.", RPN(playerb));
            SendGymMessage(COLOR_WHITE, string);
            // Putting them out of the ring
            SetPlayerPos(playerb, 760.9759,4.7187,1000.7084);
            SetPlayerFacingAngle(playerb, 268.9407);
            SetPlayerPos(playerid, 760.9759,6.1794,1000.7093);
            SetPlayerFacingAngle(playerid, 268.9407);
            // Giving the winner extra skill point
            new oldj = strval(RPJL(playerb, JOB_BOXER));
            PlayerInfo[playerb][pJobSkill][JOB_BOXER] ++;
            new newj = strval(RPJL(playerb, JOB_BOXER));
            if(oldj < newj)
            {
                format(string, sizeof(string), "** Your Boxer level is now %d, you can now cause %d more damage. **", newj, (newj*2)-2);
                SendClientMessage(playerb, COLOR_YELLOW, string);
            }
            //
            SendClientMessage(playerb, COLOR_LIME, " You have won the boxing match.");
            SendClientMessage(playerid, COLOR_LIGHTRED, " You have lost the boxing match.");
            // Giving Bids
            for(new w = 0; w < 13; w++)
            {
                GiveDodWeapon(playerb, PlayerInfo[playerb][pWeapon][w], PlayerInfo[playerb][pWeaponAmmo][w]);
            }
        }
        for(new w = 0; w < 13; w++)
        {
            GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
        }
        // Resetting Values
        BoxingMatch = 0;
        Boxer[1] = -1;
        pBoxer[playerb] = 0;
        Boxer[2] = -1;
        pBoxer[playerid] = 0;
        Boxing[playerb] = 0;
        Boxing[playerid] = 0;
        BoxerBid[1] = 0;
        BoxerBid[2] = 0;
        if(BoxTime)
        {
            TogglePlayerControllable(playerb, 1);
            KillTimer(BoxTimer);
        }
    }
    // The rest
    SaveChar(playerid);
    foreach(Player, i)
    {
        if(BankRobber[playerid])
        {
            new Rob = BankRobber[playerid]-1;
            new copsonline;
            if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
            {
                if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
                else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
                else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
                else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
                else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
            }
            if(IsACop(i))
            {
                    copsonline++;
                    new Saved = (TotalRobbers*10000-(TotalStolen*10000));
                    GivePlayerCash(i, Saved/copsonline);
                    new fstringz[128];
                    format(fstringz, sizeof(fstringz), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
                    SendClientMessage(i, COLOR_LIME, fstringz);
            }
        }
        new playerb = -1;
        if(Boxing[i] && i != playerid) playerb = i;
        new winner = pBoxer[playerb];
        if(BidBoxer[i] == winner)
        {
            new percent, profit;
            percent = (BidAmount[i]/BoxerBid[winner]) * 10000;
            profit = (percent * BoxerBid[pBoxer[playerid]]) / 10000;
            GivePlayerCash(i, BidAmount[i] + profit);
            format(string, sizeof(string), " You have won $%d from bidding in the match, the money you bid has been returned as well.", profit);
            SendClientMessage(i, COLOR_LIME, string);
        }
        BidAmount[i] = 0;
        BidBoxer[i] = 0;
        if(Specid[i] == playerid)
        {
            Spec[i] = 0;
            Specid[i] = -1;
            TogglePlayerSpectating(i, 0);
            SetPlayerVirtualWorld(i, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(i, PlayerInfo[playerid][pInt]);
            SetPlayerPos(i, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            SendClientMessage(i, COLOR_WHITE, " You have stopped spectating players.");
        }
    }
    // Clearing AD
    for(new i=0; i<MAX_ADS; i++)
    {
        if(strfind(AD[i], RPN(playerid)) != -1)
        {
            format(AD[i], 128, "");
        }
    }
    // End of Clearing AD
    ClearChar(playerid);
    if(Planted[playerid] == 1)
    {
        DestroyObject(C4[playerid]);
        Bomb[playerid] = 0;
        Planted[playerid] = 0;
    }
    return 1;
}
Reply
#9

I guess it's because of this:
pawn Код:
profit = (percent * BoxerBid[pBoxer[playerid]]) / 10000;
If pBoxer[playerid] is -1, it will cause the run time error. However, without the debug info - it's not 100%.
Check if pBoxer[playerid] is not -1 and then use it inside BoxerBid array.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)