Hey, I'm getting this message in compiler. As far as I was reading what does it mean, it has to do something with new variables declared locally, I tried to decrease the variable's size, but I can't, becouse I'm using them all. :D
Stack/heap size: 16384 bytes; estimated max. usage=5007 cells (20028 bytes)
So my question, is there a workaround how to solve it, or does it affect script performance? Thanks.
Stack/heap size: 16384 bytes; estimated max. usage=5007 cells (20028 bytes)
So my question, is there a workaround how to solve it, or does it affect script performance? Thanks.
Code:
//Function causing this compiler message
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][6])
{
MDC_Close(playerid, true);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][8])
{
MDC_Close(playerid);
return 1;
}
else
{
for(new i; i < MDC_ITEM_COUNT; i++)
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][i * 2 + 10])
{
MDC_Update(playerid, i, MDC_g_sPlayer[playerid][E_MDC_CONTENT][i]);
return 1;
}
}
switch(MDC_g_sPlayer[playerid][E_MDC_ITEM])
{
case 1:
{
switch(MDC_g_sPlayer[playerid][E_MDC_CONTENT][MDC_g_sPlayer[playerid][E_MDC_ITEM]])
{
case 0:
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][21] || playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][23])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD] == MDC_LOOK_UP_METHOD_PERSON ? MDC_LOOK_UP_METHOD_VEHICLE : MDC_LOOK_UP_METHOD_PERSON;
MDC_Update(playerid, 1, 0, 1, _, 29, 52);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][24])
{
MDC_g_sPlayer[playerid][E_MDC_STATE] = MDC_STATE_SUSPENDED;
CancelSelectTextDraw(playerid);
if(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD] == MDC_LOOK_UP_METHOD_PERSON)
{
ShowPlayerDialog(playerid, MDC_DIALOG_LOOK_UP_INPUT, DIALOG_STYLE_INPUT, "Insert data", "Who are you looking for?", "Search", "Close");
}
else
{
ShowPlayerDialog(playerid, MDC_DIALOG_LOOK_UP_INPUT, DIALOG_STYLE_INPUT, "Insert data", "What plate are you looking for?\n\nFor plate, enter the plate number.\nFor vehicle ID, enter 'id:IDHERE', e.g. 'id:552'", "Search", "Close");
}
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][28] && MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] != MDC_LOOK_UP_CACHE_NONE && MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] != MDC_LOOK_UP_CACHE_SYNTAX_ERROR)
{SendClientMessage(playerid, -1, "Refresh");
MDC_LookUp(playerid, MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD], MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT], true);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][35])
{
MDC_Update(playerid, 1, 1);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][37])
{
if(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] == MDC_LOOK_UP_CACHE_ESSENTIAL)
{
MDC_Update(playerid, 1, 2);
}
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][39])
{
if(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] == MDC_LOOK_UP_CACHE_ESSENTIAL)
{
}
else
{
MDC_Update(playerid, 1, 2);
}
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][48] || playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][54])
{
if(!MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM] = 18;
}
else
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM] - 18 - (MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM] % 18);
}
MDC_Update(playerid, 1, 0, 1, _, 29);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][49] || playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][55])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_RECORD_CHARGE_NUM] += 18;
MDC_Update(playerid, 1, 0, 1, _, 29);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][60])
{
MDC_g_sPlayer[playerid][E_MDC_STATE] = MDC_STATE_SUSPENDED;
CancelSelectTextDraw(playerid);
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] = MDC_LOOK_UP_CACHE_NONE;
MDC_Update(playerid, 1, 0, 1);
new
body[1024 + 1]
;
switch(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR_CODE])
{
case 1:
{
new
filtered[MDC_LOOK_UP_INPUT_ERROR_SIZE],
filtered_index,
sequence_valid_start = -1,
sequence_invalid_start = -1
;
for(new i; i < strlen(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR]); i++)
{
if((MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] >= 'A' && MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] <= 'Z') || (MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] >= 'a' && MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] <= 'z') || MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] == '_' || MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i] == ' ')
{
if(sequence_valid_start == -1)
{
strins(filtered, "{00CC00}", filtered_index);
filtered_index += 8;
sequence_valid_start = i;
sequence_invalid_start = -1;
}
filtered[filtered_index++] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i];
}
else
{
if(sequence_invalid_start == -1)
{
strins(filtered, "{E7532E}", filtered_index);
filtered_index += 8;
sequence_invalid_start = i;
sequence_valid_start = -1;
}
filtered[filtered_index++] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT_ERROR][i];
}
}
format(body, sizeof(body), "%s", filtered);
}
default:
{
format(body, sizeof(body), "Other exception!");
}
}
ShowPlayerDialog(playerid, MDC_DIALOG_LOOK_UP_SYNTAX_DETAIL, DIALOG_STYLE_MSGBOX, "Details", body, "Close", "");
return 1;
}
}
case 1:
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][20])
{
MDC_Update(playerid, 1, 0);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][30])
{
if(!MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] = 3;
}
else
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] - 3 - (MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] % 3);
}
MDC_Update(playerid, 1, 1, 1, _, 32, 33, 34);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][31])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] += 3;
MDC_Update(playerid, 1, 1, 1, _, 32, 33, 34);
return 1;
}
for(new i; i < 3; i++)
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][i * 2 + 25])
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_SELECTED] = MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_NUM] + i;
if((MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_POS_X][MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_SELECTED]] >= 132.0 && MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_MAP]) || (MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_POS_X][MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_SELECTED]] < 132.0 && !MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_ADRESS_MAP]))
{
MDC_Update(playerid, 1, 1, 1, _, 32, 33);
}
else
{
MDC_Update(playerid, 1, 1, 1);
}
return 1;
}
}
}
case 2:
{
if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][20])
{
MDC_Update(playerid, 1, 0);
return 1;
}
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][30])
{
MDC_g_sPlayer[playerid][E_MDC_STATE] = MDC_STATE_SUSPENDED;
CancelSelectTextDraw(playerid);
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_LICENSE_SELECTED] = 0;
new
string[256 + 1] = "Are you sure you want to write a warning on 's driving license?"
;
strins(string, MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT], 44);
ShowPlayerDialog(playerid, MDC_DIALOG_LOOK_UP_LICENSE, DIALOG_STYLE_MSGBOX, "Confirmation", string, "Yes", "No");
return 1;
}
}
}
}
}
}
return 0;
}