SA-MP Forums Archive
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: reply command (/showthread.php?tid=498004)



reply command - AhmedMohamed - 01.03.2014

Hello all it's reply command, it's chat between the admin and the member when the member do /report but it's not work good with me what can i do??
Код:
CMD:reply(playerid,params[])
{
   new string[128], id;
   if(PlayerInfo[playerid][AcceptedReport] >= 1 || PlayerInfo[playerid][Replys] >= 1)
   {
     if(sscanf(params,"ii",id)) return SendClientMessage(playerid, red, "USAGE:{FFFFFF} /reply [playerid]");
     format(string, sizeof(string), "%s replies: %s", id, params);
     SendClientMessage(playerid, yellow, string);
     format(string, sizeof(string), "Reply sent to %s: %s", id, params);
     SendClientMessage(playerid, yellow, string);
   }
   else return SendClientMessage(playerid, red, "ERROR: You don't have an active report or it still not accepted.");
   return 1;
}
thank you


Re: reply command - Golimad - 01.03.2014

Your script is fucked up hahaha .. Let's try this !

pawn Код:
CMD:reply(playerid,params[])
{
   new string[128], message[128], id;
   if(PlayerInfo[playerid][AcceptedReport] >= 1 || PlayerInfo[playerid][Replys] >= 1) // ( || ) I guess those should be ( &&) I don't know
   {
     if(sscanf(params,"us",id, message)) return SendClientMessage(playerid, red, "USAGE:{FFFFFF} /reply [playerid] [message]");
     format(string, sizeof(string), "%s replies: %s", GetName(playerid), message);
     SendClientMessage(id, yellow, string);
     format(string, sizeof(string), "Reply sent to %s: %s", GetName(id), message);
     SendClientMessage(playerid, yellow, string);
   }
   else return SendClientMessage(playerid, red, "ERROR: You don't have an active report or it still not accepted.");
   return 1;
}
stock GetName(playerid)
{
    new
     pName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
Also give me what do you mean by : PlayerInfo[playerid][AcceptedReport] and PlayerInfo[playerid][Replys]


Re: reply command - AhmedMohamed - 01.03.2014

1st : thanks i will test it.
2nd : (||) or (&&) is available to use in the same place.
3rd : with PlayerInfo[playerid][AcceptedReport] and PlayerInfo[playerid][Replys] I mean if the player report is accepted and if he avalible to use /reply.


Re: reply command - Golimad - 01.03.2014

pawn Код:
CMD:reply(playerid,params[])
{
   new string[128], message[128], id;
   if(PlayerInfo[playerid][AcceptedReport] >= 1 && PlayerInfo[playerid][Replys] >= 1)
   {
     if(sscanf(params,"us",id, message)) return SendClientMessage(playerid, red, "USAGE:{FFFFFF} /reply [playerid] [message]");
     format(string, sizeof(string), "%s replies: %s", GetName(playerid), message);
     SendClientMessage(id, yellow, string);
     format(string, sizeof(string), "Reply sent to %s: %s", GetName(id), message);
     SendClientMessage(playerid, yellow, string);
   }
   else return SendClientMessage(playerid, red, "ERROR: You don't have an active report or it still not accepted.");
   return 1;
}
stock GetName(playerid)
{
    new
     pName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
That's how it should be then.
And ( || ) and ( && ) are totally different. || means OR ; && means AND .
Looking forward +rep


Re: reply command - AhmedMohamed - 01.03.2014

it compile good i will test it right now with my friend


Re: reply command - Golimad - 01.03.2014

Then +rep ...


Re: reply command - AhmedMohamed - 01.03.2014

didn't work good when i type it, it give me that message : you dun have an active report.


Re: reply command - AhmedMohamed - 01.03.2014

any way REP+ Golimad and thank you I will fix it with myself


Re: reply command - Golimad - 01.03.2014

The problem isn't coming from that script then ...