Delay in /vpark
#1

pawn Код:
if(strcmp(cmd, "/vpark", true) == 0)
{
    new Float:x,Float:y,Float:z;
    new Float:a;
    new carid;
    new getcarid;
    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
    else { return 1; }
    getcarid = GetPlayerVehicleID(playerid);
    GetPlayerName(playerid, playername, sizeof(playername));
    GetVehiclePos(carid, x, y, z);
    GetVehicleZAngle(carid, a);
    if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
    {
        if(PlayerInfo[playerid][pPcarkey] == 9999  && PlayerInfo[playerid][pPcarkey2] == 9999)
        {
            SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
            return 1;
        }
        if(getcarid == carid)
        {
            CarInfo[carid][cLocationx] = x;
            CarInfo[carid][cLocationy] = y;
            CarInfo[carid][cLocationz] = z;
            CarInfo[carid][cAngle] = a;
            new area[35];
            GetPlayer2DZone(playerid, area, sizeof(area));
            OnPropUpdate(4,carid);
            OnPlayerUpdateEx(playerid);
            DestroyVehicle(carid);
            ownedcar[carid] = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz],CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
            if(CarInfo[carid][cPaintjob] != 999)
            {
                ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]);
            }
            if(CarInfo[carid][cPlate] != 999)
            {
                SetVehicleNumberPlate(carid, CarInfo[carid][cPlate]);
            }
            if(CarInfo[carid][cLock] == 1)
            {
                new e,l,a77,d77,b,bo,o;
                GetVehicleParamsEx(carid,e,l,a77,d77,b,bo,o);
                SetVehicleParamsEx(carid,e,l,a77,1,b,bo,o);
            }
            SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]);
            SetVehicleModifications(carid);
            TogglePlayerControllable(playerid, 1);
            PutPlayerInVehicle(playerid, carid, 0);
            new lights, alarm, doors, bonnet, boot, objective;
            SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
            engineOn[GetPlayerVehicleID(playerid)] = false;
            gEngine[playerid] = 0;
            return 1;
            }
        }
        return 1;
    }
How do I nock out the delay on /vpark?, it delays like 4-5 seconds, when you run the command.
Reply
#2

Show us OnPropUpdate
Reply
#3

pawn Код:
public OnPropUpdate(update,idx)
{
    new file[64];
    if(update == 1)
    {
        format(file, sizeof(file),"LARP/Properties/%d.ini",idx);
        if(dini_Exists(file))
        {
            if(HouseInfo[idx][hSetted] == 1)
            {
                dini_FloatSet(file,"Entrance_X",HouseInfo[idx][hEntrancex]);
                dini_FloatSet(file,"Entrance_Y",HouseInfo[idx][hEntrancey]);
                dini_FloatSet(file,"Entrance_Z",HouseInfo[idx][hEntrancez]);
                dini_FloatSet(file,"Exit_X",HouseInfo[idx][hExitx]);
                dini_FloatSet(file,"Exit_Y",HouseInfo[idx][hExity]);
                dini_FloatSet(file,"Exit_Z",HouseInfo[idx][hExitz]);
                dini_IntSet(file,"Health_X",HouseInfo[idx][hHealthx]);
                dini_IntSet(file,"Health_Y",HouseInfo[idx][hHealthy]);
                dini_IntSet(file,"Health_Z",HouseInfo[idx][hHealthz]);
                dini_IntSet(file,"Armour_X",HouseInfo[idx][hArmourx]);
                dini_IntSet(file,"Armour_Y",HouseInfo[idx][hArmoury]);
                dini_IntSet(file,"Armour_Z",HouseInfo[idx][hArmourz]);
                dini_Set(file,"Owner",HouseInfo[idx][hOwner]);
                dini_Set(file,"Description",HouseInfo[idx][hDiscription]);
                dini_IntSet(file,"Price",HouseInfo[idx][hValue]);
                dini_IntSet(file,"Health",HouseInfo[idx][hHel]);
                dini_IntSet(file,"Armour",HouseInfo[idx][hArm]);
                dini_IntSet(file,"Interior",HouseInfo[idx][hInt]);
                dini_IntSet(file,"Locked",HouseInfo[idx][hLock]);
                dini_IntSet(file,"Owned",HouseInfo[idx][hOwned]);
                dini_IntSet(file,"Rooms",HouseInfo[idx][hRooms]);
                dini_IntSet(file,"RentPrice",HouseInfo[idx][hRentabil]);
                dini_IntSet(file,"Takings",HouseInfo[idx][hTakings]);
                dini_IntSet(file,"LevelNeeded",HouseInfo[idx][hLevel]);
                dini_IntSet(file,"World",HouseInfo[idx][hWorld]);
                dini_IntSet(file,"Setted",HouseInfo[idx][hSetted]);
                dini_IntSet(file,"Drugs",HouseInfo[idx][hDrugs]);
                dini_IntSet(file,"Materials",HouseInfo[idx][hMaterials]);
                dini_IntSet(file,"Weapon1",HouseInfo[idx][hWeapon1]);
                dini_IntSet(file,"Ammo1",HouseInfo[idx][hAmmo1]);
                dini_IntSet(file,"Weapon2",HouseInfo[idx][hWeapon2]);
                dini_IntSet(file,"Ammo2",HouseInfo[idx][hAmmo2]);
                dini_IntSet(file,"Weapon3",HouseInfo[idx][hWeapon3]);
                dini_IntSet(file,"Ammo3",HouseInfo[idx][hAmmo3]);
                dini_IntSet(file,"Weapon4",HouseInfo[idx][hWeapon4]);
                dini_IntSet(file,"Ammo4",HouseInfo[idx][hAmmo4]);
                dini_IntSet(file,"Weapon5",HouseInfo[idx][hWeapon5]);
                dini_IntSet(file,"Ammo5",HouseInfo[idx][hAmmo5]);
                dini_IntSet(file,"Weapon6",HouseInfo[idx][hWeapon6]);
                dini_IntSet(file,"Ammo6",HouseInfo[idx][hAmmo6]);
                dini_Set(file,"Message",HouseInfo[idx][hMessage]);
            }
            else
            {
                fremove(file);
            }
        }
    }
    else if(update == 2)
    {
        format(file, sizeof(file),"LARP/Bizzes/%d.ini",idx);
        if(dini_Exists(file))
        {
            if(BizzInfo[idx][bSetted] == 1)
            {
                dini_IntSet(file,"Owned",BizzInfo[idx][bOwned]);
                dini_Set(file,"Owner",BizzInfo[idx][bOwner]);
                dini_Set(file,"Message",BizzInfo[idx][bMessage]);
                dini_Set(file,"ExtortionBy",BizzInfo[idx][bExtortion]);
                dini_FloatSet(file,"Entrance_X",BizzInfo[idx][bEntranceX]);
                dini_FloatSet(file,"Entrance_Y",BizzInfo[idx][bEntranceY]);
                dini_FloatSet(file,"Entrance_Z",BizzInfo[idx][bEntranceZ]);
                dini_FloatSet(file,"Exit_X",BizzInfo[idx][bExitX]);
                dini_FloatSet(file,"Exit_Y",BizzInfo[idx][bExitY]);
                dini_FloatSet(file,"Exit_Z",BizzInfo[idx][bExitZ]);
                dini_IntSet(file,"LevelNeeded",BizzInfo[idx][bLevelNeeded]);
                dini_IntSet(file,"Price",BizzInfo[idx][bBuyPrice]);
                dini_IntSet(file,"EntranceCost",BizzInfo[idx][bEntranceCost]);
                dini_IntSet(file,"Till",BizzInfo[idx][bTill]);
                dini_IntSet(file,"Locked",BizzInfo[idx][bLocked]);
                dini_IntSet(file,"Interior",BizzInfo[idx][bInterior]);
                dini_IntSet(file,"Products",BizzInfo[idx][bProducts]);
                dini_IntSet(file,"MaxProducts",BizzInfo[idx][bMaxProducts]);
                dini_IntSet(file,"ProductPrice",BizzInfo[idx][bPriceProd]);
                dini_IntSet(file,"VirtualWorld",BizzInfo[idx][bVirWorld]);
                dini_IntSet(file,"InteriorNr",BizzInfo[idx][bInteriorNr]);
                dini_IntSet(file,"Setted",BizzInfo[idx][bSetted]);
            }
            else
            {
                fremove(file);
            }
        }
    }
    else if(update == 3)
    {
        format(file, sizeof(file),"LARP/SBizzes/%d.ini",idx);
        if(!dini_Exists(file))
        {
            dini_Create(file);
        }
        dini_IntSet(file,"Owned",SBizzInfo[idx][sbOwned]);
        dini_Set(file,"Owner",SBizzInfo[idx][sbOwner]);
        dini_Set(file,"Message",SBizzInfo[idx][sbMessage]);
        dini_Set(file,"ExtortionBy",SBizzInfo[idx][sbExtortion]);
        dini_FloatSet(file,"Entrance_X",SBizzInfo[idx][sbEntranceX]);
        dini_FloatSet(file,"Entrance_Y",SBizzInfo[idx][sbEntranceY]);
        dini_FloatSet(file,"Entrance_Z",SBizzInfo[idx][sbEntranceZ]);
        dini_IntSet(file,"LevelNeeded",SBizzInfo[idx][sbLevelNeeded]);
        dini_IntSet(file,"Price",SBizzInfo[idx][sbBuyPrice]);
        dini_IntSet(file,"EntranceCost",SBizzInfo[idx][sbEntranceCost]);
        dini_IntSet(file,"Till",SBizzInfo[idx][sbTill]);
        dini_IntSet(file,"Locked",SBizzInfo[idx][sbLocked]);
        dini_IntSet(file,"Interior",SBizzInfo[idx][sbInterior]);
        dini_IntSet(file,"Products",SBizzInfo[idx][sbProducts]);
        dini_IntSet(file,"MaxProducts",SBizzInfo[idx][sbMaxProducts]);
        dini_IntSet(file,"ProductPrice",SBizzInfo[idx][sbPriceProd]);
    }
    else if(update == 4)
    {
        format(file, sizeof(file),"LARP/Vehicles/%d.ini",idx);
        if(dini_Exists(file))
        {
            dini_IntSet(file,"Model",CarInfo[idx][cModel]);
            dini_FloatSet(file,"Location_X",CarInfo[idx][cLocationx]);
            dini_FloatSet(file,"Location_Y",CarInfo[idx][cLocationy]);
            dini_FloatSet(file,"Location_Z",CarInfo[idx][cLocationz]);
            dini_FloatSet(file,"Angle",CarInfo[idx][cAngle]);
            dini_IntSet(file,"Color_1",CarInfo[idx][cColorOne]);
            dini_IntSet(file,"Color_2",CarInfo[idx][cColorTwo]);
            dini_Set(file,"Owner",CarInfo[idx][cOwner]);
            dini_IntSet(file,"Owned",CarInfo[idx][cOwned]);
            dini_IntSet(file,"Locked",CarInfo[idx][cLock]);
            dini_Set(file,"Plate",CarInfo[idx][cPlate]);
            dini_IntSet(file,"Paintjob",CarInfo[idx][cPaintjob]);
            dini_IntSet(file,"VirtualWorld",CarInfo[idx][cVirWorld]);
            dini_IntSet(file,"Component0",CarInfo[idx][cComponent0]);
            dini_IntSet(file,"Component1",CarInfo[idx][cComponent1]);
            dini_IntSet(file,"Component2",CarInfo[idx][cComponent2]);
            dini_IntSet(file,"Component3",CarInfo[idx][cComponent3]);
            dini_IntSet(file,"Component4",CarInfo[idx][cComponent4]);
            dini_IntSet(file,"Component5",CarInfo[idx][cComponent5]);
            dini_IntSet(file,"Component6",CarInfo[idx][cComponent6]);
            dini_IntSet(file,"Component7",CarInfo[idx][cComponent7]);
            dini_IntSet(file,"Component8",CarInfo[idx][cComponent8]);
            dini_IntSet(file,"Component9",CarInfo[idx][cComponent9]);
            dini_IntSet(file,"Component10",CarInfo[idx][cComponent10]);
            dini_IntSet(file,"Component11",CarInfo[idx][cComponent11]);
            dini_IntSet(file,"Component12",CarInfo[idx][cComponent12]);
            dini_IntSet(file,"Component13",CarInfo[idx][cComponent13]);
            dini_IntSet(file,"SecurityCode",CarInfo[idx][cCode]);
        }
    }
    return 1;
}
Reply
#4

Hmm okay. I suspected that your OnPropUpdate had a timer delay or something, but I couldn't see anything.

I think the problem is just that it takes 4-5 seconds for your code to process, either that, or something in your OnPlayerUpdateEx function is causing the wait. Please provide that part of your code too.
Reply
#5

pawn Код:
public OnPlayerUpdateEx(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 1)
        {
            new string3[64];
            new playername3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername3, sizeof(playername3));
            format(string3, sizeof(string3), "LARP/Users/%s.ini", playername3);
           
            dini_IntSet(string3, "Password",PlayerInfo[playerid][pKey]);
            dini_IntSet(string3, "Level",PlayerInfo[playerid][pLevel]);
            dini_IntSet(string3, "Spawn",PlayerInfo[playerid][pSpawn]);
            dini_IntSet(string3, "TesterLevel",PlayerInfo[playerid][pTester]);
            dini_IntSet(string3, "HelperLevel",PlayerInfo[playerid][pHelper]);
            dini_IntSet(string3, "AdminLevel",PlayerInfo[playerid][pAdmin]);
            dini_IntSet(string3, "RegularRank",PlayerInfo[playerid][pRegularRank]);
            dini_IntSet(string3, "UpgradePoints",PlayerInfo[playerid][gPupgrade]);
            dini_IntSet(string3, "ConnectedTime",PlayerInfo[playerid][pConnectSeconds]);
            dini_IntSet(string3, "Registered",PlayerInfo[playerid][pReg]);
            dini_IntSet(string3, "Sex",PlayerInfo[playerid][pSex]);
            dini_IntSet(string3, "Age",PlayerInfo[playerid][pAge]);
            dini_IntSet(string3, "GPS",PlayerInfo[playerid][pGPS]);
            dini_IntSet(string3, "Origin",PlayerInfo[playerid][pOrigin]);
            dini_IntSet(string3, "CK",PlayerInfo[playerid][pCK]);
            dini_IntSet(string3, "Muted",PlayerInfo[playerid][pMuted]);
            dini_IntSet(string3, "Frozen",PlayerInfo[playerid][pFrozen]);
            dini_IntSet(string3, "Blind",PlayerInfo[playerid][pBlind]);
            dini_IntSet(string3, "Respect",PlayerInfo[playerid][pExp]);
            dini_IntSet(string3, "Money",PlayerInfo[playerid][pCash]);
            PlayerInfo[playerid][pCash] = ScriptMoney[playerid];
            dini_IntSet(string3, "Bank",PlayerInfo[playerid][pAccount]);
            dini_IntSet(string3, "Crimes",PlayerInfo[playerid][pCrimes]);
            dini_Set(string3, "CrimeReason",PlayerInfo[playerid][pCrimeReason]);
            dini_IntSet(string3, "Wanted",PlayerInfo[playerid][pWanted]);
            dini_IntSet(string3, "WantedLevel",PlayerInfo[playerid][pWantedLevel]);
            dini_IntSet(string3, "Kills",PlayerInfo[playerid][pKills]);
            dini_IntSet(string3, "Deaths",PlayerInfo[playerid][pDeaths]);
            dini_IntSet(string3, "Arrested",PlayerInfo[playerid][pArrested]);
            dini_IntSet(string3, "WantedDeaths",PlayerInfo[playerid][pWantedDeaths]);
            dini_IntSet(string3, "Phonebook",PlayerInfo[playerid][pPhoneBook]);
            dini_IntSet(string3, "LottoNr",PlayerInfo[playerid][pLottoNr]);
            dini_IntSet(string3, "Fishes",PlayerInfo[playerid][pFishes]);
            dini_IntSet(string3, "BiggestFish",PlayerInfo[playerid][pBiggestFish]);
            dini_IntSet(string3, "Job",PlayerInfo[playerid][pJob]);
            dini_IntSet(string3, "Paycheck",PlayerInfo[playerid][pPayCheck]);
            dini_IntSet(string3, "HeadValue",PlayerInfo[playerid][pHeadValue]);
            dini_IntSet(string3, "Jailed",PlayerInfo[playerid][pJailed]);
            dini_IntSet(string3, "JailTime",PlayerInfo[playerid][pJailTime]);
            dini_IntSet(string3, "CanRobTime",PlayerInfo[playerid][pRobTime]);
            dini_IntSet(string3, "Materials",PlayerInfo[playerid][pMats]);
            dini_IntSet(string3, "Drugs",PlayerInfo[playerid][pDrugs]);
            dini_IntSet(string3, "Leader",PlayerInfo[playerid][pLeader]);
            dini_IntSet(string3, "Member",PlayerInfo[playerid][pMember]);
            dini_IntSet(string3, "FMember",PlayerInfo[playerid][pFMember]);
            dini_IntSet(string3, "Rank",PlayerInfo[playerid][pRank]);
            dini_IntSet(string3, "Char",PlayerInfo[playerid][pChar]);
            dini_IntSet(string3, "ContractTime",PlayerInfo[playerid][pContractTime]);
            dini_IntSet(string3, "DetSkill",PlayerInfo[playerid][pDetSkill]);
            dini_IntSet(string3, "SexSkill",PlayerInfo[playerid][pSexSkill]);
            dini_IntSet(string3, "BoxSkill",PlayerInfo[playerid][pBoxSkill]);
            dini_IntSet(string3, "LawSkill",PlayerInfo[playerid][pLawSkill]);
            dini_IntSet(string3, "MechSkill",PlayerInfo[playerid][pMechSkill]);
            dini_IntSet(string3, "JackSkill",PlayerInfo[playerid][pJackSkill]);
            dini_IntSet(string3, "CarSkill",PlayerInfo[playerid][pCarSkill]);
            dini_IntSet(string3, "NewsSkill",PlayerInfo[playerid][pNewsSkill]);
            dini_IntSet(string3, "DrugsSkill",PlayerInfo[playerid][pDrugsSkill]);
            dini_IntSet(string3, "CookSkill",PlayerInfo[playerid][pCookSkill]);
            dini_IntSet(string3, "FishSkill",PlayerInfo[playerid][pFishSkill]);
            dini_FloatSet(string3, "pHealth",PlayerInfo[playerid][pHealth]);
            dini_FloatSet(string3, "pArmour",PlayerInfo[playerid][pArmour]);
            dini_IntSet(string3, "Int",PlayerInfo[playerid][pInt]);
            dini_IntSet(string3, "InteriorNr",PlayerInfo[playerid][pInteriorNr]);
            dini_IntSet(string3, "Local",PlayerInfo[playerid][pLocal]);
            dini_IntSet(string3, "Team",PlayerInfo[playerid][pTeam]);
            dini_IntSet(string3, "Model",PlayerInfo[playerid][pModel]);
            dini_IntSet(string3, "PhoneNr",PlayerInfo[playerid][pPnumber]);
            dini_IntSet(string3, "Car",PlayerInfo[playerid][pPcarkey]);
            dini_IntSet(string3, "Car2",PlayerInfo[playerid][pPcarkey2]);
            dini_IntSet(string3, "House",PlayerInfo[playerid][pPhousekey]);
            dini_IntSet(string3, "Bizz",PlayerInfo[playerid][pPbiskey]);
            dini_FloatSet(string3, "Pos_x",PlayerInfo[playerid][pPos_x]);
            dini_FloatSet(string3, "Pos_y",PlayerInfo[playerid][pPos_y]);
            dini_FloatSet(string3, "Pos_z",PlayerInfo[playerid][pPos_z]);
            dini_IntSet(string3, "Passport",PlayerInfo[playerid][pPassport]);
            dini_IntSet(string3, "CarLic",PlayerInfo[playerid][pCarLic]);
            dini_IntSet(string3, "FlyLic",PlayerInfo[playerid][pFlyLic]);
            dini_IntSet(string3, "BoatLic",PlayerInfo[playerid][pBoatLic]);
            dini_IntSet(string3, "FishLic",PlayerInfo[playerid][pFishLic]);
            dini_IntSet(string3, "GunLic",PlayerInfo[playerid][pGunLic]);
            dini_IntSet(string3, "CopLic",PlayerInfo[playerid][pCopLic]);
            dini_IntSet(string3, "CarTime",PlayerInfo[playerid][pCarTime]);
            dini_IntSet(string3, "PayDay",PlayerInfo[playerid][pPayDay]);
            dini_IntSet(string3, "PayDayHad",PlayerInfo[playerid][pPayDayHad]);
            dini_IntSet(string3, "Watch",PlayerInfo[playerid][pWatch]);
            dini_IntSet(string3, "Crashed",PlayerInfo[playerid][pCrashed]);
            dini_IntSet(string3, "Wins",PlayerInfo[playerid][pWins]);
            dini_IntSet(string3, "Loses",PlayerInfo[playerid][pLoses]);
            dini_IntSet(string3, "AlcoholPerk",PlayerInfo[playerid][pAlcoholPerk]);
            dini_IntSet(string3, "DrugPerk",PlayerInfo[playerid][pDrugPerk]);
            dini_IntSet(string3, "MiserPerk",PlayerInfo[playerid][pMiserPerk]);
            dini_IntSet(string3, "PainPerk",PlayerInfo[playerid][pPainPerk]);
            dini_IntSet(string3, "TraderPerk",PlayerInfo[playerid][pTraderPerk]);
            dini_IntSet(string3, "Tutorial",PlayerInfo[playerid][pTut]);
            dini_IntSet(string3, "VirWorld",PlayerInfo[playerid][pVirWorld]);
            dini_IntSet(string3, "Fuel",PlayerInfo[playerid][pFuel]);
            dini_IntSet(string3, "Married",PlayerInfo[playerid][pMarried]);
            dini_Set(string3, "MarriedTo",PlayerInfo[playerid][pMarriedTo]);
            dini_IntSet(string3, "FishTool",PlayerInfo[playerid][pFishTool]);
            dini_Set(string3, "WhyLeft",PlayerInfo[playerid][pWhyLeft]);
            dini_Set(string3, "Note1",PlayerInfo[playerid][pNote1]);
            dini_IntSet(string3, "Note1s",PlayerInfo[playerid][pNote1s]);
            dini_Set(string3, "Note2",PlayerInfo[playerid][pNote2]);
            dini_IntSet(string3, "Note2s",PlayerInfo[playerid][pNote2s]);
            dini_Set(string3, "Note3",PlayerInfo[playerid][pNote3]);
            dini_IntSet(string3, "Note3s",PlayerInfo[playerid][pNote3s]);
            dini_Set(string3, "Note4",PlayerInfo[playerid][pNote4]);
            dini_IntSet(string3, "Note4s",PlayerInfo[playerid][pNote4s]);
            dini_Set(string3, "Note5",PlayerInfo[playerid][pNote5]);
            dini_IntSet(string3, "Note5s",PlayerInfo[playerid][pNote5s]);
            dini_IntSet(string3, "InvWeapon",PlayerInfo[playerid][pInvWeapon]);
            dini_IntSet(string3, "InvAmmo",PlayerInfo[playerid][pInvAmmo]);
            dini_IntSet(string3, "InvWeapon2",PlayerInfo[playerid][pInvWeapon2]);
            dini_IntSet(string3, "InvAmmo2",PlayerInfo[playerid][pInvAmmo2]);
            dini_IntSet(string3, "InvWeapon3",PlayerInfo[playerid][pInvWeapon3]);
            dini_IntSet(string3, "InvAmmo3",PlayerInfo[playerid][pInvAmmo3]);
            dini_IntSet(string3, "InvWeapon4",PlayerInfo[playerid][pInvWeapon4]);
            dini_IntSet(string3, "InvAmmo4",PlayerInfo[playerid][pInvAmmo4]);
            dini_IntSet(string3, "InvWeapon5",PlayerInfo[playerid][pInvWeapon5]);
            dini_IntSet(string3, "InvAmmo5",PlayerInfo[playerid][pInvAmmo5]);
            dini_IntSet(string3, "InvWeapon6",PlayerInfo[playerid][pInvWeapon6]);
            dini_IntSet(string3, "InvAmmo6",PlayerInfo[playerid][pInvAmmo6]);
            dini_IntSet(string3, "Lighter",PlayerInfo[playerid][pLighter]);
            dini_IntSet(string3, "Cigarettes",PlayerInfo[playerid][pCigarettes]);
            dini_IntSet(string3, "DDManager",PlayerInfo[playerid][pDM]);
            dini_IntSet(string3, "OnDuty",PlayerInfo[playerid][pDuty]);
            dini_IntSet(string3, "Warnings",PlayerInfo[playerid][pWarned]);
            dini_IntSet(string3, "Swat",PlayerInfo[playerid][pSwat]);
            dini_IntSet(string3, "Fighting",PlayerInfo[playerid][pFS]);
            dini_IntSet(string3, "Boxing",PlayerInfo[playerid][pBoxiSkill]);
            dini_IntSet(string3, "KneeHead",PlayerInfo[playerid][pKneeSkill]);
            dini_IntSet(string3, "KungFu",PlayerInfo[playerid][pKungSkill]);
            dini_IntSet(string3, "GrabKick",PlayerInfo[playerid][pGrabSkill]);
            dini_IntSet(string3, "Elbow",PlayerInfo[playerid][pElbowSkill]);
            dini_IntSet(string3, "Tactical",PlayerInfo[playerid][pTactical]);
            dini_IntSet(string3, "SpecialF",PlayerInfo[playerid][pSpecialF]);
            dini_IntSet(string3, "DutyBanned",PlayerInfo[playerid][pDBanned]);
            dini_IntSet(string3, "DDTicket",PlayerInfo[playerid][pDTK]);
            dini_IntSet(string3, "DDSTicket",PlayerInfo[playerid][pDSTK]);
            dini_IntSet(string3, "Speedo",PlayerInfo[playerid][pSpeedo]);
            dini_IntSet(string3, "Mask",PlayerInfo[playerid][pMask]);
            dini_IntSet(string3, "HydraDriver",PlayerInfo[playerid][pHydraR]);
            dini_IntSet(string3, "HunterDriver",PlayerInfo[playerid][pHunterR]);
            dini_IntSet(string3, "RhinoDriver",PlayerInfo[playerid][pRhinoR]);
            dini_IntSet(string3, "PredatorDriver",PlayerInfo[playerid][pPredR]);
            dini_IntSet(string3, "ViewPms",PlayerInfo[playerid][pViewPms]);
            dini_IntSet(string3, "AppearList",PlayerInfo[playerid][pAppearList]);
            dini_IntSet(string3, "AmmunationTime",PlayerInfo[playerid][pAmmuTrainTime]);
            dini_IntSet(string3, "PistolSkill",PlayerInfo[playerid][pPistSkill]);
            dini_IntSet(string3, "SilencedSkill",PlayerInfo[playerid][pSilenSkill]);
            dini_IntSet(string3, "DesertSkill",PlayerInfo[playerid][pDesertSkill]);
            dini_IntSet(string3, "ShotgunSkill",PlayerInfo[playerid][pShotgSkill]);
            dini_IntSet(string3, "SawnoffSkill",PlayerInfo[playerid][pSawnSkill]);
            dini_IntSet(string3, "CombatSkill",PlayerInfo[playerid][pCombSkill]);
            dini_IntSet(string3, "UziSkill",PlayerInfo[playerid][pUziSkill]);
            dini_IntSet(string3, "SMGSkill",PlayerInfo[playerid][pSmgSkill]);
            dini_IntSet(string3, "AK47Skill",PlayerInfo[playerid][pAkSkill]);
            dini_IntSet(string3, "M4Skill",PlayerInfo[playerid][pM4Skill]);
            dini_IntSet(string3, "TutorialDone",PlayerInfo[playerid][pTutDone]);
            dini_IntSet(string3, "RegularCount",PlayerInfo[playerid][pRegularCount]);
            dini_IntSet(string3, "PassportTime",PlayerInfo[playerid][pPassportTime]);
            dini_IntSet(string3, "OfficerTime",PlayerInfo[playerid][pOfficerTime]);
            dini_IntSet(string3, "Achievement0",PlayerInfo[playerid][pAchievement0]);
            dini_IntSet(string3, "Achievement1",PlayerInfo[playerid][pAchievement1]);
            dini_IntSet(string3, "Achievement2",PlayerInfo[playerid][pAchievement2]);
            dini_IntSet(string3, "Achievement3",PlayerInfo[playerid][pAchievement3]);
            dini_IntSet(string3, "Achievement4",PlayerInfo[playerid][pAchievement4]);
            dini_IntSet(string3, "Achievement5",PlayerInfo[playerid][pAchievement5]);
            dini_IntSet(string3, "Achievement6",PlayerInfo[playerid][pAchievement6]);
            dini_IntSet(string3, "Achievement7",PlayerInfo[playerid][pAchievement7]);
            dini_IntSet(string3, "Achievement8",PlayerInfo[playerid][pAchievement8]);
            dini_IntSet(string3, "Achievement9",PlayerInfo[playerid][pAchievement9]);
            dini_IntSet(string3, "Achievement10",PlayerInfo[playerid][pAchievement10]);
            dini_IntSet(string3, "Achievement11",PlayerInfo[playerid][pAchievement11]);
            dini_IntSet(string3, "Achievement12",PlayerInfo[playerid][pAchievement12]);
            dini_IntSet(string3, "Achievement13",PlayerInfo[playerid][pAchievement13]);
            dini_IntSet(string3, "Achievement14",PlayerInfo[playerid][pAchievement14]);
            dini_IntSet(string3, "Achievement15",PlayerInfo[playerid][pAchievement15]);
            dini_IntSet(string3, "Achievement16",PlayerInfo[playerid][pAchievement16]);
            dini_IntSet(string3, "Achievement17",PlayerInfo[playerid][pAchievement17]);
            dini_IntSet(string3, "Achievement18",PlayerInfo[playerid][pAchievement18]);
            dini_IntSet(string3, "Achievement19",PlayerInfo[playerid][pAchievement19]);
            dini_IntSet(string3, "Achievement20",PlayerInfo[playerid][pAchievement20]);
            dini_IntSet(string3, "ShiftName",PlayerInfo[playerid][pShiftName]);
            dini_IntSet(string3, "Weapon",PlayerInfo[playerid][pWeapon]);
            dini_IntSet(string3, "Ammo",PlayerInfo[playerid][pAmmo]);
            dini_IntSet(string3, "Weapon2",PlayerInfo[playerid][pWeapon2]);
            dini_IntSet(string3, "Ammo2",PlayerInfo[playerid][pAmmo2]);
            dini_IntSet(string3, "Weapon3",PlayerInfo[playerid][pWeapon3]);
            dini_IntSet(string3, "Ammo3",PlayerInfo[playerid][pAmmo3]);
            dini_IntSet(string3, "Weapon4",PlayerInfo[playerid][pWeapon4]);
            dini_IntSet(string3, "Ammo4",PlayerInfo[playerid][pAmmo4]);
            dini_IntSet(string3, "Weapon5",PlayerInfo[playerid][pWeapon5]);
            dini_IntSet(string3, "Ammo5",PlayerInfo[playerid][pAmmo5]);
            dini_IntSet(string3, "Weapon6",PlayerInfo[playerid][pWeapon6]);
            dini_IntSet(string3, "Ammo6",PlayerInfo[playerid][pAmmo6]);
            dini_IntSet(string3, "Weapon7",PlayerInfo[playerid][pWeapon7]);
            dini_IntSet(string3, "Ammo7",PlayerInfo[playerid][pAmmo7]);
            dini_IntSet(string3, "Weapon8",PlayerInfo[playerid][pWeapon8]);
            dini_IntSet(string3, "Ammo8",PlayerInfo[playerid][pAmmo8]);
            dini_IntSet(string3, "Weapon9",PlayerInfo[playerid][pWeapon9]);
            dini_IntSet(string3, "Ammo9",PlayerInfo[playerid][pAmmo9]);
            dini_IntSet(string3, "Weapon10",PlayerInfo[playerid][pWeapon10]);
            dini_IntSet(string3, "Ammo10",PlayerInfo[playerid][pAmmo10]);
            dini_IntSet(string3, "Weapon11",PlayerInfo[playerid][pWeapon11]);
            dini_IntSet(string3, "Ammo11",PlayerInfo[playerid][pAmmo11]);
            dini_IntSet(string3, "Weapon12",PlayerInfo[playerid][pWeapon12]);
            dini_IntSet(string3, "Ammo12",PlayerInfo[playerid][pAmmo12]);
            dini_IntSet(string3, "Atc",PlayerInfo[playerid][pAtc]);
            dini_IntSet(string3, "AtcRadio",PlayerInfo[playerid][pAtcRadio]);
            dini_IntSet(string3, "Pending",PlayerInfo[playerid][pPending]);
            dini_Set(string3, "PendingInfo",PlayerInfo[playerid][pPendingInfo]);
            dini_IntSet(string3, "ChatMode",PlayerInfo[playerid][pChatMode]);
            dini_Set(string3, "Punishment1",PlayerInfo[playerid][pPunishment1]);
            dini_Set(string3, "Punishment2",PlayerInfo[playerid][pPunishment2]);
            dini_Set(string3, "Punishment3",PlayerInfo[playerid][pPunishment3]);
            dini_Set(string3, "Punishment4",PlayerInfo[playerid][pPunishment4]);
            dini_Set(string3, "Punishment5",PlayerInfo[playerid][pPunishment5]);
            dini_Set(string3, "Punishment6",PlayerInfo[playerid][pPunishment6]);
            dini_Set(string3, "Punishment7",PlayerInfo[playerid][pPunishment7]);
            dini_Set(string3, "Punishment8",PlayerInfo[playerid][pPunishment8]);
            dini_IntSet(string3, "NextPunishment",PlayerInfo[playerid][pNextPunishment]);
            dini_IntSet(string3, "PunishedTimes",PlayerInfo[playerid][pPunished]);
            dini_IntSet(string3, "TazerBullets",PlayerInfo[playerid][pTazerBullets]);
            dini_Set(string3, "IP",PlayerInfo[playerid][pIP]);
            dini_Set(string3, "LastLogged",PlayerInfo[playerid][pLastSeen]);
            dini_IntSet(string3, "Changed",PlayerInfo[playerid][pChanged]);
            dini_Set(string3, "RegistredDate",PlayerInfo[playerid][pRegistredDate]);
            dini_IntSet(string3, "BizzEntered",BizzEntered[playerid]);
            dini_IntSet(string3, "HouseEntered",HouseEntered[playerid]);
            dini_IntSet(string3, "Decoder",PlayerInfo[playerid][pDecoder]);
            dini_IntSet(string3, "Banned",PlayerInfo[playerid][pBanned]);
        }
    }
    return 1;
}
Reply
#6

I recommend using tickcount() to debug the time spent on both the command and the two functions.

In case you don't know how, start off by making a variable on top of the /vpark command (directly below your opening brace { ), call it something like 'ticks', and assign it to "tickcount()"
pawn Код:
new ticks = tickcount();
Then at the bottom of your command (directly above return 1 put
pawn Код:
ticks = tickcount() - ticks;
, then lastly underneath that line print the variable by doing
pawn Код:
print(ticks);
This will then print in the console how many milliseconds it took to execute the command.

You can then do the same with OnPlayerUpdateEx and OnPropUpdate, just adjust the print a bit to these three:
pawn Код:
printf("%i - command", ticks);
printf("%i - onpropupdate", ticks);
printf("%i - onplayerupdateex", ticks);
Edit: I took the time to do your dirty work for you:
http://pastebin.com/EqjnPLDD
http://pastebin.com/P763TAih
http://pastebin.com/ERiwBSNr

Just replace your code with the one I provided then start the server and try the command. Post results from server.log in here
Reply
#7

pawn Код:
OnPropUpdate(4,carid);
          OnPlayerUpdateEx(playerid);
Reason why it's delaying, it's saving two times
Reply
#8

Use a timer instead of saving player data under OnPlayerUpdate. It makes slower if you use OnPlayerUpdate for saving stats.
Reply
#9

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Use a timer instead of saving player data under OnPlayerUpdate. It makes slower if you use OnPlayerUpdate for saving stats.
He's using a custom fucnction called OnPlayerUpdateEx, not the callback OnPlayerUpdate.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)