[Help] Command dcmd_lspec
#1

Hi, I was changing the command lspec of the FilterScript ladmin4v2 and put a "else" with a message and I get the following errors:

Код:
C:\Documents and Settings\Gester\Escritorio\Host\filterscripts\ladmin4v2.pwn(3443) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gester\Escritorio\Host\filterscripts\ladmin4v2.pwn(3443) : warning 215: expression has no effect
C:\Documents and Settings\Gester\Escritorio\Host\filterscripts\ladmin4v2.pwn(3443) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
The command I have it so:

Код:
dcmd_lspec(playerid,params[])
{
    if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
	{
	    if(!strlen(params) || !IsNumeric(params)) return SendClientMessage(playerid, red, "USAGE: /lspec [playerid]");

		new specplayerid = strval(params);

		if(PlayerInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");

		if(IsPlayerConnected(specplayerid) && specplayerid != INVALID_PLAYER_ID)
		{
			if(specplayerid == playerid) return SendClientMessage(playerid, red, "ERROR: You cannot spectate yourself");

			if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && PlayerInfo[specplayerid][SpecID] != INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "Spectate: Player spectating someone else");

			if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3) return SendClientMessage(playerid, red, "Spectate: Player not spawned");

			if( (PlayerInfo[specplayerid][Level] != ServerInfo[MaxAdminLevel]) || (PlayerInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] == ServerInfo[MaxAdminLevel]) )	{

				CMDMessageToAdmins(playerid,"LSPEC");
				
				StartSpectate(playerid, specplayerid);
				
				SendClientMessage(playerid,blue,"My Message");
			}
			else
			{
            SendClientMessage(playerid,blue,"Second Message");
            }
			else return SendClientMessage(playerid,red,"ERROR: You cannot spectate the highest level admin");
		}
		else return SendClientMessage(playerid,red,"ERROR: The player is not connected");
	}
	else return SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");
}
The idea is that by put back the command will exit X message

Help Please =(
Reply
#2

Label the line please.
Reply
#3

The bracket doesn't match the one above it. It also is going above the other lines, where the return is.
Reply
#4

then how I can do to that the put the command again and leave him X message?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)