SA-MP Forums Archive
I need dcmd pm command - 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: I need dcmd pm command (/showthread.php?tid=368101)



I need dcmd pm command - Uberanwar - 12.08.2012

Hi, I need a dcmd pm command. I notice that the gamemode I am currently using doesn't have pm command.
Can someone give me a simple dcmd pm command?
I will give rep+


Re: I need dcmd pm command - Cjgogo - 12.08.2012

pawn Код:
dcmd_pm(playerid,params[])
{
  new playerid2;
  new string2[256];
  if(sscanf(params,"us[256]",playerid2,string2)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/pm [ID] [Message]");
  if(!(IsPlayerConnected(playerid2))) return SendClientMessage(playerid,COLOR_RED,"Invalid ID");
  new string[256];
  new pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(string,sizeof(string),"PM from %s(%d):%s",pName,playerid,string2);
  SendClientMessage(playerid,COLOR_YELLOW,string);
  PlayerPlaySound(playerid2,1054,0,0,0);
  return 1;
}
Then add on OnPlayerCommandText:
pawn Код:
dcmd(pm,2,cmdtext);