PM command fail?
#2

Might work:
Код:
if(strcmp(cmdtext, "/pm", true) == 0)
{
  	new name[24],mString1[126],mString2[126],n300[24];
  	GetPlayerName(playerid,name,24);
  	tmp = strtok(cmdtext, idx);

	if(strlen(tmp) == 0 ) return SendClientMessage(playerid, RedCol, "USAGE: /pm [playerid] [message]");
	if(!IsNumeric(tmp)) return SendClientMessage(playerid,RedCol,"ERROR: Invalid player ID.");
	if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid,RedCol,"ERROR: Player is not connected.");
	if(strval(tmp) == playerid) return SendClientMessage(playerid,RedCol,"ERROR: You cannot PM yourself.");



	format(mString1,126,"Message from %s(%d): %s",name,playerid, cmdtext[7]);
	SendClientMessage(strval(tmp),YellowCol,mString1);
	GetPlayerName(strval(tmp),n300,24);
	format(mString2,126,"Message succesfully sent to %s.",n300);
	SendClientMessage(playerid,Yellow2Col,mString2);
	
	return 1;
}
Reply


Messages In This Thread
PM command fail? - by [XST]O_x - 15.06.2010, 10:54
Re: PM command fail? - by DJDhan - 15.06.2010, 11:37
Re: PM command fail? - by [XST]O_x - 15.06.2010, 11:46
Re: PM command fail? - by Tnt12340 - 15.06.2010, 12:42
Re: PM command fail? - by [XST]O_x - 15.06.2010, 12:46
Re: PM command fail? - by randomkid88 - 15.06.2010, 15:19
Re: PM command fail? - by Jefff - 15.06.2010, 15:29
Re: PM command fail? - by [XST]O_x - 15.06.2010, 15:29

Forum Jump:


Users browsing this thread: 2 Guest(s)