22.02.2019, 23:47
Hello,
I'm trying to insert a three-dimensional array into a dialog box. The code I have just outputs the standard error message whenever I try to type the command in-game. Not getting any compiler errors.
I'm new, and I understand that you're probably cringing reading my code right now. I really appreciate your help regardless. Cheers!
Just to clarify, I want the array to be inserted into the dialog box so it outputs the contents of the array into the box.
I'm trying to insert a three-dimensional array into a dialog box. The code I have just outputs the standard error message whenever I try to type the command in-game. Not getting any compiler errors.
pawn Code:
CMD:teams(playerid, params[])
{
new arenas[12][2][128] =
{
{"Dust 2", "Teaming permitted"},
{"Jefferson Motel", "Teaming permitted"},
{"Liberty City", "Teaming forbidden"},
{"LVPD", "Teaming forbidden"},
{"Madd Dogg's Mansion", "Teaming permitted"},
{"Meat Factory", "Teaming forbidden"},
{"Pleasure Domes", "Teaming forbidden"},
{"RC Battle Ground", "Teaming permitted"},
{"Tennis Court", "Teaming forbidden"},
{"The Farm", "Teaming forbidden"},
{"The Sewers", "Teaming permitted"},
{"Western Town", "Teaming permitted"}
};
new string[512];
for (new i=0; i < sizeof(arenas); i++)
{
for (new j=0; j < sizeof(arenas); j++)
{
strcat(string, sprintf("%s\t%s\n", arenas[i][j], arenas[i][j], sizeof(string)));
}
}
Dialog_Show(playerid, ArenasList, DIALOG_STYLE_MSGBOX, "Arena Teaming Rules", string, "OK", "OK");
return 1;
}
Just to clarify, I want the array to be inserted into the dialog box so it outputs the contents of the array into the box.