17.08.2010, 03:23
Here, just for you :P, should work if I didn't fuck up somewhere...
pawn Код:
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, "LastPM", -1);
return 1;
}
CMD:pm(playerid, params[])
{
new target, msg[128];
if(sscanf(params, "us", target, msg)) return SendClientMessage(playerid, 0xFAFAFAA, "USAGE: /pm <playerid/name> <text>");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFAFAFAA, "ERROR: Player Not Found");
new str[128];
format(str, sizeof(str), "PM from %s(%d): %s", pName(playerid), playerid, msg);
SendClientMessage(target, 0xFAFAFAA, str);
SendClientMessage(target, 0xFAFAFAA, "Type \"/r <text>\"" to reply.");
format(str, sizeof(str), "PM sent to %s.", pName(target));
SendClientMessage(playerid, 0xFAFAFAA, str);
return 1;
}
CMD:r(playerid, params[])
{
new msg[128];
if(sscanf(params, "s", msg)) return SendClientMessage(playerid, 0xFAFAFAA, "USAGE: /r <text>");
else if(GetPVarInt(playerid, "LastPM") == -1) return SendClientMessage(playerid, 0xFAFAFAA, "ERROR: No one has sent you a PM!");
new str[128];
format(str, sizeof(str), "PM from %s(%d): %s", pName(playerid), playerid, msg);
SendClientMessage(GetPVarInt(playerid, "LastPM"), 0xFAFAFAA, str);
return 1;
}