How to make /r (Reply PM Command)
#7

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;
}
Reply


Messages In This Thread
How to make /r (Reply PM Command) - by Uberanwar - 28.06.2012, 13:31
Re: How to make /r (Reply PM Command) - by Deal-or-die - 28.06.2012, 13:33
Re: How to make /r (Reply PM Command) - by Uberanwar - 28.06.2012, 13:35
Re: How to make /r (Reply PM Command) - by Deal-or-die - 28.06.2012, 13:44
Re: How to make /r (Reply PM Command) - by MP2 - 28.06.2012, 13:51
Re: How to make /r (Reply PM Command) - by Deal-or-die - 28.06.2012, 13:53
Re: How to make /r (Reply PM Command) - by [KHK]Khalid - 28.06.2012, 13:55
Re: How to make /r (Reply PM Command) - by [MM]RoXoR[FS] - 28.06.2012, 14:02
Re: How to make /r (Reply PM Command) - by Uberanwar - 28.06.2012, 14:06
Re: How to make /r (Reply PM Command) - by [KHK]Khalid - 28.06.2012, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)