SA-MP Forums Archive
Help Fix These Error Codes? - 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: Help Fix These Error Codes? (/showthread.php?tid=261050)



Help Fix These Error Codes? - Bmxerlmao5288 - 11.06.2011

Код:
C:\Documents and Settings\Administrator\Desktop\DeathMatch Backup.pwn(176) : error 017: undefined symbol "COLOR_GREEN"
C:\Documents and Settings\Administrator\Desktop\DeathMatch Backup.pwn(180) : error 017: undefined symbol "COLOR_GREEN"
C:\Documents and Settings\Administrator\Desktop\DeathMatch Backup.pwn(183) : warning 209: function "OnPlayerCommandText" should return a value
Heres The Lines

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/myteam", cmdtext, true, 10) == 0)
	{
	if (pTeam[playerid] == team_Army)
	    {
  				SendClientMessage(playerid,COLOR_GREEN, "You are a bad guy");
	    }
		else if (pTeam[playerid] == team_Fbi)
		    {
			        SendClientMessage(playerid,COLOR_GREEN, "You are a good guy");
         }
	return 1;}
}
Код:
Yes I do have

//Colors

	#define COLOR_GREY 0xAFAFAFAA
	#define COLOR_GREEN 0x33AA33AA
	#define COLOR_BRIGHTRED 0xFF0000AA
	#define COLOR_YELLOW 0xFFFF00AA
	#define COLOR_PINK 0xFF66FFAA
	#define COLOR_BLUE 0x3A47DEFF
	#define COLOR_TAN 0xBDB76BAA
	#define COLOR_PURPLE 0x800080AA
	#define COLOR_WHITE 0xFFFFFFAA
	#define COLOR_LIGHTBLUE 0x33CCFFAA
	#define COLOR_ORANGE 0xFF9900AA
	#define COLOR_INDIGO 0x4B00B0AA
	#define COLOR_BLACK 0x00000000
	#define COLOR_DARKGREY 0x696969FF
	#define COLOR_RED 0xFF0000AA



Re: Help Fix These Error Codes? - Darnell - 11.08.2011

If you still need help...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/myteam", cmdtext, true, 10) == 0)
    {
    if (pTeam[playerid] == team_Army)
        {
                SendClientMessage(playerid,COLOR_0x33AA33AA, "You are a bad guy");
        }
        else if (pTeam[playerid] == team_Fbi)
            {
                    SendClientMessage(playerid, 0x33AA33AA, "You are a good guy");
         }
    return 1;
}



Re: Help Fix These Error Codes? - Macluawn - 11.08.2011

Put the defines above OnPlayerCommandText, aka - on top of your script.

Darnell, there's something wrong with '}' in your fix. Try this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/myteam", cmdtext, true, 7))
    {
        if (pTeam[playerid] == team_Army)
        {
            SendClientMessage(playerid,COLOR_GREEN, "You are a bad guy");
        }
        else if (pTeam[playerid] == team_Fbi)
        {
            SendClientMessage(playerid,COLOR_GREEN, "You are a good guy");
        }
        return 1;
    }
    return 0;
}