Save id.
#1

Hello.

I do a cmd /apm (administrative command to send a pm to a player).

/apm <id> <text>

Then, when the administrator sends private message, the player can respond with:

/rpm <text>

However, I want to know how to save the id of the player who sent the pm to meet him without putting the id in the /rpm.

thx
Reply
#2

Can you help me plz?
Reply
#3

Just use something like this

https://sampforum.blast.hk/showthread.php?tid=164500

Then at the top of your command add your admin code to check if they're equal or higher admin level required.
Reply
#4

I want to save the id of the person who sent the private message to place an order:

/rpm <text>

This way, no need to put the id, send it directly to the right person!
Reply
#5

do like this
pawn Код:
new lastpmid[MAX_PLAYERS];//ontop
CMD:apm(playerid,parmas[])
{
//after all check like player connected or not and sscanf line writhe this
lastpmid[playerid]=adminid;//here adminid will come by sscanf line
}
now in lastpmid[playerid] the id is stored u will now use varailbe "lastpmid[playerid]" in /rpm command
Reply
#6

How do I remove the fact of entering the id, because the command works but I do /rmp <id> <text>, and I want /rmp <text>

pawn Код:
if(strcmp(cmd, "/reptick", true) == 0)
    {
        if(RepTICK[playerid] != 1) return SendClientMessage(playerid, COLOR_SERVER, "Aucun modйrateur/administrateur ne vous a envoyй de /tick.");

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Commande: {E0E0E0}/reptick <texte>");
        giveplayerid = ReturnUser(tmp);
        if(!player_isValid(pLastPmAuthor[playerid])) return SendClientMessage(playerid, COLOR_SERVER, noConnected);
        GetPlayerName(playerid, playername, sizeof(playername));
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' ')) idx++;
        new offset = idx;
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result)) return SendClientMessage(playerid, -1, "Commande: {E0E0E0}/reptick <texte>");
        format(string, sizeof(string), "Rйponse du /tick de %d/%s: %s", playerid, playername, result);
        SendClientMessage(pLastPmAuthor[playerid], 0xFFFF00AA, string);
        format(string, sizeof(string), "Rйponse envoyйe а %d/%s: %s", giveplayerid, giveplayer, result);
        RepTICK[giveplayerid] = 0; // On lui retire l'autorisation de /reptick
        SendClientMessage(playerid, 0xFFFF00AA, string);
        printf("LOGS /reptick. Ticket de %s а %s: %s", playername, giveplayer, result);
        return 1;
    }
Reply
#7

Can u help me plz?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)