23.06.2015, 11:07
Try this
pawn Код:
CMD:pm(playerid, params[])
{
new id, str[128], str2[128], adminstr[128], YourName[24], OtherPlayerName[24];
if(sscanf(params,"ds[128]", id, str2)) return SendClientMessage(playerid, COLOR_YELLOW,"USAGE: /pm [id] [message]");
if(IsPlayerConnected(id))
{
if(id != playerid)
{
if(DND[id] == 0)
{
GetPlayerName(playerid, YourName, sizeof(YourName));
GetPlayerName(id, OtherPlayerName, sizeof(OtherPlayerName));
format(str, sizeof(str),"PM to [%d]%s: %s", id, OtherPlayerName, str2);
SendClientMessage(playerid, COLOR_YELLOW, str);
format(str, sizeof(str),"PM from [%d]%s: %s", playerid, YourName, str2);
SendClientMessage(id, COLOR_YELLOW, str);
SendClientMessage(id, -1,"Use {FFFF33}/rpm [message] {FFFFFF}to reply to this PM");
format(adminstr, sizeof(adminstr),"PM from %s[%d] to %s[%d]: %s", YourName, playerid, OtherPlayerName, id, str2);
SendClientMessageToAll(COLOR_WHITE, adminstr);
LastPm[id] = playerid;
}
else return SendClientMessage(playerid, COLOR_RED,"That player is in do not disturb mode!");
}
else return SendClientMessage(playerid, COLOR_RED,"You cannot PM yourself");
}
else return SendClientMessage(playerid, COLOR_RED,"Player is not connected");
return 1;
}