[debug] Stack pointer (STK) is 0x19F974, heap pointer (HEA) is 0x1A0000 [debug] AMX backtrace: [debug] #0 0001f7c8 in public OnDialogResponse (0, 45, 1, -1, 1703928) from survival_mysql.amx
ShowTargetInventory(playerid)
{
new buffer[2028], test[MAX_PLAYERS], count[MAX_PLAYERS];
for(new j = 0; j < inInfo[tradingPartner[playerid]][aSlots]; j++)
{
/*if(tradingItem1[playerid] == inInfo[tradingPartner[playerid]][iSlots][j] || tradingItem2[playerid] == inInfo[tradingPartner[playerid]][iSlots][j] || tradingItem3[playerid] == inInfo[tradingPartner[playerid]][iSlots][j])
{
test[playerid] = inInfo[tradingPartner[playerid]][iSlots][j];
format(buffer, sizeof(buffer), "%s{FF0000}%d %s (%d)(YOU ALREADY SELECTED THIS ITEM)\n", buffer, j + 1, ItemNames[test[playerid]], inInfo[tradingPartner[playerid]][iAmount][j]);
inInfo[tradingPartner[playerid]][dSlots][count[playerid]] = test[playerid];
count[playerid]++;
}*/
//else
//{
test[playerid] = inInfo[tradingPartner[playerid]][iSlots][j];
format(buffer, sizeof(buffer), "%s{0099cc}%d {FFFFFF}%s (%d)\n", buffer, j + 1, ItemNames[test[playerid]], inInfo[tradingPartner[playerid]][iAmount][j]);
inInfo[tradingPartner[playerid]][dSlots][count[playerid]] = test[playerid];
count[playerid]++;
//}
}
new string[90];
countsinventory[playerid]++;
if(tradingcCount[playerid] != countsinventory[playerid])
format(string, sizeof(string),"{0174DF}[R-SURVIVAL]: {FFFFFF}Trading System [ {FF0000}%d {FFFFFF}/ {00FF00}%d {FFFFFF}]", countsinventory[playerid], tradingcCount[playerid]);
else
format(string, sizeof(string),"{0174DF}[R-SURVIVAL]: {FFFFFF}Trading System [ {00FF00}%d {FFFFFF}/ {00FF00}%d {FFFFFF}]", countsinventory[playerid], tradingcCount[playerid]);
ShowPlayerDialog(playerid, DIALOG_TRADINGREQITEMS, DIALOG_STYLE_LIST, string, buffer, "Select","Cancel");
}
Solved. For anyone interested in solution, don't use too big arrays in your local variables. 2028 was unnecessarily big and I knew that but was kinda in a rush to publish this system and had plans to optimize it later on. Just don't.
|
I am interested but don't get what you mean..
What did you do with: new buffer[2028]? Did you define it as a global variable or just made it new buffer[1024] or something? |
I am interested but don't get what you mean..
What did you do with: new buffer[2028]? Did you define it as a global variable or just made it new buffer[1024] or something? |