undefined symbol "PlayerName"
#1

Код:
C:\Users\Matt\Desktop\mgdazam.pwn(648) : error 017: undefined symbol "PlayerName"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
format(string,sizeof(string),"6[IRC PM] From %s to %s(%d): %s",user,PlayerName(ID),ID,cmdreason);
Код:
IRCCMD:pm(botid, channel[], user[], host[], params[])
{
	if (IRC_IsVoice(botid, channel, user))
	{
		if (!isnull(params))
		{
			new string [128];
			new string2[128];
			new ID;
			new cmdreason[100];
		 	if(sscanf(params, "us[100]", ID, cmdreason))
		 	{
			 	format(string, sizeof(string), "USAGE: !pm (Player Name/ID) (Message)", ID);
			 	IRC_GroupSay(groupID, IRC_CHANNEL,string);
			 	return 1;
			}
			if(!IsPlayerConnected(ID))
			{
				format(string, sizeof(string), "2ERROR: \2;%d\2; is not an active ID.", ID);
			 	IRC_GroupSay(groupID, IRC_CHANNEL,string);
			 	return 1;
			}
		    format(string,sizeof(string),"6[IRC PM] From %s to %s(%d): %s",user,PlayerName(ID),ID,cmdreason);
			IRC_GroupSay(groupID, IRC_CHANNEL,string);
		    format(string2, sizeof(string2), "[IRC PM] %s: %s", user, cmdreason);
		    SendClientMessage(ID,0xFFFFFFFF,string2);
		    PlayerPlaySound(ID,1085,0.0,0.0,0.0);
		}
	}
   	return 1;
}
Reply
#2

pawn Код:
// global:
new gPlayer_Name[MAX_PLAYERS][MAX_PLAYER_NAME];

#define PlayerName(%0) gPlayer_Name[%0]

// OnPlayerConnect:
GetPlayerName(playerid, gPlayer_Name[playerid], MAX_PLAYER_NAME);
instead of calling the GetPlayerName function over and over again (with a function).

Oh and make sure that the player is connected before using it otherwise it'll cause run time error 4: Array index out of bounds.
Reply
#3

Код:
IRCCMD:pm(botid, channel[], user[], host[], params[])
{
        new PlayerName[MAX_PLAYER_NAME];
	if (IRC_IsVoice(botid, channel, user))
	{
		if (!isnull(params))
		{......
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
// global:
new gPlayer_Name[MAX_PLAYERS][MAX_PLAYER_NAME];

#define PlayerName(%0) gPlayer_Name[%0]

// OnPlayerConnect:
GetPlayerName(playerid, gPlayer_Name[playerid], MAX_PLAYER_NAME);
instead of calling the GetPlayerName function over and over again (with a function).

Oh and make sure that the player is connected before using it otherwise it'll cause run time error 4: Array index out of bounds.
Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Код:
IRCCMD:pm(botid, channel[], user[], host[], params[])
{
        new PlayerName[MAX_PLAYER_NAME];
	if (IRC_IsVoice(botid, channel, user))
	{
		if (!isnull(params))
		{......
Thanks to both of you it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)