What does this debug mean?
#1

[16:08:28] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[16:08:28] [debug] Stack pointer (STK) is 0x298AC14, heap pointer (HEA) is 0x400C888
[16:08:28] [debug] AMX backtrace:
[16:08:28] [debug] #0 00000000 in public cmd_noithat () from vnrpgB.amx
[16:08:28] [debug] #1 native CallLocalFunction () from samp-server.exe
[16:08:28] [debug] #2 00000000 in public OnPlayerCommandText () from vnrpgB.amx
My command:
CMD:noithat(playerid, params[])
{
static
houseid = -1;

if ((houseid = House_Inside(playerid)) != -1 && House_IsOwner(playerid, houseid))
{
new
count = 0,
string[MAX_FURNITURE * 32];

for (new i = 0; i != MAX_FURNITURE; i ++) if (count < MAX_HOUSE_FURNITURE && FurnitureData[i][furnitureExists] && FurnitureData[i][furnitureHouse] == houseid) {
ListedFurniture[playerid][count++] = i;

format(string, sizeof(string), "%s%s (%.2f meters)\n", string, FurnitureData[i][furnitureName], GetPlayerDistanceFromPoint(playerid, FurnitureData[i][furniturePos][0], FurnitureData[i][furniturePos][1], FurnitureData[i][furniturePos][2]));
}
if (count) {
Dialog_Show(playerid, ListedFurniture, DIALOG_STYLE_LIST, "Listed Furniture", string, "Choose", "Cancel");
}
else SendErrorMessage(playerid, "This house doesn't have any furniture spawned.");
}
else SendErrorMessage(playerid, "You are not in range of your house interior.");
return 1;
}
Reply
#2

at the bottom of the script
PHP код:
#pragma dynamic (64*1024) // 64 KB or more 
Reply
#3

Код:
string[MAX_FURNITURE * 32];
I don't know what MAX_FURNITURE is, but let's assume that it's 200. Then this will create a string 6400 cells in size. One cell is 4 bytes, therefore this lone string is 25 KiB in size. The default size of the stack is only 16 KiB. See the problem here?
Reply
#4

Thank you. Vince, AbyssMorgan
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)