2021-03-07, 10:12 AM
Hi guys
My crash detect log is full with this error
(every one minute)
This is a timer that starts every 60 seconds with a loop
I just need to have this loop. How I can improve it to avoid the error.
My crash detect log is full with this error
Code:
Long callback execution detected (hang or performance issue)
AMX backtrace:
#0 0082299c in public WoodGrowing () at
(every one minute)
This is a timer that starts every 60 seconds with a loop
Code:
for(new i; i < 2000; i)
I just need to have this loop. How I can improve it to avoid the error.
PHP Code:
#define MAX_WOOD 2000
enum Wood
{
dIDImanja,
Float:dWoodX,
Float:dWoodY,
Float:dWoodZ,
dTime,
dPostavljeno,
dObjd,
dText,
dVrsta,
dHour,
dMin,
dWood,
dProsloMinuta,
dProsloSat,
dUkradeno
};
new DI[MAX_WOOD][Wood];
forward WoodGrowing();
public WoodGrowing()
{
new stringv[128];
new vrsta[10];
for(new i; i < sizeof(DI); i)
{
if(DI[i][dPostavljeno] == 1)
{
if(DI[i][dVrsta] == 1) { vrsta = "Sljiva"; }
else if(DI[i][dVrsta] == 2) { vrsta = "Kruska"; }
else if(DI[i][dVrsta] == 3) { vrsta = "Jabuka"; }
if(DI[i][dHour] >= 0 && DI[i][dMin] >= 1)
{
DI[i][dMin] --;
format(stringv,128,"Voce jos nije izraslo !\nVrijeme do izrastanja: %d sati, %d minuta\nVrsta drveca: %s",DI[i][dHour],DI[i][dMin],vrsta);
UpdateDynamic3DTextLabelText(DrvoLabel[i], -1, stringv);
}
else if(DI[i][dMin] == 0 && DI[i][dHour] >= 1)
{
DI[i][dHour] --;
DI[i][dMin] = 60;
format(stringv,128,"Voce jos nije izraslo !\nVrijeme do izrastanja: %d sati, %d minuta\nVrsta drveca: %s",DI[i][dHour],DI[i][dMin],vrsta);
UpdateDynamic3DTextLabelText(DrvoLabel[i], -1, stringv);
}
else if(DI[i][dHour] == 0 && DI[i][dMin] == 0)
{
format(stringv,128,"Voce je izraslo !\nDa oberes voce kucaj/oberivoce\nVrsta drveca:%s",vrsta);
UpdateDynamic3DTextLabelText(DrvoLabel[i], -1, stringv);
if(DI[i][dProsloSat] >= 0 && DI[i][dProsloMinuta] >= 1) DI[i][dProsloMinuta] --;
else if(DI[i][dProsloMinuta] == 0 && DI[i][dProsloSat] >= 1) {
DI[i][dProsloMinuta] --;
DI[i][dProsloSat] = 60;
}
SaveWood(i);
}
}
}
return 1;
}