Errors When Compiling
#1

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
Reply
#2

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")));
Reply
#3

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
Reply
#4

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"          )            )         );
Reply
#5

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
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)