26.10.2012, 22:14
I have a simple PM command but how do I make a command which allows people to see the lastpm they've got?
pawn Код:
CMD:pm(playerid, params[]) {
new id, message[1024];
if(sscanf(params,"ds[1024]",id,message))return SendClientMessage(playerid, COLOR_RED, "USAGE: /pm <playerid> <message>");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
if(playerid != id) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new ReturnName[MAX_PLAYER_NAME];
GetPlayerName(id, ReturnName, sizeof(ReturnName));
format(szString,sizeof(szString), ">> PM To %s (ID:%d): %s", ReturnName, id, message);
SendClientMessage(playerid, 0xFFCC2299, szString);
format(szString,sizeof(szString),"<< PM From %s (ID:%d): %s",PlayerName, playerid, message);
SendClientMessage(id, 0xFFFF22AA, szString);
PlayerPlaySound(id, 1085, 0.0, 0.0, 0.0);
format(szString, sizeof(szString), "5*** [PM] From %s (ID:%d) To %s (ID:%d): %s",PlayerName,playerid,ReturnName,id,message);
IRC_GroupSay(gGroupID, IRC_CHANNEL2, szString);
}
else {
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot PM yourself");
}
return 1;
}