28.06.2012, 13:55
pawn Код:
// top
new LastSender[MAX_PLAYERS]; // a player global var to store the id of the last pm sender
// Under OnPlayerConnect, when they connect set it to -1 which means they didn't receiver any messages
LastSender[playerid] = -1;
// then put this into your pm command
LastSender[ID] = playerid; // means the last one who sent a pm to "ID" is "playerid"
// So now you can make a reply command .. /reply [message] and use the LastSender var to know
// who was the last player who sent this player a pm.
dcmd_reply(playerid, params[])
{
new ID = LastSender[playerid];
// also you can check if the var equals to -1 then return an error message.
if(ID == -1) return SendClientMessage(playerid, -1, "You didn't receiver any pms!");
/*
Your command stuff
*/
// And when your done formatting the message and everything send this message to ID
SendClientMessage(ID, -1, TheFormattedMessage);
return 1;
}