SA-MP Forums Archive
Errors When Compiling - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Errors When Compiling (/showthread.php?tid=468455)



Errors When Compiling - 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: Errors When Compiling - Konstantinos - 08.10.2013

Is declared like the example below?
pawn Код:
new Member[MAX_PLAYERS];



Re: Errors When Compiling - woot - 08.10.2013

You're missing a semicolon at the end of Line 711. Also, this belongs to the scripting section.


Re: Errors When Compiling - Hussain - 08.10.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Is declared like the example below?
pawn Код:
new Member[MAX_PLAYERS];
What do you mean, could you explain?


Re: Errors When Compiling - Hussain - 08.10.2013

Quote:
Originally Posted by woot
Посмотреть сообщение
You're missing a semicolon at the end of Line 711. Also, this belongs to the scripting section.
Sorry for placing the thread in the wrong place

But there is a semicolon on the end of Line 711
Quote:

format(filo,55,"org%d.ini",Member[playerid]);




Re: Errors When Compiling - RedCountyRP - 08.10.2013

I can't see no semicolon at the end of it?
Quote:

format(filo,55,"org%d.ini",Member[playerid])




Re: Errors When Compiling - Hussain - 08.10.2013

Quote:
Originally Posted by RedCountyRP
Посмотреть сообщение
I can't see no semicolon at the end of it?
Sorry, i must've pasted it in wrong. I looked back at the script and the semi-colon was there i did copy one line at a time also.


Re: Errors When Compiling - Hussain - 08.10.2013

When i remove the code (The ones on line 710 to 712) I get the following error with the following code

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;
}




Re: Errors When Compiling - Hussain - 08.10.2013

And if this helps

I was trying to add this in:
https://sampforum.blast.hk/showthread.php?tid=296601