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; }
// global:
new gPlayer_Name[MAX_PLAYERS][MAX_PLAYER_NAME];
#define PlayerName(%0) gPlayer_Name[%0]
// OnPlayerConnect:
GetPlayerName(playerid, gPlayer_Name[playerid], MAX_PLAYER_NAME);
IRCCMD:pm(botid, channel[], user[], host[], params[]) { new PlayerName[MAX_PLAYER_NAME]; if (IRC_IsVoice(botid, channel, user)) { if (!isnull(params)) {......
pawn Код:
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. |
Код:
IRCCMD:pm(botid, channel[], user[], host[], params[]) { new PlayerName[MAX_PLAYER_NAME]; if (IRC_IsVoice(botid, channel, user)) { if (!isnull(params)) {...... |