SyncTime AMX backtrace
#1

My console get spammed with this:

I didn't edit anything in this so I have no idea why it gives me a backtrance


Код:
[19:56:13] [debug] Run time error 4: "Array index out of bounds"
[19:56:13] [debug]  Attempted to read/write array element at index 100 in array of size 100
[19:56:13] [debug] AMX backtrace:
[19:56:13] [debug] #0 00679570 in ?? () from inrp.amx
[19:56:13] [debug] #1 000258fc in public SyncTime () from inrp.amx
PHP код:
// Task Name: SyncTime()
// TickRate: 60 Secs
task SyncTime[60000]()
{
    
PlantTimer();
    new 
reportspriority;
    for(new 
i=0;i<MAX_REPORTS;i++) { if(Reports[i][BeingUsed] == 1reports++; if(Reports[i][ReportPriority] <= && Reports[i][BeingUsed] == 1priority++; }
    if(
reports >= 5)
    {
        
format(szMiscArray80"There are currently %d reports pending. (%d priority)"reportspriority);
         
ABroadCast(COLOR_LIGHTREDszMiscArray2);
    }
    
    for(new 
0MAX_ITEMSi++) // Moved from 1000 to 60000 check - Jingles
    
{
        if(
Price[i] != ShopItems[i][sItemPrice])
        {
            
format(szMiscArray128"Item: %d - Price: %d - Reset: %d"iShopItems[i][sItemPrice], Price[i]);
            
Log("error.log"szMiscArray);
            
ShopItems[i][sItemPrice] = Price[i];
        }
    }
    if(
zombieevent) {
        foreach(new 
iPlayer)  {
            
SaveZombieStats(i);
        }
    }
    new 
tmphourtmpminutetmpsecond;
    
gettime(tmphourtmpminutetmpsecond);
    
FixHour(tmphour);
    
tmphour shifthour;
    if ((
tmphour ghour) || (tmphour == && ghour == 23))
    {
        if(
tmphour == && ghour == 23)
        {
            
//CallLocalFunction("InactiveResourceCheck", "");
            /*
            new month, day, year;
            getdate(year,month,day);
            if(month == 4 && (day == 25 || day == 26)) // NGG B-Day 2015
            {
                foreach(Player, i)
                {
                    PlayerInfo[i][pReceivedPrize] = 0;
                }
                mysql_tquery(MainPipeline, "UPDATE `accounts` SET `ReceivedPrize` = 0", false, "OnQueryFinish", "i", SENDDATA_THREAD);
            }*/
        
}
        if(
tmphour == || tmphour == || tmphour == || tmphour == 12 || tmphour == 15 || tmphour == 18 || tmphour == 21 || tmphour == 0PrepareLotto();
        else
        {
            if(
SpecLotto) {
                
format(szMiscArraysizeof(szMiscArray), "Special Lottery: Remember to buy a lotto ticket at a 24/7. Next drawing is at %s. The total Jackpot is $%s"ConvertToTwelveHour(tmphour), number_format(Jackpot));
                
SendClientMessageToAllEx(COLOR_WHITEszMiscArray);
                
format(szMiscArraysizeof(szMiscArray), "Special Prize: %s"LottoPrize);
                
SendClientMessageToAllEx(COLOR_WHITEszMiscArray);
            }
            else {
                
format(szMiscArraysizeof(szMiscArray), "Lottery: Remember to buy a lotto ticket at a 24/7. Next drawing is at %s. The total Jackpot is $%s"ConvertToTwelveHour(tmphour), number_format(Jackpot));
                
SendClientMessageToAllEx(COLOR_WHITEszMiscArray);
            }
        }
        for(new 
iGroupIDiGroupID MAX_GROUPSiGroupID++)
        {
            
MemberCount(iGroupID);
            if(
arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_GOV && arrGroupData[iGroupID][g_iAllegiance] == 1)
            {
                
format(szMiscArraysizeof(szMiscArray), "The tax vault is at $%s"number_format(Tax));
                
GroupPayLog(iGroupIDszMiscArray);
            }
            else if(
arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_GOV && arrGroupData[iGroupID][g_iAllegiance] == 2)
            {
                
format(szMiscArraysizeof(szMiscArray), "The tax vault is at $%s"number_format(TRTax));
                
GroupPayLog(iGroupIDszMiscArray);
            }
            else
            {
                
format(szMiscArraysizeof(szMiscArray), "The faction vault is at $%s."number_format(arrGroupData[iGroupID][g_iBudget]));
                
GroupPayLog(iGroupIDszMiscArray);
            }
            if(
arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_LEA || arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_MEDIC || arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_JUDICIAL || arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_TAXI || arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_TOWING)
            {
                if(
arrGroupData[iGroupID][g_iBudgetPayment] > 0)
                {
                    if(
Tax arrGroupData[iGroupID][g_iBudgetPayment] && arrGroupData[iGroupID][g_iAllegiance] == 1)
                    {
                        
Tax -= arrGroupData[iGroupID][g_iBudgetPayment];
                        
arrGroupData[iGroupID][g_iBudget] += arrGroupData[iGroupID][g_iBudgetPayment];
                        
format(szMiscArraysizeof(szMiscArray), "SA Gov Paid $%s to %s budget fund."number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                        
GroupPayLog(iGroupIDszMiscArray);
                        
Misc_Save();
                        
SaveGroup(iGroupID);
                        for(new 
zMAX_GROUPSz++)
                        {
                            if(
arrGroupData[z][g_iAllegiance] == 1)
                            {
                                if(
arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
                                {
                                    
format(szMiscArraysizeof(szMiscArray), "SA Gov Paid $%s to %s budget fund."number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                                    
GroupPayLog(zszMiscArray);
                                    break;
                                }
                            }
                        }
                    }
                    else if(
TRTax arrGroupData[iGroupID][g_iBudgetPayment] && arrGroupData[iGroupID][g_iAllegiance] == 2)
                    {
                        
TRTax -= arrGroupData[iGroupID][g_iBudgetPayment];
                        
arrGroupData[iGroupID][g_iBudget] += arrGroupData[iGroupID][g_iBudgetPayment];
                        
format(szMiscArraysizeof(szMiscArray), "NE Gov Paid $%s to %s budget fund."number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                        
GroupPayLog(iGroupIDszMiscArray);
                        
Misc_Save();
                        
SaveGroup(iGroupID);
                        for(new 
zMAX_GROUPSz++)
                        {
                            if(
arrGroupData[z][g_iAllegiance] == 2)
                            {
                                if(
arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
                                {
                                    
format(szMiscArraysizeof(szMiscArray), "NE Gov Paid $%s to %s budget fund."number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                                    
GroupPayLog(zszMiscArray);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        
format(szMiscArraysizeof(szMiscArray), "Warning: The Government Vault has insufficient funds to fund %s."arrGroupData[iGroupID][g_szGroupName]);
                        
SendGroupMessage(GROUP_TYPE_GOVCOLOR_REDszMiscArray);
                    }
                }
                for(new 
iDvSlotID 0iDvSlotID MAX_DYNAMIC_VEHICLESiDvSlotID++)
                {
                    if(
DynVehicleInfo[iDvSlotID][gv_igID] != INVALID_GROUP_ID && DynVehicleInfo[iDvSlotID][gv_igID] == iGroupID)
                    {
                        if(
DynVehicleInfo[iDvSlotID][gv_iModel] != && (400 DynVehicleInfo[iDvSlotID][gv_iModel] < 612))
                        {
                            if(
arrGroupData[iGroupID][g_iBudget] >= DynVehicleInfo[iDvSlotID][gv_iUpkeep])
                            {
                                
arrGroupData[iGroupID][g_iBudget] -= DynVehicleInfo[iDvSlotID][gv_iUpkeep];
                                
format(szMiscArraysizeof(szMiscArray), "Vehicle ID %d (Slot ID %d) Maintainence fee cost $%s to %s's budget fund.",DynVehicleInfo[iDvSlotID][gv_iSpawnedID], iDvSlotIDnumber_format(DynVehicleInfo[iDvSlotID][gv_iUpkeep]), arrGroupData[iGroupID][g_szGroupName]);
                                
GroupPayLog(iGroupIDszMiscArray);
                            }
                            else
                            {
                                
DynVehicleInfo[iDvSlotID][gv_iDisabled] = 1;
                                
DynVeh_Save(iDvSlotID);
                                
DynVeh_Spawn(iDvSlotID);
                            }
                        }
                    }
                }
                
SaveGroup(iGroupID);
                for(new 
cratebox 0cratebox MAX_CRATEScratebox++) {
                    if(
CrateBox[cratebox][cbActive]) {
                        
SaveCrate(cratebox);
                    }
                }
                for(new 
facility 0facility MAX_CRATE_FACILITYfacility++) {
                    if(
CrateFacility[facility][cfActive]) {
                        
SyncFacility(facility);
                    }
                }
            }
        }
        
WeatherCalling += random(5) + 1;
        
#if defined zombiemode
          
if(WeatherCalling 20)
        {
              
WeatherCalling 1;
            
gWeather random(19) + 1;
            if(
gWeather == || gWeather == || gWeather == 9gWeather=1;
        }
        
#else
        
if(WeatherCalling 20)
        {
             
WeatherCalling 1;
               
gWeather random(19) + 1;
               
gWeather 1;
            if(
gWeather == || gWeather == || gWeather == 9gWeather=1;
        }
        
#endif
        
ghour tmphour;
        
TotalUptime += 1;
        
GiftAllowed 1;
        new 
bmonthbdaybyear;
        new 
yearmonthday;
        
getdate(yearmonthday);
        new 
ttTime CalculateWorldGameTime(hourminuite);
        
format(szMiscArraysizeof(szMiscArray), "The time is now %s. ((ST: %s))"ConvertToTwelveHour(ttTime), ConvertToTwelveHour(tmphour));
        
SendClientMessageToAllEx(COLOR_WHITEszMiscArray);
        new 
query[300];
        
mysql_format(MainPipelinequerysizeof(query), "SELECT b.shift, b.needs_%e, COUNT(DISTINCT s.id) as ShiftCount FROM cp_shift_blocks b LEFT JOIN cp_shifts s ON b.shift_id = s.shift_id AND s.date = '%d-%02d-%02d' AND s.status >= 2 AND s.type = 1 WHERE b.time_start = '%02d:00:00' AND b.type = 1 GROUP BY b.shift, b.needs_%e"GetWeekday(), yearmonthdaytmphourGetWeekday());
        
mysql_tquery(MainPipelinequery"GetShiftInfo""is"INVALID_PLAYER_IDszMiscArray);
        foreach(new 
iPlayer)
        {
            if(
PlayerInfo[i][pAdmin] >= 2)
            {
                if(
tmphour == 0ReportCount[i] = 0;
                
ReportHourCount[i] = 0;
            }
            if(
PlayerInfo[i][pWatchdog])
            {
                if(
tmphour == 0WDReportCount[i] = 0;
                
WDReportHourCount[i] = 0;
            }
            if(
PlayerInfo[i][pLevel] <= 5SendClientMessageEx(iCOLOR_LIGHTBLUE"Need to travel somewhere and don't have wheels? Use '/service taxi' to call a cab!");
            if(
PlayerInfo[i][pDonateRank] >= 3)
            {
                
sscanf(PlayerInfo[i][pBirthDate], "p<->iii"byearbmonthbday);
                if(
month == bmonth && day == bday)
                {
                    if(
PlayerInfo[i][pLastBirthday] >= gettime()-86400 || gettime() >= PlayerInfo[i][pLastBirthday]+28512000)
                    {
                        
SetPVarInt(i"pBirthday"1);
                        
PlayerInfo[i][pLastBirthday] = gettime();
                        
mysql_format(MainPipelinequerysizeof(query), "UPDATE `accounts` SET `LastBirthday`=%d WHERE `Username` = '%e'"PlayerInfo[i][pLastBirthday], GetPlayerNameExt(i));
                        
mysql_tquery(MainPipelinequery"OnQueryFinish""ii"SENDDATA_THREADi);
                    }
                }
                else
                {
                    
DeletePVar(i"pBirthday");
                }
                if(
GetPVarInt(i"pBirthday") == 1)
                {
                    if(
PlayerInfo[i][pReceivedBGift] != 1)
                    {
                        
PlayerInfo[i][pReceivedBGift] = 1;
                        
GiftPlayer(MAX_PLAYERSi);
                        
format(szMiscArraysizeof(szMiscArray), "Happy Birthday %s! You have received a free gift!"GetPlayerNameEx(i));
                        
SendClientMessageEx(iCOLOR_YELLOWszMiscArray);
                        
format(szMiscArraysizeof(szMiscArray), "%s(%d) has received a free gift for his birthday (%s) (Payday)."GetPlayerNameEx(i), GetPlayerSQLId(i), PlayerInfo[i][pBirthDate]);
                        
Log("logs/birthday.log"szMiscArray);
                        
SendClientMessageEx(iCOLOR_YELLOW"Gold VIP: You will get x2 paycheck as a birthday gift today.");
                        
OnPlayerStatsUpdate(i);
                    }
                }
            }
        }
        new 
iTempHour CalculateWorldGameTime(hourminuite);
        
SetWorldTime(iTempHour);
        if(
tmphour == 0CountCitizens();
        for(new 
0MAX_POINTSx++)
        {
            if(
strcmp(DynPoints[x][poName], "NULL"true) != 0) {
                if(
DynPoints[x][poTimer] > 0DynPoints[x][poTimer]--, SavePoint(x);
                if(!
DynPoints[x][poTimer] && !DynPoints[x][poCapturable] && !DynPoints[x][poLocked]) {
                    
format(szMiscArraysizeof(szMiscArray), "%s has become available for capture."DynPoints[x][poName]);
                    
SendClientMessageToAllEx(COLOR_YELLOWszMiscArray);
                    
DynPoints[x][poCapturable] = 1;
                    
SavePoint(x);
                }
                if((
<= DynPoints[x][poCaptureGroup] < MAX_GROUPS) && DynPoints[x][poAmountHour] > 0) {
                    
format(szMiscArraysizeof(szMiscArray), "Your family has recieved %s %s for owning %s."number_format(DynPoints[x][poAmountHour]), PointTypeToName(DynPoints[x][poType]), DynPoints[x][poName]);
                    foreach(new 
iPlayer)
                    {
                        if(
PlayerInfo[i][pMember] == DynPoints[x][poCaptureGroup]) {
                            
SendClientMessageEx(iCOLOR_LIGHTBLUEszMiscArray);
                        }
                    }
                    if(
DynPoints[x][poType] == 0arrGroupData[DynPoints[x][poCaptureGroup]][g_iMaterials] += DynPoints[x][poAmountHour];
                    if((
<= DynPoints[x][poType] < 5)) arrGroupData[DynPoints[x][poCaptureGroup]][g_iDrugs][DynPoints[x][poType]-1] += DynPoints[x][poAmountHour];
                }
            }
        }
        
Misc_Save();
        for(new 
0MAX_TURFSi++)
        {
            if(
TurfWars[i][twVulnerable] > 0)
            {
                
TurfWars[i][twVulnerable]--;
                if(
TurfWars[i][twVulnerable] == 0)
                {
                    if(
TurfWars[i][twOwnerId] != -1)
                    {
                        
format(szMiscArray,sizeof(szMiscArray),"%s that you currently own is vulnerable for capture!",TurfWars[i][twName]);
                        foreach(new 
xPlayer) if(PlayerInfo[x][pMember] == TurfWars[i][twOwnerId]) SendClientMessageEx(xCOLOR_YELLOWszMiscArray);
                    }
                }
            }
            if(
TurfWars[i][twOwnerId] != INVALID_GROUP_ID && TurfWars[i][twSpecial] == 2)
            {
                
arrGroupData[TurfWars[i][twOwnerId]][g_iDrugs][0] += 20;
                
arrGroupData[TurfWars[i][twOwnerId]][g_iDrugs][1] += 20;
                
arrGroupData[TurfWars[i][twOwnerId]][g_iDrugs][2] += 10;
                
arrGroupData[TurfWars[i][twOwnerId]][g_iDrugs][3] += 10;
                
arrGroupData[TurfWars[i][twOwnerId]][g_iDrugs][4] += 5;
                foreach(new 
xPlayer) if(PlayerInfo[x][pMember] == TurfWars[i][twOwnerId]) SendClientMessageEx(xCOLOR_LIGHTBLUE"Your family has recieved drugs for owning a drug turf.");
            }
        }
        
//CallRemoteFunction("ActivateRandomQuestion", "");//Olympics
        
if(tmphour == && day == 1) {
            foreach(new 
iPlayer)
            {
                if(
PlayerInfo[i][pDedicatedHours] > 0) {
                    
SendClientMessageEx(iCOLOR_YELLOW"Player Dedicated has entered a new month your hours and rank have been reset.");
                    
PlayerInfo[i][pDedicatedHours] = 0;
                    if(
PlayerInfo[i][pDedicatedPlayer] != 4PlayerInfo[i][pDedicatedPlayer] = 0;
                }
            }
            
mysql_format(MainPipelinequerysizeof(query), "UPDATE `accounts` SET `pDedicatedPlayer` = 0, `DedicatedHours` = 0 WHERE `DedicatedHours` > 0 AND `pDedicatedPlayer` != 4");
            
mysql_tquery(MainPipelinequery"OnQueryFinish""i"SENDDATA_THREAD);
        }
    }

Reply
#2

Compile your script with -d3 and reproduce the crash.
Reply
#3

Quote:
Originally Posted by iKarim
Посмотреть сообщение
Compile your script with -d3 and reproduce the crash.
Where does it show errors or crashes once compiled with -d3 ? nothing happends
Reply
#4

Anyone ?
Reply
#5

Bro create the folder that have in the public, and check the array.
Reply
#6

Quote:
Originally Posted by PowerMwK
Посмотреть сообщение
Bro create the folder that have in the public, and check the array.
create folder in where ?
Reply
#7

You must be missing the folder where the error log file exists. Create that folder and file and compile the script with -d3 tag.

If you can't do that yourself than get yourself a scripter.
Reply
#8

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
Where does it show errors or crashes once compiled with -d3 ? nothing happends
In server console ...
Reply
#9

SyncTime[60000] ?
try and use 60, 600 or 6000.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)