26.10.2012, 22:36
Simply,store it in array.
pawn Код:
new lastpm[MAX_PLAYERS][128];
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);
lastpm[playerid] = message;
}
else {
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot PM yourself");
}
return 1;
}