27.12.2010, 20:09
pawn Код:
CMD:pm(playerid, params[])
{
new str[128], str2[128], id;
if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid, Yellow, "Usage: /pm <playerid> <message>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "ERROR: Player not connected");
if(playerid == id) return SendClientMessage(playerid, Red, "ERROR: You cannot pm yourself!");
new iName[24], pName[24];
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(str, sizeof(str), "PM sent to %s(ID: %d): %s", iName, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), "PM from %s(ID: %d): %s", pName, playerid, str2);
SendClientMessage(id, Yellow, str);
return 1;
}