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 
reports, priority;
    for(new 
i=0;i<MAX_REPORTS;i++) { if(Reports[i][BeingUsed] == 1) reports++; if(Reports[i][ReportPriority] <= 2 && Reports[i][BeingUsed] == 1) priority++; }
    if(
reports >= 5)
    {
        
format(szMiscArray, 80, "There are currently %d reports pending. (%d priority)", reports, priority);
         
ABroadCast(COLOR_LIGHTRED, szMiscArray, 2);
    }
    
    for(new 
i = 0; i < MAX_ITEMS; i++) // Moved from 1000 to 60000 check - Jingles
    
{
        if(
Price[i] != ShopItems[i][sItemPrice])
        {
            
format(szMiscArray, 128, "Item: %d - Price: %d - Reset: %d", i, ShopItems[i][sItemPrice], Price[i]);
            
Log("error.log", szMiscArray);
            
ShopItems[i][sItemPrice] = Price[i];
        }
    }
    if(
zombieevent) {
        foreach(new 
i: Player)  {
            
SaveZombieStats(i);
        }
    }
    new 
tmphour, tmpminute, tmpsecond;
    
gettime(tmphour, tmpminute, tmpsecond);
    
FixHour(tmphour);
    
tmphour = shifthour;
    if ((
tmphour > ghour) || (tmphour == 0 && ghour == 23))
    {
        if(
tmphour == 0 && 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 == 3 || tmphour == 6 || tmphour == 9 || tmphour == 12 || tmphour == 15 || tmphour == 18 || tmphour == 21 || tmphour == 0) PrepareLotto();
        else
        {
            if(
SpecLotto) {
                
format(szMiscArray, sizeof(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_WHITE, szMiscArray);
                
format(szMiscArray, sizeof(szMiscArray), "Special Prize: %s", LottoPrize);
                
SendClientMessageToAllEx(COLOR_WHITE, szMiscArray);
            }
            else {
                
format(szMiscArray, sizeof(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_WHITE, szMiscArray);
            }
        }
        for(new 
iGroupID; iGroupID < MAX_GROUPS; iGroupID++)
        {
            
MemberCount(iGroupID);
            if(
arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_GOV && arrGroupData[iGroupID][g_iAllegiance] == 1)
            {
                
format(szMiscArray, sizeof(szMiscArray), "The tax vault is at $%s", number_format(Tax));
                
GroupPayLog(iGroupID, szMiscArray);
            }
            else if(
arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_GOV && arrGroupData[iGroupID][g_iAllegiance] == 2)
            {
                
format(szMiscArray, sizeof(szMiscArray), "The tax vault is at $%s", number_format(TRTax));
                
GroupPayLog(iGroupID, szMiscArray);
            }
            else
            {
                
format(szMiscArray, sizeof(szMiscArray), "The faction vault is at $%s.", number_format(arrGroupData[iGroupID][g_iBudget]));
                
GroupPayLog(iGroupID, szMiscArray);
            }
            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(szMiscArray, sizeof(szMiscArray), "SA Gov Paid $%s to %s budget fund.", number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                        
GroupPayLog(iGroupID, szMiscArray);
                        
Misc_Save();
                        
SaveGroup(iGroupID);
                        for(new 
z; z < MAX_GROUPS; z++)
                        {
                            if(
arrGroupData[z][g_iAllegiance] == 1)
                            {
                                if(
arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
                                {
                                    
format(szMiscArray, sizeof(szMiscArray), "SA Gov Paid $%s to %s budget fund.", number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                                    
GroupPayLog(z, szMiscArray);
                                    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(szMiscArray, sizeof(szMiscArray), "NE Gov Paid $%s to %s budget fund.", number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                        
GroupPayLog(iGroupID, szMiscArray);
                        
Misc_Save();
                        
SaveGroup(iGroupID);
                        for(new 
z; z < MAX_GROUPS; z++)
                        {
                            if(
arrGroupData[z][g_iAllegiance] == 2)
                            {
                                if(
arrGroupData[z][g_iGroupType] == GROUP_TYPE_GOV)
                                {
                                    
format(szMiscArray, sizeof(szMiscArray), "NE Gov Paid $%s to %s budget fund.", number_format(arrGroupData[iGroupID][g_iBudgetPayment]), arrGroupData[iGroupID][g_szGroupName]);
                                    
GroupPayLog(z, szMiscArray);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        
format(szMiscArray, sizeof(szMiscArray), "Warning: The Government Vault has insufficient funds to fund %s.", arrGroupData[iGroupID][g_szGroupName]);
                        
SendGroupMessage(GROUP_TYPE_GOV, COLOR_RED, szMiscArray);
                    }
                }
                for(new 
iDvSlotID = 0; iDvSlotID < MAX_DYNAMIC_VEHICLES; iDvSlotID++)
                {
                    if(
DynVehicleInfo[iDvSlotID][gv_igID] != INVALID_GROUP_ID && DynVehicleInfo[iDvSlotID][gv_igID] == iGroupID)
                    {
                        if(
DynVehicleInfo[iDvSlotID][gv_iModel] != 0 && (400 < DynVehicleInfo[iDvSlotID][gv_iModel] < 612))
                        {
                            if(
arrGroupData[iGroupID][g_iBudget] >= DynVehicleInfo[iDvSlotID][gv_iUpkeep])
                            {
                                
arrGroupData[iGroupID][g_iBudget] -= DynVehicleInfo[iDvSlotID][gv_iUpkeep];
                                
format(szMiscArray, sizeof(szMiscArray), "Vehicle ID %d (Slot ID %d) Maintainence fee cost $%s to %s's budget fund.",DynVehicleInfo[iDvSlotID][gv_iSpawnedID], iDvSlotID, number_format(DynVehicleInfo[iDvSlotID][gv_iUpkeep]), arrGroupData[iGroupID][g_szGroupName]);
                                
GroupPayLog(iGroupID, szMiscArray);
                            }
                            else
                            {
                                
DynVehicleInfo[iDvSlotID][gv_iDisabled] = 1;
                                
DynVeh_Save(iDvSlotID);
                                
DynVeh_Spawn(iDvSlotID);
                            }
                        }
                    }
                }
                
SaveGroup(iGroupID);
                for(new 
cratebox = 0; cratebox < MAX_CRATES; cratebox++) {
                    if(
CrateBox[cratebox][cbActive]) {
                        
SaveCrate(cratebox);
                    }
                }
                for(new 
facility = 0; facility < MAX_CRATE_FACILITY; facility++) {
                    if(
CrateFacility[facility][cfActive]) {
                        
SyncFacility(facility);
                    }
                }
            }
        }
        
WeatherCalling += random(5) + 1;
        
#if defined zombiemode
          
if(WeatherCalling > 20)
        {
              
WeatherCalling = 1;
            
gWeather = random(19) + 1;
            if(
gWeather == 1 || gWeather == 8 || gWeather == 9) gWeather=1;
        }
        
#else
        
if(WeatherCalling > 20)
        {
             
WeatherCalling = 1;
               
gWeather = random(19) + 1;
               
gWeather = 1;
            if(
gWeather == 1 || gWeather == 8 || gWeather == 9) gWeather=1;
        }
        
#endif
        
ghour = tmphour;
        
TotalUptime += 1;
        
GiftAllowed = 1;
        new 
bmonth, bday, byear;
        new 
year, month, day;
        
getdate(year, month, day);
        new 
ttTime = CalculateWorldGameTime(hour, minuite);
        
format(szMiscArray, sizeof(szMiscArray), "The time is now %s. ((ST: %s))", ConvertToTwelveHour(ttTime), ConvertToTwelveHour(tmphour));
        
SendClientMessageToAllEx(COLOR_WHITE, szMiscArray);
        new 
query[300];
        
mysql_format(MainPipeline, query, sizeof(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(), year, month, day, tmphour, GetWeekday());
        
mysql_tquery(MainPipeline, query, "GetShiftInfo", "is", INVALID_PLAYER_ID, szMiscArray);
        foreach(new 
i: Player)
        {
            if(
PlayerInfo[i][pAdmin] >= 2)
            {
                if(
tmphour == 0) ReportCount[i] = 0;
                
ReportHourCount[i] = 0;
            }
            if(
PlayerInfo[i][pWatchdog])
            {
                if(
tmphour == 0) WDReportCount[i] = 0;
                
WDReportHourCount[i] = 0;
            }
            if(
PlayerInfo[i][pLevel] <= 5) SendClientMessageEx(i, COLOR_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", byear, bmonth, bday);
                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(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `LastBirthday`=%d WHERE `Username` = '%e'", PlayerInfo[i][pLastBirthday], GetPlayerNameExt(i));
                        
mysql_tquery(MainPipeline, query, "OnQueryFinish", "ii", SENDDATA_THREAD, i);
                    }
                }
                else
                {
                    
DeletePVar(i, "pBirthday");
                }
                if(
GetPVarInt(i, "pBirthday") == 1)
                {
                    if(
PlayerInfo[i][pReceivedBGift] != 1)
                    {
                        
PlayerInfo[i][pReceivedBGift] = 1;
                        
GiftPlayer(MAX_PLAYERS, i);
                        
format(szMiscArray, sizeof(szMiscArray), "Happy Birthday %s! You have received a free gift!", GetPlayerNameEx(i));
                        
SendClientMessageEx(i, COLOR_YELLOW, szMiscArray);
                        
format(szMiscArray, sizeof(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(i, COLOR_YELLOW, "Gold VIP: You will get x2 paycheck as a birthday gift today.");
                        
OnPlayerStatsUpdate(i);
                    }
                }
            }
        }
        new 
iTempHour = CalculateWorldGameTime(hour, minuite);
        
SetWorldTime(iTempHour);
        if(
tmphour == 0) CountCitizens();
        for(new 
x = 0; x < MAX_POINTS; x++)
        {
            if(
strcmp(DynPoints[x][poName], "NULL", true) != 0) {
                if(
DynPoints[x][poTimer] > 0) DynPoints[x][poTimer]--, SavePoint(x);
                if(!
DynPoints[x][poTimer] && !DynPoints[x][poCapturable] && !DynPoints[x][poLocked]) {
                    
format(szMiscArray, sizeof(szMiscArray), "%s has become available for capture.", DynPoints[x][poName]);
                    
SendClientMessageToAllEx(COLOR_YELLOW, szMiscArray);
                    
DynPoints[x][poCapturable] = 1;
                    
SavePoint(x);
                }
                if((
0 <= DynPoints[x][poCaptureGroup] < MAX_GROUPS) && DynPoints[x][poAmountHour] > 0) {
                    
format(szMiscArray, sizeof(szMiscArray), "Your family has recieved %s %s for owning %s.", number_format(DynPoints[x][poAmountHour]), PointTypeToName(DynPoints[x][poType]), DynPoints[x][poName]);
                    foreach(new 
i: Player)
                    {
                        if(
PlayerInfo[i][pMember] == DynPoints[x][poCaptureGroup]) {
                            
SendClientMessageEx(i, COLOR_LIGHTBLUE, szMiscArray);
                        }
                    }
                    if(
DynPoints[x][poType] == 0) arrGroupData[DynPoints[x][poCaptureGroup]][g_iMaterials] += DynPoints[x][poAmountHour];
                    if((
1 <= DynPoints[x][poType] < 5)) arrGroupData[DynPoints[x][poCaptureGroup]][g_iDrugs][DynPoints[x][poType]-1] += DynPoints[x][poAmountHour];
                }
            }
        }
        
Misc_Save();
        for(new 
i = 0; i < MAX_TURFS; i++)
        {
            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 
x: Player) if(PlayerInfo[x][pMember] == TurfWars[i][twOwnerId]) SendClientMessageEx(x, COLOR_YELLOW, szMiscArray);
                    }
                }
            }
            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 
x: Player) if(PlayerInfo[x][pMember] == TurfWars[i][twOwnerId]) SendClientMessageEx(x, COLOR_LIGHTBLUE, "Your family has recieved drugs for owning a drug turf.");
            }
        }
        
//CallRemoteFunction("ActivateRandomQuestion", "");//Olympics
        
if(tmphour == 0 && day == 1) {
            foreach(new 
i: Player)
            {
                if(
PlayerInfo[i][pDedicatedHours] > 0) {
                    
SendClientMessageEx(i, COLOR_YELLOW, "Player Dedicated has entered a new month your hours and rank have been reset.");
                    
PlayerInfo[i][pDedicatedHours] = 0;
                    if(
PlayerInfo[i][pDedicatedPlayer] != 4) PlayerInfo[i][pDedicatedPlayer] = 0;
                }
            }
            
mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `pDedicatedPlayer` = 0, `DedicatedHours` = 0 WHERE `DedicatedHours` > 0 AND `pDedicatedPlayer` != 4");
            
mysql_tquery(MainPipeline, query, "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)