How To Make /r (Reply PM Command) ZCMD +rep
#1

old thread.
Reply
#2

Save the ID of the last PM sender and set it to send a PM to that player when using /r
Reply
#3

Quote:
Originally Posted by Sellize
Посмотреть сообщение
Save the ID of the last PM sender and set it to send a PM to that player when using /r
I'm new in scripting so I want to learn how to make it.
Reply
#4

pawn Код:
new lastSender[MAX_PLAYERS] = {INVALID_PLAYER_ID, ...};

CMD:pm(playerid, params[])
{
    //Add this at the end:
    lastSender[id] = playerid;
    return 1;
}

CMD:r(playerid, params[])
{
    new send_to = lastSender[playerid];
   
    //Now just send the pm to 'send_to'
    return 1;
}
Also make sure you put INVALID_PLAYER_ID in lastSender in OnPlayerConnect so it won't pass the id to a new player who joins
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)