Array out of bounds
#1

Hey.

log:

Quote:

[11:26:02] [debug] AMX backtrace:
[11:26:02] [debug] #0 000895d4 in public SecondTimer () from asd.amx
[11:26:02] [debug] Run time error 4: "Array index out of bounds"
[11:26:02] [debug] Attempted to read/write array element at negative index -1

"SecondTimer()"

PHP код:
forward SecondTimer();
public 
SecondTimer()
{
    new 
hourminuteboomboxidstring[128];
    
gettime(hourminute);
    if((
gGMX) && mysql_unprocessed_queries(connectionID) == 0)
    {
        
SendRconCommand("gmx");
    }
    foreach(new 
Player)
    {
          
SetPlayerTime(ihourminute);
        if(
PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked])
        {
              
AFKCheck(i);
            
//NOPCheck(i);
            
if(PlayerInfo[i][pSpamTime] > 0)
            {
                
PlayerInfo[i][pSpamTime]--;
            }
            if(
PlayerInfo[i][pVehicleCount] > 0)
            {
                
PlayerInfo[i][pVehicleCount]--;
            }
            if(
PlayerInfo[i][pMechanicCall] > 0)
            {
                
PlayerInfo[i][pMechanicCall]--;
            }
            if(
PlayerInfo[i][pTaxiCall] > 0)
            {
                
PlayerInfo[i][pTaxiCall]--;
            }
            if(
PlayerInfo[i][pEmergencyCall] > 0)
            {
                
PlayerInfo[i][pEmergencyCall]--;
            }
            if(
PlayerInfo[i][pCourierCooldown] > 0)
            {
                
PlayerInfo[i][pCourierCooldown]--;
            }
               if(
PlayerInfo[i][pPizzaCooldown] > 0)
            {
                   
PlayerInfo[i][pPizzaCooldown]--;
            }
            if(
PlayerInfo[i][pDetectiveCooldown] > 0)
            {
                   
PlayerInfo[i][pDetectiveCooldown]--;
            }
            if(
PlayerInfo[i][pThiefCooldown] > 0)
            {
                   
PlayerInfo[i][pThiefCooldown]--;
            }
            if(
PlayerInfo[i][pCocaineCooldown] > 0)
            {
                   
PlayerInfo[i][pCocaineCooldown]--;
            }
            if(
PlayerInfo[i][pACFired] > 0)
            {
                
PlayerInfo[i][pACFired]--;
            }
            if(
PlayerInfo[i][pRapidFire] > 0)
            {
                
PlayerInfo[i][pRapidFire]--;
            }
            if(
PlayerInfo[i][pGodmode] > 0)
            {
                
PlayerInfo[i][pGodmode]--;
            }
            if(
PlayerInfo[i][pPreviewHouse] >= 0)
            {
                
PlayerInfo[i][pPreviewTime]--;
                if(
PlayerInfo[i][pPreviewTime] <= && GetPlayerInterior(i) == houseInteriors[PlayerInfo[i][pPreviewType]][intID])
                {
                    
SetPlayerPos(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hIntX], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntY], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntZ]);
                    
SetPlayerFacingAngle(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hIntA]);
                    
SetPlayerInterior(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hInterior]);
                    
SetPlayerVirtualWorld(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hWorld]);
                    
SetCameraBehindPlayer(i);
                    
PlayerInfo[i][pPreviewHouse] = -1;
                    
PlayerInfo[i][pPreviewType] = 0;
                    
PlayerInfo[i][pPreviewTime] = 0;
                    
SendClientMessage(iCOLOR_WHITE"You are no longer previewing the interior as the time period ran out.");
                }
            }
            if(
PlayerInfo[i][pLoopAnim] && !PlayerInfo[i][pToggleTextdraws]) {
                
TextDrawShowForPlayer(iAnimationTD);
            } else {
                
TextDrawHideForPlayer(iAnimationTD);
            }
            if(
GetPlayerSurfingVehicleID(i) != INVALID_PLAYER_ID && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !IsSurfVehicle(GetPlayerSurfingVehicleID(i)) && !PlayerInfo[i][pAdminDuty] && GetVehicleSpeed(GetPlayerSurfingVehicleID(i)) > 40)
            {
                new
                    
Float:x,
                    
Float:y,
                    
Float:z;
                
SendProximityMessage(i20.0COLOR_PURPLE"** %s slipped off the top of the vehicle."GetPlayerRPName(i));
                
GetPlayerPos(ixyz);
                
SetPlayerPos(i1y3.0);
                
ApplyAnimation(i"PED""BIKE_fallR"4.101100);
            }
            if(
PlayerInfo[i][pShipment] >= 0)
            {
                if((
GetPlayerState(i) == PLAYER_STATE_DRIVER) && (GetVehicleModel(GetPlayerVehicleID(i)) != 414 && GetVehicleModel(GetPlayerVehicleID(i)) != 498))
                {
                    
PlayerInfo[i][pShipment] = -1;
                    
SendClientMessage(iCOLOR_GREY"Shipment cancelled. You went into another vehicle.");
                }
            }
            if(
GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_BEER || GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_WINE)
            {
                if(
GetPlayerDrunkLevel(i) > 7000)
                {
                    
Awardh(i"Party hard");
                }
            }
            if(
GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                if(
IsNearSpeedCam(i) && PlayerInfo[i][pSpeedTicketAllowed] == 0)
                {
                    new 
speedcamID Speed_Nearest(i);
                    if(
GetVehicleSpeed(GetPlayerVehicleID(i)) > SpeedData[speedcamID][speedLimit] )
                    {
                        
SendClientMessage(iCOLOR_AQUA"**You have been spotted by a speed camera, You have been issued a fine of 1500$");
                        
AddToTaxVault(1500);
                        
GivePlayerCash(i, -1500);
                        
PlayerInfo[i][pSpeedTicketAllowed] = 1;
                    }
                }
            }        
            if(
PlayerInfo[i][pPizzas] > && GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                if(
GetVehicleModel(GetPlayerVehicleID(i)) == 448)
                {
                    if(
PlayerInfo[i][pPizzaTime] < 90)
                    {
                        
PlayerInfo[i][pPizzaTime]++;
                    }
                }
                else
                {
                    
PlayerInfo[i][pPizzas] = 0;
                    
PlayerInfo[i][pCP] = 0;
                    
DisablePlayerCheckpoint(i);
                    
SendClientMessage(iCOLOR_GREY"Pizza delivery cancelled. You went into another vehicle.");
                }
            }
            else if (
PlayerInfo[i][pGraffiti] != -&& PlayerInfo[i][pGraffitiTime] > 0)
            {
                if (
Graffiti_Nearest(i) != PlayerInfo[i][pGraffiti])
                {
                    
PlayerInfo[i][pGraffiti] = -1;
                    
PlayerInfo[i][pGraffitiTime] = 0;
                }
                else
                {
                    
PlayerInfo[i][pGraffitiTime]--;
                    if (
PlayerInfo[i][pGraffitiTime] < 1)
                    {
                        new 
str[500];
                        
strunpack(strPlayerInfo[i][pGraffitiText]);
                        
format(GraffitiData[PlayerInfo[i][pGraffiti]][graffitiText], 64str);
                        
GraffitiData[PlayerInfo[i][pGraffiti]][graffitiColor] = PlayerInfo[i][pGraffitiColor];
                        
Graffiti_Refresh(PlayerInfo[i][pGraffiti]);
                        
Graffiti_Save(PlayerInfo[i][pGraffiti]);
                        
ClearAnimations(i1);
                        
SendProximityMessage(i30.0COLOR_PURPLE"** %s puts their can of spray paint away."GetPlayerRPName(i));
                           
PlayerInfo[i][pGraffiti] = -1;
                           
PlayerInfo[i][pGraffitiTime] = 0;
                    }
                }
            }
            if(!
PlayerInfo[i][pToggleTextdraws])
            {
                if(
PlayerInfo[i][pGPSOn])
                {
                    
PlayerTextDrawSetString(iPlayerInfo[i][pText][0], GetPlayerZoneName(i));
                }
            }
            
/*if(NetStats_PacketLossPercent(i) > 20.0 && gettime() - PlayerInfo[i][pLastDesync] > 120)
            {
                GameTextForPlayer(i, "You are desynced. Please relog once you see this message.", 10000, 6);
                PlayerInfo[i][pLastDesync] = gettime();
            }*/
            
if(PlayerInfo[i][pSpectating] != INVALID_PLAYER_ID)
            {
                if(
GetPlayerInterior(i) != GetPlayerInterior(PlayerInfo[i][pSpectating])) SetPlayerInterior(iGetPlayerInterior(PlayerInfo[i][pSpectating]));
                if(
GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(PlayerInfo[i][pSpectating])) SetPlayerVirtualWorld(iGetPlayerVirtualWorld(PlayerInfo[i][pSpectating]));
            }
            if(
PlayerInfo[i][pTutorial])
            {
                
TogglePlayerControllable(i0);
            }
            if(
PlayerInfo[i][pAwaitingClothing])
            {
                
SetPlayerClothing(i);
            }
            if(
PlayerInfo[i][pDraggedBy] != INVALID_PLAYER_ID)
            {
                
TeleportToPlayer(iPlayerInfo[i][pDraggedBy]);
            }
            if(
PlayerInfo[i][pVIPPackage] > && gettime() > PlayerInfo[i][pVIPTime])
            {
                
PlayerInfo[i][pVIPPackage] = 0;
                
PlayerInfo[i][pVIPTime] = 0;
                
//PlayerInfo[i][pSecondJob] = -1;
                
mysql_format(connectionIDqueryBuffersizeof(queryBuffer), "UPDATE users SET vippackage = 0, viptime = 0, secondjob = -1 WHERE uid = %i"PlayerInfo[i][pID]);
                
mysql_tquery(connectionIDqueryBuffer);
                
SendClientMessage(iCOLOR_LIGHTRED"Your VIP subscription has expired. You are no longer a VIP.");
            }
            if(
PlayerInfo[i][pVIPPackage] < && PlayerInfo[i][pSecondJob] != JOB_NONE)
            {
                
mysql_format(connectionIDqueryBuffersizeof(queryBuffer), "UPDATE users SET secondjob = -1 WHERE uid = %i"PlayerInfo[i][pID]);
                
mysql_tquery(connectionIDqueryBuffer);
                
PlayerInfo[i][pSecondJob] = JOB_NONE;
                
SendClientMessage(iCOLOR_LIGHTRED"Your second job has been removed as you aren't a Gold+ VIP.");
            }
            if(
PlayerInfo[i][pHHCheck])
            {
                if(
PlayerInfo[i][pHHTime] > 0)
                {
                    new 
health GetPlayerHealthEx(i);
                    if(
health == PlayerInfo[i][pHHRounded])
                    {
                        
PlayerInfo[i][pHHCount]++;
                    }
                    
SetPlayerHealth(irandom(100) + 1);
                    
PlayerInfo[i][pHHTime]--;
                    
PlayerInfo[i][pHHRounded] = health;
                }
                else
                {
                    if(
gettime() - PlayerInfo[i][pLastUpdate] >= 3)
                    {
                        
SendAdminMessage(COLOR_YELLOW"AdmWarning: %s[%i] failed the health hack check as they tabbed."GetPlayerRPName(i), i);
                    }
                    else if(
PlayerInfo[i][pHHCount] > 0)
                    {
                        
SendAdminMessage(COLOR_YELLOW"AdmWarning: %s[%i] is possibly health hacking with a %i percent chance."GetPlayerRPName(i), iPlayerInfo[i][pHHCount] * 20);
                    }
                    else
                    {
                        
SendAdminMessage(COLOR_YELLOW"AdmWarning: %s[%i] does not appear to be health hacking."GetPlayerRPName(i), i);
                    }
                    if(
NetStats_PacketLossPercent(i) > 10.0)
                    {
                        
SendAdminMessage(COLOR_YELLOW"AdmWarning: %s[%i] is desynced and has a packet loss of %.1f percent."GetPlayerRPName(i), iNetStats_PacketLossPercent(i));
                    }
                    
SetPlayerHealth(iPlayerInfo[i][pHealth]);
                    
PlayerInfo[i][pHHCheck] = 0;
                }
            }
            if(
PlayerInfo[i][pReceivingAid] && !PlayerInfo[i][pHHCheck])
            {
                new
                    
Float:health;
                
GetPlayerHealth(ihealth);
                if((
health 1.0) > 100.0)
                {
                    
SetPlayerHealth(i100.0);
                    
PlayerInfo[i][pReceivingAid] = 0;
                }
                else
                {
                    
SetPlayerHealth(ihealth 1.0);
                }
            }
            if(
PlayerInfo[i][pInjured] && IsPlayerInAnyVehicle(i) && GetVehicleModel(GetPlayerVehicleID(i)) != 416)
            {
                new
                    
Float:x,
                    
Float:y,
                    
Float:z;
                
GetPlayerPos(ixyz);
                
SetPlayerPos(ixy0.5);
                
ClearAnimations(i);
            }
            if(
PlayerInfo[i][pTazedTime] > 0)
            {
                
PlayerInfo[i][pTazedTime]--;
                if(!
PlayerInfo[i][pTazedTime])
                {
                    
ClearAnimations(i1);
                    if(!
PlayerInfo[i][pCuffed])
                    {
                        
TogglePlayerControllable(i1);
                    }
                }
            }
            if(
PlayerInfo[i][pFishTime] > 0)
            {
                
PlayerInfo[i][pFishTime]--;
                if(!
IsPlayerAtFishingPlace(i))
                {
                    
ClearAnimations(i1);
                    
RemovePlayerAttachedObject(i9);
                    
PlayerInfo[i][pFishTime] = 0;
                }
                else if(
PlayerInfo[i][pFishTime] <= && IsPlayerAtFishingPlace(i))
                {
                      new 
rand Random(1100);
                    if(
<= rand <= 20)
                    {
                            
SendClientMessage(iCOLOR_GREY"You reeled in your line and caught nothing...");
                    }
                    else if(
21 <= rand <= 30)
                    {
                        new 
amount 50 random(100);
                        
SendClientMessageEx(iCOLOR_AQUA"You reeled in your line and caught a used wallet with {00AA00}$%i{33CCFF} inside."amount);
                        
GivePlayerCash(iamount);
                    }
                    else if(
98 <= rand <= 99)
                    {
                        new 
amount random(2000) + 1000;
                        
SendClientMessageEx(iCOLOR_AQUA"You reeled in your line and caught a rare 18th century coin valued at {00AA00}$%i{33CCFF}!"amount);
                        
GivePlayerCash(iamount);
                    }
                    else
                    {
                        new 
weightlevel GetJobLevel(iJOB_FISHERMAN);
                        if(
PlayerInfo[i][pUsedBait]) {
                            
weight random(40) + (level 10);
                        } else {
                            
weight random(15) + (level 10);
                        }
                        
SendClientMessageEx(iCOLOR_AQUA"You reeled in your line and caught a fish weighing %i kg!"weight);
                        
PlayerInfo[i][pFishWeight] += weight;
                        
mysql_format(connectionIDqueryBuffersizeof(queryBuffer), "UPDATE users SET fishweight = %i WHERE uid = %i"PlayerInfo[i][pFishWeight], PlayerInfo[i][pID]);
                        
mysql_tquery(connectionIDqueryBuffer);
                        
IncreaseJobSkill(iJOB_FISHERMAN);
                        if(
PlayerInfo[i][pFishWeight] >= 1500)
                        {
                            
SendClientMessage(iCOLOR_YELLOW"You have too much fish. You can continue fishing once you sell your load.");
                        }
                    }
                    
ClearAnimations(i1);
                    
RemovePlayerAttachedObject(i9);
                }
            }
            if(
PlayerInfo[i][pJailType] > 0)
            {
                
PlayerInfo[i][pJailTime]--;
                if(
PlayerInfo[i][pJailTime] <= 0)
                {
                    
ResetPlayerWeaponsEx(i);
                    
SendClientMessage(iCOLOR_GREY2"Your jail sentence has expired.");
                    
SetPlayerPos(i1544.4407, -1675.552213.5584);
                    
SetPlayerFacingAngle(i90.0000);
                    
SetPlayerInterior(i0);
                    
SetPlayerVirtualWorld(i0);
                    
SetCameraBehindPlayer(i);
                    
PlayerInfo[i][pJailType] = 0;
                    
PlayerInfo[i][pJailTime] = 0;
                }
            }
            if(
PlayerInfo[i][pEditType] > && IsValidDynamicObject(PlayerInfo[i][pEditObject]) && !IsPlayerInRangeOfDynamicObject(iPlayerInfo[i][pEditObject], 50.0))
            {
                if(
PlayerInfo[i][pEditType] == EDIT_FURNITURE_PREVIEW)
                {
                       
SendClientMessage(iCOLOR_GREY2"You left the editing area. Furniture previewing cancelled.");
                       
DestroyDynamicObject(PlayerInfo[i][pEditObject]);
                }
                else if(
PlayerInfo[i][pEditType] == EDIT_FURNITURE)
                {
                       
ReloadFurniture(PlayerInfo[i][pEditObject], HouseInfo[PlayerInfo[i][pFurnitureHouse]][hLabels]);
                       
SendClientMessage(iCOLOR_GREY2"You left the editing area. Editing mode has been disabled.");
                }
                else if(
PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT)
                {
                       
ReloadLandObject(PlayerInfo[i][pEditObject], LandInfo[PlayerInfo[i][pObjectLand]][lLabels]);
                       
SendClientMessage(iCOLOR_GREY2"You left the editing area. Editing mode has been disabled.");
                }
                else if(
PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT_PREVIEW)
                {
                       
SendClientMessage(iCOLOR_GREY2"You left the editing area. Furniture previewing cancelled.");
                       
DestroyDynamicObject(PlayerInfo[i][pEditObject]);
                }
                
CancelEdit(i);
                
PlayerInfo[i][pEditType] = 0;
                   
PlayerInfo[i][pEditObject] = INVALID_OBJECT_ID;
            }
            if(
PlayerInfo[i][pHospital] && PlayerInfo[i][pHospitalTime])
            {
                
PlayerInfo[i][pHospitalTime]--;
                if(
PlayerInfo[i][pHospitalTime] == 0)
                {
                    if(
PlayerInfo[i][pInsurance] > 0)
                    {
                        
Awardh(i"Obamacare");
                    }
                    
SetPlayerPos(i, -10.4534149.3639999.0613);
                    
SetPlayerFacingAngle(i180.0000);
                    
SetPlayerInterior(i1);
                    
SetPlayerVirtualWorld(iPlayerInfo[i][pHospitalType]);
                    
SetCameraBehindPlayer(i);
                    if(!(
GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC))
                    {
                        
GivePlayerCash(i, -500);
                        
GameTextForPlayer(i"~w~Discharged~n~~r~-$500"50001);
                    }
                    
TogglePlayerControllable(i1);
                    
SetPlayerDrunkLevel(i0);
                    if(
PlayerInfo[i][pDelivered])
                    {
                        if(
GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC)
                            
SendClientMessage(iCOLOR_DOCTOR"You have not been billed for your stay. You also keep all of your weapons!");
                        else
                            
SendClientMessage(iCOLOR_DOCTOR"You have been billed $500 for your stay. You also keep all of your weapons!");
                        
PlayerInfo[i][pDelivered] = 0;
                    }
                    else
                    {
                        if(
GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC)
                            
SendClientMessage(iCOLOR_DOCTOR"You have not been billed for your stay. Your weapons have been confiscated by staff.");
                        else
                            
SendClientMessage(iCOLOR_DOCTOR"You have been billed $500 for your stay. Your weapons have been confiscated by staff.");
                        
SendClientMessage(iCOLOR_LIGHTRED"(( You have lost 30 minutes of your memory. ))");
                    }
                    new 
hospital[32];
                    switch(
PlayerInfo[i][pHospitalType])
                    {
                        case 
HOSPITAL_COUNTYstrcat(hospital"All Saints General");
                        case 
HOSPITAL_ALLSAINTSstrcat(hospital"County General");
                        case 
HOSPITAL_FMDHQstrcat(hospital"FMD HQ");
                    }
                    foreach(new 
Player)
                    {
                        if(
IsLawEnforcement(x))
                        {
                            
SendClientMessageEx(xCOLOR_YELLOW"LSFMD: Wanted suspect %s[%i] was last spotted at the %s hospital!"GetPlayerRPName(i), ihospital);
                        }
                    }
                    
SetPlayerHealth(iPlayerInfo[i][pSpawnHealth]);
                    
SetScriptArmour(iPlayerInfo[i][pSpawnArmor]);
                    
PlayerInfo[i][pHospital] = 0;
                    
PlayerInfo[i][pHospitalTime] = 0;
                }
                else
                {
                    
GameTextForPlayer(i"~w~Recovering..."15003);
                    
SetPlayerDrunkLevel(i50000);
                }
            }
            if(
PlayerInfo[i][pRefuel] != INVALID_VEHICLE_ID)
            {
                
PlayerInfo[i][pRefuelAmount] += 2;
                
vehicleFuel[PlayerInfo[i][pRefuel]]++;
                if(
vehicleFuel[PlayerInfo[i][pRefuel]] >= 100 || PlayerInfo[i][pCash] < PlayerInfo[i][pRefuelAmount])
                {
                    
AddPointMoney(POINT_FUELPlayerInfo[i][pRefuelAmount]);
                    
GivePlayerCash(i, -PlayerInfo[i][pRefuelAmount]);
                    
SendClientMessageEx(iCOLOR_AQUA"You've refilled your vehicle's gas tank for {FF6347}$%i{33CCFF}."PlayerInfo[i][pRefuelAmount]);
                    
PlayerInfo[i][pRefuel] = INVALID_VEHICLE_ID;
                    
PlayerInfo[i][pRefuelAmount] = 0;
                }
            }
            if(
PlayerInfo[i][pMiningTime] > 0)
            {
                
PlayerInfo[i][pMiningTime]--;
                if(
PlayerInfo[i][pMiningTime] <= 0)
                {
                    if(
IsPlayerInMiningArea(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !PlayerInfo[i][pTazedTime] && !PlayerInfo[i][pCuffed])
                    {
                        new 
number random(10) + 1;
                        
PlayerInfo[i][pCP] = CHECKPOINT_MINING;
                        
SetPlayerAttachedObject(i9392910.2429990.3240000.012000, -17.20007820.6999939.8000340.5799990.6179990.676999);
                        
SetPlayerSpecialAction(iSPECIAL_ACTION_CARRY);
                        
ApplyAnimation(i"CARRY""liftup"4.1000001);
                        
SetPlayerCheckpoint(i1278.0778, -1267.966112.54132.0);
                        if(
<= number <= 5)
                        {
                            
PlayerInfo[i][pMiningRock] = 1;
                            
SendClientMessage(iCOLOR_AQUA"You have dug up an ordinary stone. Drop it off at the marker.");
                        }
                        else if(
number == && !PlayerInfo[i][pRareTime])
                        {
                            
SendClientMessage(iCOLOR_AQUA"Woah, this looks oddly weird to find in the middle of a city, lets show it to the boss.");
                            
PlayerInfo[i][pMiningRock] = 3;
                        }
                        else
                        {
                            
PlayerInfo[i][pMiningRock] = 2;
                            
SendClientMessage(iCOLOR_AQUA"You have dug up a quality stone. Drop it off at the marker.");
                        }
                    }
                    else
                    {
                        
RemovePlayerAttachedObject(i9);
                        
ClearAnimations(i1);
                    }
                }
            }
            if(
PlayerInfo[i][pSweeping] && GetVehicleModel(GetPlayerVehicleID(i)) == 574 && GetVehicleSpeed(GetPlayerVehicleID(i)) > 35.0 && !PlayerInfo[i][pAFK])
            {
                
PlayerInfo[i][pSweepTime]--;
                if(
PlayerInfo[i][pSweepTime] <= 0)
                {
                    new 
cost 200 random(50);
                    if(
PlayerInfo[i][pLaborUpgrade] > 0)
                    {
                        
cost += percent(costPlayerInfo[i][pLaborUpgrade]);
                    }
                    
AddToPaycheck(icost);
                    
format(stringsizeof(string), "~g~+$%i"cost);
                    
GameTextForPlayer(istring50001);
                    
PlayerInfo[i][pSweepEarnings] += cost;
                    
PlayerInfo[i][pSweepTime] = 30;
                }
            }
            if(
PlayerInfo[i][pTaxiPassenger] != INVALID_PLAYER_ID)
            {
                if((
GetVehicleModel(GetPlayerVehicleID(i)) != 420 && GetVehicleModel(GetPlayerVehicleID(i)) != 438) || !IsPlayerInVehicle(PlayerInfo[i][pTaxiPassenger], GetPlayerVehicleID(i)) || PlayerInfo[i][pTaxiFare] == || PlayerInfo[PlayerInfo[i][pTaxiPassenger]][pCash] < PlayerInfo[i][pTaxiBill])
                {
                    
CancelTaxiRide(i);
                }
                else
                {
                    
PlayerInfo[i][pTaxiTime]++;
                    if(
PlayerInfo[i][pTaxiTime] >= 15)
                    {
                        
PlayerInfo[i][pTaxiTime] = 0;
                        
PlayerInfo[i][pTaxiBill] += PlayerInfo[i][pTaxiFare];
                    }
                    
format(stringsizeof(string), "~n~~n~~n~~n~~n~~n~~n~~g~Taxi Meter:~w~ $%i"PlayerInfo[i][pTaxiBill]);
                    
GameTextForPlayer(istring30003);
                }
            }
            if(
PlayerInfo[i][pMuted] > 0)
            {
                
PlayerInfo[i][pMuted]--;
                if(
PlayerInfo[i][pMuted] <= 0)
                {
                    
SendClientMessage(iCOLOR_GREY"You are no longer muted.");
                }
            }
            if(
PlayerInfo[i][pCocaineTrunk] != INVALID_VEHICLE_ID)
            {
                if(!
IsPlayerInRangeOfBoot(iPlayerInfo[i][pCocaineTrunk]))
                {
                    
SendClientMessage(iCOLOR_GREY"You are no longer cracking the trunk as you left your spot.");
                    
PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                }
                else if(
VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vLocked])
                {
                    
SendClientMessage(iCOLOR_GREY"You are no longer cracking the trunk as the vehicle is now locked.");
                    
PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                }
                else
                {
                    
PlayerInfo[i][pCocaineTime]--;
                    if(
PlayerInfo[i][pCocaineTime] <= 0)
                    {
                        new 
count;
                        for(new 
05++)
                        {
                            if(
VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeapons][x] != 0)
                            {
                                
count++;
                            }
                        }
                        if(
count == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCocaine] == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMeth] == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeed] == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vPainkillers] == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMaterials] == && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCash] == 0)
                        {
                            
SendProximityMessage(i20.0COLOR_PURPLE"** %s cracks open the trunk of the %s and finds nothing."GetPlayerRPName(i), GetVehicleName(PlayerInfo[i][pCocaineTrunk]));
                        }
                        else
                        {
                            
PlayerInfo[i][pCocaineFrom] = PlayerInfo[i][pCocaineTrunk];
                            
ShowDialogToPlayer(iDIALOG_CRACKTRUNK);
                        }
                        switch(
GetJobLevel(iJOB_THIEF))
                        {
                            case 
1PlayerInfo[i][pCocaineCooldown] = 720;
                            case 
2PlayerInfo[i][pCocaineCooldown] = 600;
                            case 
3PlayerInfo[i][pCocaineCooldown] = 420;
                            case 
4PlayerInfo[i][pCocaineCooldown] = 300;
                            case 
5PlayerInfo[i][pCocaineCooldown] = 180;
                        }
                        
IncreaseJobSkill(iJOB_THIEF);
                        
PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                    }
                    else
                    {
                        
format(stringsizeof(string), "~w~Cracking trunk... ~r~%i"PlayerInfo[i][pCocaineTime]);
                        
GameTextForPlayer(istring20003);
                    }
                }
            }
            if(
PlayerInfo[i][pLootTime] > 0)
            {
                
PlayerInfo[i][pLootTime]--;
                if(
IsPlayerInBankRobbery(i) && PlayerInfo[i][pLootTime] <= 0)
                {
                    new 
amount random(500) + 500;
                    
ClearAnimations(i1);
                    
PlayerInfo[i][pRobCash] += amount;
                    
PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY;
                    
PlayerInfo[i][pLastLoad] = gettime();
                    
format(stringsizeof(string), "~g~+$%i"amount);
                    
GameTextForPlayer(istring50001);
                    
SendClientMessageEx(iCOLOR_AQUA"You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF}."amountPlayerInfo[i][pRobCash]);
                    
SetPlayerCheckpoint(i1429.99391066.95819.89383.0);
                }
                else if((
PlayerInfo[i][pRobbingBiz] >= && PlayerInfo[i][pRobbingBiz] == GetInsideBusiness(i)) && PlayerInfo[i][pLootTime] <= 0)
                {
                    new 
amount random(300) + 100;
                    
ClearAnimations(i1);
                    
PlayerInfo[i][pRobCash] += amount;
                    
PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY;
                    
PlayerInfo[i][pLastLoad] = gettime();
                    
format(stringsizeof(string), "~g~+$%i"amount);
                    
GameTextForPlayer(istring50001);
                    
SendClientMessageEx(iCOLOR_AQUA"You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF} (/stoprobbery)."amountPlayerInfo[i][pRobCash]);
                    
SetPlayerCheckpoint(i1429.99391066.95819.89383.0);
                    if(
PlayerInfo[i][pRobCash] < 10000)
                    {
                        
ApplyAnimation(i"BOMBER""BOM_Plant_Loop"4.1100001);
                        
GameTextForPlayer(i"~w~Looting business vault..."50003);
                        
PlayerInfo[i][pLootTime] = 5;
                    }
                    else
                    {
                        
callcmd::stoprobbery(i"/1");
                    }
                }
            }
            if(
PlayerInfo[i][pHunted] > 0)
            {
                foreach(new 
Player)
                {
                    if(
PlayerInfo[x][pLogged] && GetPlayerInterior(x) == GetPlayerInterior(i) && PlayerInfo[i][pHunted] > 0)
                    {
                        
SetPlayerMarkerForPlayer(xiCOLOR_RETIRED);
                    }
                }
            }
            if(
PlayerInfo[i][pFindTime] > 0)
            {
                
PlayerInfo[i][pFindTime]--;
                if(
PlayerInfo[i][pFindTime] == 0)
                {
                    
SetPlayerMarkerForPlayer(iPlayerInfo[i][pFindPlayer], GetPlayerColor(PlayerInfo[i][pFindPlayer]));
                    
PlayerInfo[i][pFindPlayer] = INVALID_PLAYER_ID;
                }
            }
            if((
PlayerInfo[i][pToggleMusic]) || (PlayerInfo[i][pBoomboxListen] != INVALID_PLAYER_ID && GetNearbyBoombox(i) != PlayerInfo[i][pBoomboxListen]))
            {
                
PlayerInfo[i][pBoomboxListen] = INVALID_PLAYER_ID;
                if(
PlayerInfo[i][pStreamType] == MUSIC_BOOMBOX)
                {
                    
StopAudioStreamForPlayer(i);
                    
PlayerInfo[i][pStreamType] = MUSIC_NONE;
                }
            }
            if((!
PlayerInfo[i][pToggleMusic]) && ((boomboxid GetNearbyBoombox(i)) != INVALID_PLAYER_ID && PlayerInfo[i][pBoomboxListen] != boomboxid))
            {
                
PlayerInfo[i][pBoomboxListen] = boomboxid;
                if(
PlayerInfo[i][pStreamType] == MUSIC_NONE)
                {
                    
PlayAudioStreamForPlayer(iPlayerInfo[boomboxid][pBoomboxURL]);
                    
PlayerInfo[i][pStreamType] = MUSIC_BOOMBOX;
                }
            }
            if(
PlayerInfo[i][pPickPlant] != INVALID_PLAYER_ID)
            {
                
PlayerInfo[i][pPickTime]--;
                if(
PlayerInfo[i][pPickTime] <= 0)
                {
                    new 
planterid PlayerInfo[i][pPickPlant];
                    if(!
IsPlayerConnected(planterid) || !PlayerInfo[planterid][pLogged] || !PlayerInfo[planterid][pWeedPlanted])
                    {
                        
SendClientMessage(iCOLOR_GREY"This plant is no longer available to pick.");
                    }
                    else if(!
IsPlayerInRangeOfPoint(i3.0PlayerInfo[planterid][pWeedX], PlayerInfo[planterid][pWeedY], PlayerInfo[planterid][pWeedZ]))
                    {
                        
SendClientMessage(iCOLOR_GREY"Picking failed. You left the area of the plant.");
                    }
                    else if(
GetPlayerSpecialAction(i) != SPECIAL_ACTION_DUCK)
                    {
                        
SendClientMessage(iCOLOR_GREY"Picking failed. You must stay crouched when picking a plant.");
                    }
                    else
                    {
                        
PlayerInfo[i][pWeed] += PlayerInfo[planterid][pWeedGrams];
                        
mysql_format(connectionIDqueryBuffersizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i"PlayerInfo[i][pWeed], PlayerInfo[i][pID]);
                        
mysql_tquery(connectionIDqueryBuffer);
                        
SendClientMessageEx(iCOLOR_AQUA"You have harvested %i grams of weed from this plant."PlayerInfo[planterid][pWeedGrams]);
                        
DestroyWeedPlant(planterid);
                    }
                    
PlayerInfo[i][pPickPlant] = INVALID_PLAYER_ID;
                    
PlayerInfo[i][pPickTime] = 0;
                }
            }
            if(
PlayerInfo[i][pCookMeth] > 0)
            {
                
PlayerInfo[i][pCookTime]--;
                if(
PlayerInfo[i][pCookTime] <= 0)
                {
                    if(!
IsPlayerInRangeOfPoint(i5.01.21792.8095999.4284))
                    {
                        
SendClientMessage(iCOLOR_GREY"Cooking failed. You have left the cooking spot.");
                        
ResetCooking(i);
                    }
                    else if(
PlayerInfo[i][pEphedrine] <= 0)
                    {
                        
SendClientMessage(iCOLOR_GREY"Cooking failed. You have ran out of ephedrine.");
                        
ResetCooking(i);
                    }
                    else if(
PlayerInfo[i][pMeth] + GetPlayerCapacity(iCAPACITY_METH))
                    {
                        
SendClientMessage(iCOLOR_GREY"Cooking failed. You have ran out of inventory space for meth.");
                        
ResetCooking(i);
                    }
                    else
                    {
                        
GameTextForPlayer(i"~g~+2~w~ grams of meth"30003);
                        
PlayerInfo[i][pEphedrine] -= 1;
                        
PlayerInfo[i][pMeth] += 2;
                        
PlayerInfo[i][pCookGrams] += 2;
                        if((
PlayerInfo[i][pCookGrams] % 4) == 0)
                        {
                            
PlayerInfo[i][pMuriaticAcid]--;
                        }
                        
mysql_format(connectionIDqueryBuffersizeof(queryBuffer), "UPDATE users SET ephedrine = %i, meth = %i, muriaticacid = %i WHERE uid = %i"PlayerInfo[i][pEphedrine], PlayerInfo[i][pMeth], PlayerInfo[i][pMuriaticAcid], PlayerInfo[i][pID]);
                        
mysql_tquery(connectionIDqueryBuffer);
                        if(!
PlayerInfo[i][pEphedrine])
                        {
                            
SendClientMessageEx(iCOLOR_LIGHTRED"You ran out of ephedrine therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine."PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            
ResetCooking(i);
                        }
                        else if(!
PlayerInfo[i][pMuriaticAcid])
                        {
                            
SendClientMessageEx(iCOLOR_LIGHTRED"You ran out of muriatic acid therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine."PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            
ResetCooking(i);
                        }
                        else if(
PlayerInfo[i][pMeth] >= GetPlayerCapacity(iCAPACITY_METH))
                        {
                            
SendClientMessageEx(iCOLOR_LIGHTRED"You ran out of inventory space for meth therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine."PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            
ResetCooking(i);
                        }
                        else
                        {
                            
PlayerInfo[i][pCookTime] = 15;
                        }
                    }
                }
            }
            if(
PlayerInfo[i][pDrugsUsed] >= 4)
            {
                
PlayerInfo[i][pDrugsTime]--;
                if(
PlayerInfo[i][pDrugsTime] <= 0)
                {
                    
SendClientMessage(iCOLOR_GREY"You are no longer stoned.");
                    
SetPlayerWeather(igWeather);
                    
SetPlayerTime(igWorldTime0);
                    
SetPlayerDrunkLevel(i500);
                    
PlayerInfo[i][pDrugsUsed] = 0;
                    
PlayerInfo[i][pDrugsTime] = 0;
                }
                else
                {
                    
SetPlayerWeather(i, -66);
                    
SetPlayerTime(i120);
                    
SetPlayerDrunkLevel(i40000);
                }
            }
            if(
PlayerInfo[i][pCapturingPoint] >= 0)
            {
                
PlayerInfo[i][pCaptureTime]--;
                if(
PlayerInfo[i][pCaptureTime] <= 0)
                {
                    new 
Float:xFloat:yFloat:z;
                    
GetPlayerPos(ixyz);
                    if(
PointInfo[PlayerInfo[i][pCapturingPoint]][pTime] == && PlayerInfo[i][pPointX] == && PlayerInfo[i][pPointY] == && PlayerInfo[i][pPointZ] == z)
                    {
                        
SendClientMessageToAllEx(COLOR_YELLOW"Point wars: %s attempted to capture %s for %s. It will be theirs in 15 minutes."GetPlayerRPName(i), PointInfo[PlayerInfo[i][pCapturingPoint]][pName], GangInfo[PlayerInfo[i][pGang]][gName]);
                        
PointInfo[PlayerInfo[i][pCapturingPoint]][pCaptureTime] = 15;
                        
PointInfo[PlayerInfo[i][pCapturingPoint]][pCapturer] = i;
                    }
                    else
                    {
                        
SendClientMessage(iCOLOR_GREY"You moved from your position and therefore failed to capture.");
                    }
                    
PlayerInfo[i][pCapturingPoint] = -1;
                    
PlayerInfo[i][pCaptureTime] = 0;
                }
            }
            if(
PlayerInfo[i][pPoisonTime] > 0)
            {
                new
                    
Float:health;
                
GetPlayerHealth(ihealth);
                
SetPlayerHealth(ihealth 3.0 1.0 1.0 health 3.0);
                
PlayerInfo[i][pPoisonTime]--;
            }
            
AnticheatCheck(i);
            
//GetPlayerHealth(i, PlayerInfo[i][pHealth]);
            
if(PlayerInfo[i][pGang] >= && !PlayerInfo[i][pBandana])
            {
                new 
id;
                if((
id GetNearbyTurf(i)) >= && TurfInfo[id][tTime] == && TurfInfo[id][tCapturer] != INVALID_PLAYER_ID)
                {
                    if(
PlayerInfo[i][pTagType] == TAG_VIP)
                    {
                        
SetPlayerSpecialTag(iTAG_NONE);
                        
SendClientMessage(iCOLOR_YELLOW"Your VIP tag was automatically disabled as you've entered an active turf area.");
                    }
                    
PlayerInfo[i][pBandana] = 1;
                    
SendClientMessage(iCOLOR_WHITE"Your bandana was enabled automatically as you entered a turf in an active war.");
                    
SetPlayerColor(iGangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff);
                }
                if((
id GetNearbyPoint(i30.0)) >= && PointInfo[id][pTime] == && PointInfo[id][pCapturer] != INVALID_PLAYER_ID)
                {
                       if(
PlayerInfo[i][pTagType] == TAG_VIP)
                    {
                        
SetPlayerSpecialTag(iTAG_NONE);
                        
SendClientMessage(iCOLOR_YELLOW"Your VIP tag was automatically disabled as you've entered an active point area.");
                    }
                    
PlayerInfo[i][pBandana] = 1;
                    
SendClientMessage(iCOLOR_WHITE"Your bandana was enabled automatically as you are in range of an active point.");
                }
            }
            if(!
PlayerInfo[i][pBackup] && !IsPlayerBeingFound(i))
            {
                
// Yeah, this is indeed a mess. But it works. Cleaning this section is on my list.
                
if(PlayerInfo[i][pJoinedEvent] && EventInfo[eType] == 2) {
                    
SetPlayerColor(i, (PlayerInfo[i][pEventTeam] == RED_TEAM) ? (0xFF000000) : (0x0000FF00));
                } else if(
PlayerInfo[i][pPaintball] == 2) {
                    
SetPlayerColor(i, (PlayerInfo[i][pPaintballTeam] == 1) ? (0x33CCFF00) : (0xFFFF9900));
                } else if(
PlayerInfo[i][pJailType] == 2) {
                    
SetPlayerColor(i0xAD7A2100);
                } else if(
PlayerInfo[i][pFaction] >= && PlayerInfo[i][pDuty] && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN) {
                    
SetPlayerColor(iFactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff);
                
//} else if(PlayerInfo[i][pFaction] >= 0 && PlayerInfo[i][pDuty] == 0 && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_POLICE && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_MEDIC) {
                    //SetPlayerColor(i, FactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff);
                
} else if(PlayerInfo[i][pGang] >= && PlayerInfo[i][pBandana]) {
                    
SetPlayerColor(iGangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff);
                } else if(
PlayerHasJob(iJOB_TAXIDRIVER) && PlayerInfo[i][pTaxiFare] > 0) {
                    
SetPlayerColor(i0xF5DEB300);
                } else if(
PlayerInfo[i][pVIPPackage] > && PlayerInfo[i][pVIPColor]) {
                    
SetPlayerColor(i0xFF00FF00);
                
//} else if(PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdminDuty]) {
                    //SetPlayerColor(i, 0xAA333300); // 0xFFD70000
                
} else {
                    
SetPlayerColor(i0xFFFFFF00);
                }
            }
        }
    }
    for(new 
0MAX_ACTORS++)
    {
        if(
IsValidActor(i))
        {
            new
                
Float:x,
                
Float:y,
                
Float:z;
            
GetActorPos(ixyz);
            
SetActorPos(ixyz);
        }
    }
    
format(stringsizeof(string), "Raw ephedrine\nStock: %i\nPrice: $1,000/gram\n/buydrug ephedrine [amount]"gEphedrineStock);
    
UpdateDynamic3DTextLabelText(gEphedrineStockTextCOLOR_YELLOWstring);
    
format(stringsizeof(string), "Marijuana seeds\nStock: %i\nPrice: $500/seed\n/buydrug seeds [amount]"gSeedsStock);
    
UpdateDynamic3DTextLabelText(gSeedsStockTextCOLOR_YELLOWstring);
    
format(stringsizeof(string), "Cocaine\nStock: %i\nPrice: $750/gram\n/buydrug cocaine [amount]"gCocaineStock);
    
UpdateDynamic3DTextLabelText(gCocaineTextCOLOR_YELLOWstring);
    if(
Iter_Count(Player) > gPlayerRecord)
    {
        
gPlayerRecord Iter_Count(Player);
        
gRecordDate GetDate();
        
SaveServerInfo();
    }

Also there is a bug in this function which is used under "SecondTimer" but when i commented it , no effects took place.

PHP код:
AFKCheck(playerid)
{
    new
        
Float:x,
        
Float:y,
        
Float:z,
        
Float:cx,
        
Float:cy,
        
Float:cz;
    
GetPlayerPos(playeridxyz);
    
GetPlayerCameraPos(playeridcxcycz);
    if(
PlayerInfo[playerid][pAFKPos][0] == && PlayerInfo[playerid][pAFKPos][1] == && PlayerInfo[playerid][pAFKPos][2] == && PlayerInfo[playerid][pAFKPos][3] == cx && PlayerInfo[playerid][pAFKPos][4] == cy && PlayerInfo[playerid][pAFKPos][5] == cz)
    {
        
PlayerInfo[playerid][pAFKTime]++;
        if(!
PlayerInfo[playerid][pAFK] && PlayerInfo[playerid][pAFKTime] >= 60)
        {
            
SendClientMessage(playeridCOLOR_LIGHTORANGE"** You are now marked as {00AA00}Away from keyboard{F7A763} as you haven't moved in one minute.");
            
//SendClientMessage(i, COLOR_LIGHTRED, "SERVER: You have been marked as AFK as you haven't moved in one minute.");
            
PlayerInfo[playerid][pAFK] = 1;
        }
    }
    else
    {
        if(
PlayerInfo[playerid][pAFK])
        {
            if(
PlayerInfo[playerid][pAFKTime] < 120) {
                
//SendClientMessageEx(i, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i seconds.", PlayerInfo[playerid][pAFKTime]);
                
SendClientMessageEx(playeridCOLOR_LIGHTRED"SERVER: You are no longer marked as AFK after %i seconds."PlayerInfo[playerid][pAFKTime]);
            } else if(
PlayerInfo[playerid][pAFKTime] >= 120) {
                
//SendClientMessageEx(i, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i minutes.", PlayerInfo[playerid][pAFKTime] / 60);
                
SendClientMessageEx(playeridCOLOR_LIGHTRED"SERVER: You are no longer marked as AFK after %i minutes."PlayerInfo[playerid][pAFKTime] / 60);
            }
            
PlayerInfo[playerid][pAFK] = 0;
        }
        
PlayerInfo[playerid][pAFKTime] = 0;
    }
    
PlayerInfo[playerid][pAFKPos][0] = x;
    
PlayerInfo[playerid][pAFKPos][1] = y;
    
PlayerInfo[playerid][pAFKPos][2] = z;
    
PlayerInfo[playerid][pAFKPos][3] = cx;
    
PlayerInfo[playerid][pAFKPos][4] = cy;
    
PlayerInfo[playerid][pAFKPos][5] = cz;

It is supposed to add 1 value to the "AFKTime" each second, but IDK why doesn't it do that.
Reply
#2

Bump
Reply
#3

Try using debug level 3, so it shows you the exact lines that produce the crash.
If you don't know how to do that, here's how:
You should create a file called pawn.cfg in your pawno folder, inside this file write:

PHP код:
-d3 
Save the file and recompile your script and run it with crashdetect again.

And then show us the exact line that caused the crash. It should be a for loop most of the time.
Reply
#4

Someone really needs to write a tutorial about array out of bounds issues. This is such a common probably and is pretty easy to solve and if you can't solve it easily then there is a bigger problem. Scripting help is for asking questions by people who know how to script. Editing someone else's script then wondering why you are having problems shouldn't warrant a help request.
Reply
#5

That's a long copy paste there..
Reply
#6

Quote:
Originally Posted by DarkSkull
Посмотреть сообщение
Try using debug level 3, so it shows you the exact lines that produce the crash.
If you don't know how to do that, here's how:
You should create a file called pawn.cfg in your pawno folder, inside this file write:

PHP код:
-d3 
Save the file and recompile your script and run it with crashdetect again.

And then show us the exact line that caused the crash. It should be a for loop most of the time.
Okay I'm on it.

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Someone really needs to write a tutorial about array out of bounds issues. This is such a common probably and is pretty easy to solve and if you can't solve it easily then there is a bigger problem. Scripting help is for asking questions by people who know how to script. Editing someone else's script then wondering why you are having problems shouldn't warrant a help request.
I didn't even take the chance of editing it, I used it as a try to test the systems etc.. before editing and these stuff, I can usually fix the array out of bounds error, but I can't even find where is the array in this function..

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
That's a long copy paste there..
Sorry for it..
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
I'm not surprised! That function is vast! Split it up in to lots of little functions and have the main function call all the other ones (or use lots of timers). If your function is over 50 lines long you really need to question it and see if it can't be broken up further.
Ohh, that made me understand the point, So arrays aren't defined in small functions, but it can be defined as global right? I'm sorry but I'm new with arrays..
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
No. Arrays are fine in functions. My point was your function is too long.
Ohh, Okay, now I get it.. Do you have any solution of my current problem? much things are disappearing name of the player sometimes, money value and level and age in stats, as if it's not loaded, I got also some errors in mysql_log but no idea about the place of the bug..

Quote:

[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('8')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[15:58:21] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('9')
[15:58:21] [ERROR] cache_get_field_content_int - invalid datatype
[17:11:15] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('1')
[17:11:15] [ERROR] cache_get_field_content_int - invalid datatype

Dunno if they caused it or not, however the server logs are fine, no single warning or error, even the compiling is good, I'm lost..
Reply
#9

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Someone really needs to write a tutorial about array out of bounds issues. This is such a common probably and is pretty easy to solve and if you can't solve it easily then there is a bigger problem. Scripting help is for asking questions by people who know how to script. Editing someone else's script then wondering why you are having problems shouldn't warrant a help request.
http://forum.sa-mp.com/showthread.ph...64#post4021264
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
No. As I said, your function is way too long - split it up in to small parts and it will become much simpler to debug.
The function doesn't have any problem now, the problem just appeared somewhere else as if it's a cancer..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)