SA-MP Forums Archive
[Error with /r] - 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)
+--- Thread: [Error with /r] (/showthread.php?tid=296732)



[Error with /r] - Twinki1993 - 12.11.2011

Hello guys, I am receiving this errors for command /r
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(299) : error 017: undefined symbol "string"
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(299) : error 017: undefined symbol "string"
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(299) : error 029: invalid expression, assumed zero
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(299) : fatal error 107: too many error messages on one line

CODE:
Код HTML:
 	if (strcmp("/r", cmdtext, true, 10) == 0)
	{
		if(GetPlayerTeam(playerid) == 1)
		{
			format(string, sizeof(string), "* Radio: %s: %s", pName, string);
			SendPoliceMessage(COLOR_LIGHTBLUE, string);
		}
	return 1;
	}
	return 0;
}



Re: [Error with /r] - Juniior - 12.11.2011

"string" is undefined.

pawn Код:
if (strcmp("/r", cmdtext, true, 10) == 0)
{
    new string[64];
    if(GetPlayerTeam(playerid) == 1)
    {
        format(string, sizeof(string), "* Radio: %s: %s", pName, string);
        SendPoliceMessage(COLOR_LIGHTBLUE, string);
    }
    return 1;
}



Re: [Error with /r] - aRoach - 12.11.2011

pawn Код:
if (strcmp("/r", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            new string[ 256 ];
            format(string, sizeof(string), "* Radio: %s: %s", pName, string);
            SendPoliceMessage(COLOR_LIGHTBLUE, string);
        }
    return 1;
    }
    return 0;
}
EDIT: The same thing... More faster...


Re: [Error with /r] - Twinki1993 - 12.11.2011

C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(301) : error 017: undefined symbol "SendPoliceMessage"


Re: [Error with /r] - Twinki1993 - 12.11.2011

I have
new PName[MAX_PLAYER_NAME];
forward SendPoliceMessage(color, string[]);
tho..


Re: [Error with /r] - Twinki1993 - 12.11.2011

All errors fixed. Only
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(301) : error 017: undefined symbol "SendPoliceMessage"
left


Re: [Error with /r] - Juniior - 12.11.2011

Quote:
Originally Posted by Twinki1993
Посмотреть сообщение
I have
new PName[MAX_PLAYER_NAME];
forward SendPoliceMessage(color, string[]);
tho..
PAWN is case sensitive. PName is not the same as pName.

EDIT:
Quote:
Originally Posted by Twinki1993
Посмотреть сообщение
All errors fixed. Only
C:\Users\Maki\Desktop\TDM\gamemodes\TDM.pwn(301) : error 017: undefined symbol "SendPoliceMessage"
left
pawn Код:
public SendPoliceMessage(color, string[])
{
    //...
}



Re: [Error with /r] - =WoR=G4M3Ov3r - 12.11.2011

PHP код:
forward SendPoliceMessage(membercolorstring[]);
public 
SendPoliceMessage(membercolorstring[])
{
    foreach (
Playeri)
    {
        if(
gPlayerLogged[i] == 1)
        {
            if(
GetPlayerTeam(playerid) == 1)
            {
                
SendClientMessage(icolorstring);
            }
        }
    }

PHP код:
if (strcmp("/r"cmdtexttrue10) == 0)
    {
        if(
GetPlayerTeam(playerid) == 1)
        {
            new 
string256 ];
            
format(stringsizeof(string), "* Radio: %s: %s"pNamestring);
            
SendPoliceMessage(COLOR_LIGHTBLUEstring);
        }
    return 
1;
    }
    return 
0;

EDIT: I never read GetPlayerTeam , I've been on a drinking habit these days.


Re: [Error with /r] - Juniior - 12.11.2011

Quote:
Originally Posted by =WoR=G4M3Ov3r
Посмотреть сообщение
PHP код:
forward SendRadioMessage(membercolorstring[]);
public 
SendPoliceMessage(membercolorstring[]) 
You declare SendRadioMessage as a function yet you create SendPoliceMessage?


Re: [Error with /r] - Pharrel - 12.11.2011

Quote:
Originally Posted by aRoach
Посмотреть сообщение
pawn Код:
if (strcmp("/r", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
                   new string[ 256 ];
            format(string, sizeof(string), "* Radio: %s: %s", pName, string);
            SendPoliceMessage(COLOR_LIGHTBLUE, string);
        }
    return 1;
    }
    return 0;
}
EDIT: The same thing... More faster...
Read this it should help you