CMD:report issue
#1

Greetings! I made a /report function. It does show "USAGE: /report [ID] [reason]" when writing /report, but it does not show "You have reported %s to the administration for ''%s", nor does it show when logging in as admin;

"[Player ID: %d] %s has reported %s for: %s
Use /trashre [ID] or /on [ID]"

No error messages though.

pawn Код:
CMD:report(playerid, params[])
{
  new id, reason[128], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
  if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_IRAQ, "USAGE: {ffffff}/report [ID] [reason]");
  if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED,"ERROR: {ffffff}invalid player id.");
  else
  {
     GetPlayerName(id, name,sizeof(name));
     GetPlayerName(playerid, sendername, sizeof(sendername));
     sendername[strfind(sendername,"_")] = ' ';
     {
         if(GetPVarInt(playerid, "Level") < 1) return 1;
         format(string, sizeof(string), "[Player ID: %d] %s has reported %s for: %s", playerid, sendername, name, reason);
         ABroadCast(COLOR_RED,string,1);
         format(string, sizeof(string), "Use /trashre [ID] or /on [ID]");
         ABroadCast(COLOR_IRAQ,string,1);
     }
     format(string, sizeof(string), "You have reported %s to the administration for ''%s''.", name, reason);
     SendClientMessage(playerid,COLOR_AQUA,string);
     SendClientMessage(playerid, COLOR_AQUA, "Please be patient and wait for a reply.");
     PlayerNeedsHelp[playerid] = 1;
  }
  return 1;
}
Reply
#2

change
pawn Код:
if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_IRAQ, "USAGE: {ffffff}/report [ID] [reason]");
to

pawn Код:
if(sscanf(params,"us[128]", id, reason)) return SendClientMessage(playerid, COLOR_IRAQ, "USAGE: {ffffff}/report [ID] [reason]");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)