invalid subscript (not an array or too many subscripts):
#1

I need help with this, I have this cmd and it gets mi errors

pawn Код:
if (strcmp(cmd, "/adminii", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new klok[1300];
new mic;
for(new i = 0; i < 100; i++)
{
new FileName[128];
format(FileName, sizeof(FileName), "admini/Admin_%d.ini", i);
if(fexist(FileName) )
{
mic=1;
Admin[i][adIme]= dini_Get(FileName, "Ime" );  //this is the line with error
Admin[i][adRank]= dini_Int(FileName, "Rank" );
new blabla[300];
new blabla2[300];
if(IsPlayerConnected(GetPlayerID(Admin[i][adIme])))
{
format(blabla, sizeof(blabla),"{80FF00}[ONLINE] %s",Admin[i][adIme]);
strcat(klok, blabla);
strcat(klok, "{ffffff} Rank:");
format(blabla2, sizeof(blabla2), "{FFFF00}%d",Admin[i][adRank]);
strcat(klok,blabla2);
strcat(klok, "\n");
}
else if(!IsPlayerConnected(GetPlayerID(Admin[i][adIme])))
{
format(blabla, sizeof(blabla) ,"{FFFF00}[OFFLINE]%s",Admin[i][adIme]);
strcat(klok, blabla);
strcat(klok, "{9c9c9c} Rank:");
format(blabla2, sizeof(blabla2), "{80FF00}%d",Admin[i][adRank]);
strcat(klok,blabla2);
strcat(klok, "\n");
}
}
}
if(mic==0)
{
SendClientMessage(playerid,COLOR_GREEN, "Trenutno nema admina online !");
}
else
{
ShowPlayerDialog(playerid,36,DIALOG_STYLE_MSGBOX,"Lista admina",klok,"OK","");
}
return 1;
}
}
error 028: invalid subscript (not an array or too many subscripts): "Admin"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

please help
Reply
#2

Fix the alignments.
Reply
#3

I tried, and it didnt work, can you do that for me?
Reply
#4

1. You must use format or strcat for this
pawn Код:
strcat((Admin[i][adIme][0]='\0',Admin[i][adIme]),dini_Get(FileName, "Ime" ),SET_HERE_ARRAY_adIme_LENGHT);
2. Don't use 2 times IsPlayerConnected

pawn Код:
if(IsPlayerConnected(GetPlayerID(Admin[i][adIme])))
{
// code
}else{
// code
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)