SA-MP Forums Archive
wrong code? - 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: wrong code? (/showthread.php?tid=198630)



wrong code? - Face9000 - 12.12.2010

Hi,i've this code for admin chat

Код:
		if(text[0] == '@' && if (pInfo[playerid][pAdmin] >= 2)
	{
	    new string[128];
	    format(string,sizeof(string),"[Admin Chat %s(ID:%d)]: %s",GetPName(playerid),playerid,text[1]);
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
		   if (pInfo[playerid][pAdmin] >= 2) && IsPlayerConnected(i))
		    {
				SendClientMessage(i,COLOR_YELLOW,string);
		    }
		}
		return 0;
	}
But i get this errors:

Код:
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(898) : warning 219: local variable "playername" shadows a variable at a preceding level
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(904) : warning 219: local variable "playername" shadows a variable at a preceding level
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1072) : warning 219: local variable "playername" shadows a variable at a preceding level
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1632) : error 017: undefined symbol "text"
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1632) : warning 215: expression has no effect
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1632) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1632) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Symone\Desktop\SFTDM.pwn(1632) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Any help?


Re: wrong code? - snac24 - 13.12.2010

Your error is on 1632 line. ( You have the lines in left.)
Check there and send me the code from there on PM!


Re: wrong code? - Vince - 13.12.2010

Quote:
Originally Posted by snac24
Посмотреть сообщение
Your error is on 1632 line. ( You have the lines in left.)
Check there and send me the code from there on PM!
@snac24: Djeez, man. I already saw the error by looking at the first line ...
And this is a forum for a reason, it isn't here just to communicate with PMs.

pawn Код:
if(text[0] == '@' && if (pInfo[playerid][pAdmin] >= 2)
should be:

pawn Код:
if(text[0] == '@' && pInfo[playerid][pAdmin] >= 2)