SA-MP Forums Archive
I need a hand in this - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need a hand in this (/showthread.php?tid=239444)



I need a hand in this - Medal Of Honor team - 13.03.2011

I need 2 thing's over here.

1. A /reports command
2. It will be saved in a log

pawn Код:
if (strcmp("/report", cmdtext, true, 10) == 0)
    {
          //new tmp[256], idx;
          tmp = strtok(cmdtext,idx);
          if(!strlen(tmp))
          {
              SendClientMessage(playerid,0x0000FFFF,"USAGE: /report [playerid] [reason]");
              SendClientMessage(playerid,0x0000FFFF,"Will report a player to the admins.");
              return 1;
          }
          new id = strval(tmp);
          if(!IsPlayerConnected(id))
          {
              SendClientMessage(playerid,0xCC0000FF,"Player not connected.");
              return 1;
          }
          if(PlayerInfo[playerid][pAdminLevel] >= 1)
          {
              tmp = strrest(cmdtext,idx);
              new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME], string[128];
              GetPlayerName(id, pname, sizeof(pname));
              GetPlayerName(playerid, pname2, sizeof(pname2));
              tmp = strrest(cmdtext, idx);
              format(string, sizeof(string), "REPORT: %s (ID:%d) was reported by %s (ID:%d), Reason: %s", pname,id, pname2,playerid,tmp);
              MessageForAdmins(0xFF0000FF,string);
              format(string, sizeof(string), "Your report has been sent to the admins!");
              SendClientMessage(playerid,0xFFFFFFFF,string);
              PlayerPlaySound(playerid,1057,0,0,0);
          }
           
          return 1;
    }



Re: I need a hand in this - ricardo178 - 13.03.2011

Use ZCMD, is faster and easier!