SA-MP Forums Archive
Errors When Compiling - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Errors When Compiling (/showthread.php?tid=468495)



invalid subscript (not an array or too many subscripts): "Member" - Hussain - 08.10.2013

Hello SA-MP members,

I've tried to implement a dynamic orginization system but after i finished adding everything in i'm getting 4 errors:
Quote:

C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(711) : error 028: invalid subscript (not an array or too many subscripts): "Member"
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(711) : warning 215: expression has no effect
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(711) : error 001: expected token: ";", but found "]"
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(711) : error 029: invalid expression, assumed zero
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(711) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

The Code where i'm gettin errors (Red text is not actually apart of the code!)
Quote:
Line 710 new filo[55];
Line 711 format(filo,55,"org%d.ini",Member[playerid]);
Line 712 SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")) );

EDIT:

When i remove the code above i get the following error:

Quote:

C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(839) : warning 217: loose indentation
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(178 : warning 217: loose indentation
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(1825) : warning 217: loose indentation
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(2042) : error 028: invalid subscript (not an array or too many subscripts): "Member"
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(2042) : warning 215: expression has no effect
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(2042) : error 001: expected token: ";", but found "]"
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(2042) : error 029: invalid expression, assumed zero
C:\Users\Hussain\Desktop\Server\gamemodes\PulseRP. pwn(2042) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here's the code
Quote:

if(strcmp(cmd, "/oc", true) == 0)
{
if(Member[playerid] == -255) return 0;
new length = strlen(cmdtext);
new playrname[MAX_PLAYERS];
new string[256];
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oc [text]");
GetPlayerName(playerid, playrname, sizeof(playrname));
format(string,sizeof(string),"OrgChat - %s : %s", playrname,result);
if(Member[playerid] != -255)
{
for(new i=0;i<MAX_PLAYERS;i++)
{ if(IsPlayerConnected(i) && Member[i] == Member[playerid])
SendClientMessage(i,COLOR_MAIN,string);
}
}
return 1;
}

This is what i was trying to add https://sampforum.blast.hk/showthread.php?tid=296601

Regards,

Hussain


Re: invalid subscript (not an array or too many subscripts): "Member" - damian123 - 08.10.2013

Here:
pawn Код:
Line 710 new filo[55];
Line 711 format(filo,55,"org%d.ini",Member[playerid]);
Line 712 SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")) ); //it has an extra space here, it should be ))) not )) )
Replace with:
pawn Код:
new filo[55];
format(filo,55,"org%d.ini",Member[playerid]);
SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")));



Re: invalid subscript (not an array or too many subscripts): "Member" - Hussain - 09.10.2013

Quote:
Originally Posted by damian123
Посмотреть сообщение
Here:
pawn Код:
Line 710 new filo[55];
Line 711 format(filo,55,"org%d.ini",Member[playerid]);
Line 712 SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")) ); //it has an extra space here, it should be ))) not )) )
Replace with:
pawn Код:
new filo[55];
format(filo,55,"org%d.ini",Member[playerid]);
SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")));
Still Gettin' an error


Re: invalid subscript (not an array or too many subscripts): "Member" - Konstantinos - 09.10.2013

I had replied to your previous threads and you simply ignored my post. The only thing you did was to create the same thread over and over again. For last time.

It MUST be declared as:
pawn Код:
new Member[MAX_PLAYERS]
Quote:
Originally Posted by damian123
Посмотреть сообщение
Here:
pawn Код:
Line 710 new filo[55];
Line 711 format(filo,55,"org%d.ini",Member[playerid]);
Line 712 SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")) ); //it has an extra space here, it should be ))) not )) )
Replace with:
pawn Код:
new filo[55];
format(filo,55,"org%d.ini",Member[playerid]);
SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")));
spaces do not matter. I can do:
pawn Код:
SetPlayerColor(                    ID,                           HexToInt( dini_Get( filo, "color"          )            )         );



Re: invalid subscript (not an array or too many subscripts): "Member" - Hussain - 09.10.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I had replied to your previous threads and you simply ignored my post. The only thing you did was to create the same thread over and over again. For last time.

It MUST be declared as:
pawn Код:
new Member[MAX_PLAYERS]


spaces do not matter. I can do:
pawn Код:
SetPlayerColor(                    ID,                           HexToInt( dini_Get( filo, "color"          )            )         );
This method does not work


Re: Errors When Compiling - kaisersouse - 09.10.2013

https://sampforum.blast.hk/showthread.php?tid=468642