SA-MP Forums Archive
/PM command problem - 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: /PM command problem (/showthread.php?tid=127868)



/PM command problem - johnathon956 - 15.02.2010

i get

C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(165) : error 017: undefined symbol "tmp"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(165) : error 017: undefined symbol "strtok"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(166) : error 017: undefined symbol "tmp"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(167) : error 017: undefined symbol "tmp"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(16 : error 017: undefined symbol "gMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(16 : error 017: undefined symbol "strrest"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(169) : error 017: undefined symbol "gMessage"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(171) : error 017: undefined symbol "iName"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(171) : error 017: undefined symbol "iName"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(171) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\JOHNPH.pwn(171) : fatal error 107: too many error messages on one line

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


11 Errors.

with

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/pm", cmdtext, true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFD720FF,Message);
format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
SendClientMessage(id,0xFFD720FF,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
return 1;
}
following https://sampwiki.blast.hk/wiki/OnPlayerPrivmsg

my script part




Re: /PM command problem - ScottCFR - 15.02.2010

Put the filterscript "base" as your last one so it doesn't conflict with other commands then /pm should work


Re: /PM command problem - johnathon956 - 15.02.2010

Quote:
Originally Posted by ScottCFR
Put the filterscript "base" as your last one so it doesn't conflict with other commands then /pm should work
thanks