C:\Users\guilherme\Documents\0.3z\gamemodes\2.pwn(23237) : error 032: array index out of bounds (variable "InfoOrg")
if (strcmp("/orgs", cmdtext, true, 10) == 0)
{
/*if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um admin.");
return 1;
}*/
new DialogDiDi[1500];
//SendClientMessage(playerid, COLOR_WHITE, "|______________ Lideres das Organizaзхes ______________|");
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}1 - Policia Militar: {828282}%s ",DialogDiDi, InfoOrg[1][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}2 - BOPE: {828282}%s ",DialogDiDi, InfoOrg[2][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}3 - Exercito: {828282}%s ",DialogDiDi, InfoOrg[3][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}4 - SA:MU: {828282}%s ",DialogDiDi, InfoOrg[4][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}5 - Los Aztecas: {828282}%s ",DialogDiDi, InfoOrg[5][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}6 - Taliban: {828282}%s ",DialogDiDi, InfoOrg[6][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}7 - Prefeito: {828282}%s ",DialogDiDi, InfoOrg[7][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}8 - Hitmans: {828282}%s ",DialogDiDi, InfoOrg[8][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}9 - Reporteres: {828282}%s ",DialogDiDi, InfoOrg[9][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}10 - Taxista: {828282}%s ",DialogDiDi, InfoOrg[10][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}11 - Policia Federal: {828282}%s ",DialogDiDi, InfoOrg[11][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}12 - Mбfia Cosa Nostra: {828282}%s ",DialogDiDi, InfoOrg[12][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}13 - Mбfia Yakuza: {828282}%s ",DialogDiDi, InfoOrg[13][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}14 - Groove Street: {828282}%s ",DialogDiDi, InfoOrg[14][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}15 - Al'qaeda: {828282}%s ",DialogDiDi, InfoOrg[15][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}16 - Polнcia Rodoviбria: {828282}%s ",DialogDiDi, InfoOrg[16][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}17 - Ballas: {828282}%s ",DialogDiDi, InfoOrg[17][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}18 - Los Vagos: {828282}%s ",DialogDiDi, InfoOrg[18][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}19 - Comando Vermelho: {828282}%s ",DialogDiDi, InfoOrg[19][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}20 - PCC: {828282}%s ",DialogDiDi, InfoOrg[20][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}21 - Sons of Anarchy: {828282}%s ",DialogDiDi, InfoOrg[21][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}22 - Mayans: {828282}%s ",DialogDiDi, InfoOrg[22][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}23 - Interpol: {828282}%s ",DialogDiDi, InfoOrg[23][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}24 - Mecanicos: {828282}%s ",DialogDiDi, InfoOrg[24][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}25 - Triads: {828282}%s ",DialogDiDi, InfoOrg[25][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}26 - Midnight Club: {828282}%s ",DialogDiDi, InfoOrg[26][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}27 - Drifters: {828282}%s ",DialogDiDi, InfoOrg[27][Lider]);
format(DialogDiDi, sizeof(DialogDiDi),"%s\n {FF8C00}28 - NASA: {828282}%s ",DialogDiDi, InfoOrg[28][Lider]);// <<<<< essa e a linha do erro
ShowPlayerDialog(playerid, 8723, DIALOG_STYLE_MSGBOX, "{828282}Lнderes das Organizaзхes", DialogDiDi, "Fechar", "");
return 1;
}
Bбsico de Arrays:
Sendo Array[n], ela se inicia em Array[0] e termina em Array[n-1]. |
Se a InfoOrg tem 28 'informaзхes', ela deve ser definida como InfoOrg[28], sendo iniciada em InfoOrg[0] e terminando e InfoOrg[27].
|
A array "InfoOrg" deve ter um limite onde ela й criada !
procure por "new InfoOrg[" sem aspas .. e veja o valor dentro da "[" e "]" e aumente . Atй mais. |
new InfoOrgs[MAX_ORGS]
#define MAX_ORGS 28 // todas as orgs +1