Spooling Error
#1

Okay, I'm trying to make a Newbie Chat filterscript off of something I'm looking at on the forums. I keep coming up with this error that's telling me that it's finding the end of script, and it's looking for "#endif". I put the #endif at the end of my filterscript, and it's still looking for it the "#endif" at the next line. I'm not understanding this.

Here's the script

Код:
new bool:NewbieChat[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	newbie[playerid] = true;
	return 1;
}

public OnFilterScriptInit()
{
	NewbieChat == true;
	return 1;
}

#if UseNewbieChat == true
if(!strcmp(cmdtext,"/n",true,2))
{
	if(PlayerInfo[playerid][Newbie] ==0 return SendClientMessage(playerid,0xff000000, "You are no longer labeled as a Newbie!"); //Official newb/pwn checker. :P 8=====D~~
    new name[MAX_PLAYER_NAME];
	new string[256];
	new text[128], string[128], playerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playerName, sizeof(name));
	
 	for(new i=0, i < MAX_PLAYERS; i++)
  	{
   		if(PlayerInfo[i][Newbie] ==1)
		{
 			format(string,sizeof(string), "[Newbie Chat] %s: %s",name,cmdtext[3]);
			SendClientMessage(i,COLOR_NGREEN,string);
		}
	}
	return 1;
}

if(!strcmp(cmdtext, "/nccontrol", true, 9))
{
	if(NewbieChat == true)
	{
	    SendClientMessage(playerid, COLOR_NRED, "{ffffff}[Server:] The Newbie Chat has been {ff0000}DISABLED {ffffff}by an administrator.");
	    NewbieChat == false;
	}
	else
	{
	    SendClientMessage(playerid, COLOR_NGREEN, "{ffffff}[Server:] The Newbie Chat has been {00ff00}ENABLED {ffffff}by an administraotr.");
	    NewbieChat == true;
	}
	return 1;
}
#endif
And my error message:
Код:
C:\Users\Bierstedt\Desktop\Noob Chat.pwn(74) : error 001: expected token: "#endif", but found "-end of file-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#2

I guess you should remove #endif.
Reply
#3

Is this all the file?
Reply
#4

Thank you both for your quick responses. This is the entire file, but I just didn't let you see the prints. If I remove the #endif from the file, it just looks for it again, and gives me the same error.
Reply
#5

You can try

pawn Код:
#if defined UseNewbieChat
Along with
pawn Код:
#define UseNewbieChat
Instead of
pawn Код:
#if UseNewbieChat == true
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)