SA-MP Forums Archive
1 Error in this line - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 1 Error in this line (/showthread.php?tid=71884)



1 Error in this line - zombie_modder - 04.04.2009

Hi,

Iґve got 1 Error in this line:
Код:
  
    if(strcmp(cmdtext, "/aderby", true) == 0) {
 	if (!IsPlayerAdmin(playerid))
  	SendClientMessage(playerid,0x00FF00AA, "You started a Derby Event");
  	SendClientMessageToAll(0xDEEE20FF, " You have 1:30 minutes to join Derby ! [ /derby ] ");
    JoinDerby[playerid]=true;
  	}else{
	SendClientMessage(playerid, COLOR_RED, "You are not an Admin!!");		}
	return 1;
    }
	return 0; // This is the line with the Error
   }
Error:
Код:
C:\DOKUME~1\Pepe\Desktop\gangwars.pwn(1537) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: 1 Error in this line - Klutty - 04.04.2009

Remove it.


Re: 1 Error in this line - Benjo - 04.04.2009

You're missing an open-squiggly-bracket after the second IF statement.


Re: 1 Error in this line - Pyrokid - 04.04.2009

Quote:
Originally Posted by ʎʇʇnןʞ
Remove it.
You know that's not very helpful...


Re: 1 Error in this line - harly - 04.04.2009

Remove the line i assume..
I have the problemo some times.


Re: 1 Error in this line - LarzI - 04.04.2009

Quote:
Originally Posted by Benjo
You're missing an open-squiggly-bracket after the second IF statement.
Benjo's right
Add a opening brace after the IsPlayerAdmin statement


Re: 1 Error in this line - Klutty - 05.04.2009

Quote:
Originally Posted by pıʞoɹʎd
Quote:
Originally Posted by ʎʇʇnןʞ
Remove it.
You know that's not very helpful...
Well, if he already has return true; does he need return false; ?


Re: 1 Error in this line - LarzI - 05.04.2009

Maybe


Re: 1 Error in this line - [M2S]moe - 05.04.2009

Код:
if(strcmp(cmdtext, "/aderby", true) == 0) {
 	if (IsPlayerAdmin(playerid)) {
 	SendClientMessage(playerid,0x00FF00AA, "You started a Derby Event");
 	SendClientMessageToAll(0xDEEE20FF, " You have 1:30 minutes to join Derby ! [ /derby ] ");
    JoinDerby[playerid]=true;
 	}else{
	SendClientMessage(playerid, COLOR_RED, "You are not an Admin!!");		}
	return 1;
   }



Re: 1 Error in this line - LarzI - 05.04.2009

Or try indenting

pawn Код:
if(!strcmp(cmdtext, "/aderby", true))
{
    if (IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0x00FF00AA, "You started a Derby Event");
        SendClientMessageToAll(0xDEEE20FF, " You have 1:30 minutes to join Derby ! [ /derby ] ");
        return JoinDerby[playerid]=true;
    }
    return SendClientMessage(playerid, COLOR_RED, "You are not an Admin!!");   
}