SA-MP Forums Archive
Problem with /reply command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with /reply command (/showthread.php?tid=351475)



Problem with /reply command - pasha97 - 16.06.2012

I tried to create command with which player could reply on last pm sent to him.I did, but when player replies, target player doesnt see any text

pawn Код:
new cmd[512], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/reply", true) == 0)
    {
    new tmp[512];
    tmp = strtok(cmdtext, idx);
    if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reply "#COL_RED"[message]");
    player = replyid[playerid];
    GetPlayerName(player, incriminato, sizeof(incriminato)); GetPlayerName(playerid, adminname, sizeof(adminname));
    format(string, sizeof(string), "{ff0000}<<< {00ff00}PM from {ffcc00}%s (ID:%i): {ffffff}%s >>>", adminname,playerid, strval(tmp)), SendClientMessage(player,COLOR_LIGHTGREEN,string);
    format(string, sizeof(string), "<<< PM for %s (ID:%i): %s >>>",incriminato, player, strval(tmp)),SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
    return 1;
    }
Players see only: "<<< PM from examplename (ID:exampleid): >>>"


Re: Problem with /reply command - JaKe Elite - 16.06.2012

I already ask you if you need help with PM Reply you said no now you need help...
You need to store the playerid to a variable or a PVarInt


Re: Problem with /reply command - pasha97 - 16.06.2012

Quote:
Originally Posted by Romel
Посмотреть сообщение
I already ask you if you need help with PM Reply you said no now you need help...
You need to store the playerid to a variable or a PVarInt
It is /reply, id of a player to reply is stored in "replyid" when player resieves pm, and when player types /reply [message] message sends to this player.

For example:

Player A: /pm 1 Hi friend!
Player B: /reply Hi! How are you?
Player A: /reply I am Fine, Thanks!


Re: Problem with /reply command - Revo - 16.06.2012

pawn Код:
//Top of script
new LastReply[MAX_PLAYERS];

//PM command
CMD:PM(playerid, params[])
{
  new id, message[120];
  if(sscanf(params, "is[120]", id, message)) return SendClientMessage(playerid, -1, "Usage: /pm ID message");
  SendClientMessage(id, -1, message);
  SendClientMessage(playerid, -1, "message sent");
  LastReply[id] = playerid;
  return 1;
}

CMD:r(playerid, params[])
{
  SendClientMessage(LastReply[playerid], -1, params);
  SendClientMessage(playerid, -1, "message sent");
  return 1;
}
You basically need that, I am unsure if it has bugs as I haven;'t tested it, but you should get the idea.


Re: Problem with /reply command - pasha97 - 16.06.2012

i cant use zcmd with usual commands, because i will have "unnknown command"