Report Administrator .txt Command?
#7

Quote:
Originally Posted by DeltaAirlines12
Quote:
Originally Posted by [TPG
Coole210 ]
pawn Code:
if(strcmp(cmd, "/report", true)==0) if(Logged[playerid] == 1)
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[ ! ] USAGE: /report [playerid] [message]");
    new giveplayerid = strval(tmp);
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= \' \'))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_WHITE, "[ ! ] USAGE: /report [playerid] [message]");
    return 1;
    }
  new str[128];
  format(str, 128, "[REPORT] %s[%d] has reported %s[%d] for %s",PlayerName(playerid),playerid,PlayerName(giveplayerid),giveplayerid, result);
  for(new i; i<MAX_PLAYERS; i++){
  if(IsPlayerConnected(i) && IsPlayerAdmin(i)){
    SendClientMessage(i, COLOR_RED, str);
    new File: file = fopen("Reports.txt",io_read);
    if(!file){fcreate("Reports.txt");}
    format(str,sizeof(str),"[ ! ] %s has reported %s for %s
"
,PlayerName(playerid),PlayerName(giveplayerid),result);
    fwrite(file,str);
    fclose(file);
  }}
  SendClientMessage(playerid, COLOR_GREEN, "[ ! ] Report sent to online admins!");
  return 1;
}
Is that a basic report command that can be used to report people to admins normaly?
Yes,if you read the code you will see that only admins will get the report
Reply


Messages In This Thread
Report Administrator .txt Command? - by DeltaAirlines12 - 03.10.2009, 22:33
Re: Report Administrator .txt Command? - by brett7 - 03.10.2009, 22:33
Re: Report Administrator .txt Command? - by DeltaAirlines12 - 03.10.2009, 22:38
Re: Report Administrator .txt Command? - by [03]Garsino - 03.10.2009, 22:41
Re: Report Administrator .txt Command? - by coole210 - 04.10.2009, 00:02
Re: Report Administrator .txt Command? - by DeltaAirlines12 - 04.10.2009, 00:14
Re: Report Administrator .txt Command? - by [03]Garsino - 04.10.2009, 00:24
Re: Report Administrator .txt Command? - by DeltaAirlines12 - 04.10.2009, 02:45
Re: Report Administrator .txt Command? - by (.Aztec); - 04.10.2009, 03:32
Re: Report Administrator .txt Command? - by mike25620 - 04.10.2009, 05:21
Re: Report Administrator .txt Command? - by coole210 - 04.10.2009, 20:29

Forum Jump:


Users browsing this thread: 9 Guest(s)