15.06.2010, 11:46
Quote:
Originally Posted by DJDhan
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; } |