27.09.2012, 19:30
pawn Код:
CMD:pm(playerid,params[])
{
new player, msg[128], finmsg[192];
if(sscanf(params,"rs[128]", player, msg))
{
SendClientMessage(playerid, RED,"Usage: /pm [PlayerID/PartOfName] [Message]");
return 1;
}
if(!IsPlayerConnected(player))
{
SendClientMessage(playerid, RED,"Invalid PlayerID or the PlayerID is not online");
return 1;
}
if(player == playerid)
{
SendClientMessage(playerid, RED, "You can't PM yourself");
return 1;
}
format(finmsg,sizeof(finmsg),"***[PM] from %s(%d): %s", GetName(playerid), playerid, msg);
SendClientMessage(player, 0xFF7F50FF, finmsg);
format(finmsg,sizeof(finmsg),">>>[PM] to %s(%d): %s", GetName(player), player, msg);
SendClientMessage(playerid, 0xFF7F50FF, finmsg);
return 1;
}