Код:
CMD:pm(playerid, params[])
{
new id, msg[64];
if(IsMuted{playerid} == 1) return SendClientMessage(playerid, RED, "You cant use this command while your are mutted.");
if(sscanf(params, "us[64]", id, msg)) return SendClientMessage(playerid, RED, "[USAGE]: /pm [name/id] [msg]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player not found.");
if(strlen(msg) < 1 || strlen(msg) > 64) return SendClientMessage(playerid, RED, "Your message can only contain 1-64 characters.");
if(playerid == id) return SendClientMessage(playerid, RED, "You cannot PM yourself.");
if(IsIgnoringPMs{id} == 1) return SendClientMessage(playerid, RED, "That player is currently ignoring private messages.");
{
format(fstr, sizeof(fstr), "PM To %s [%d]: %s", GetName(id), id, msg);
SendClientMessage(playerid, WHITE, fstr);
format(fstr, sizeof(fstr), "PM From %s [%d]: %s", GetName(playerid), playerid, msg);
SendClientMessage(id, YELLOW, fstr);
SendClientMessage(id, LIGHTGREEN, "Use /r [msg] to reply to this PM, use /ignorepms to ignore all PMs.");
PlayerPlaySound(id,1085,0.0,0.0,0.0);
chattingwith[id] = playerid;
new astring[100];
format(astring, sizeof(astring),"PM: %s [%d] to %s [%d]: %s", GetName(playerid), playerid, GetName(id), id, msg);
SendAdminMessage(GREY, astring);
format(astring, sizeof(astring), "3[PM]: %s(%d) to %s(%d): %s", GetName(playerid),playerid ,GetName(id), id, msg); // [0] <jacob> hi
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL, astring);
}
return true;
}
Download the latest version of YSI and place it to your folder/pawno/includes/ in case you remove it from the YSI folder.