SA-MP Forums Archive
report system. - 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: report system. (/showthread.php?tid=40769)



report system. - Nakash - 22.06.2008

I'm looking for a report system.
I mean player does /report blabla
It writes his report + id + to admins [if you want to take care of this report type /tr]
And player can't write a 2 report in 30 seconds,i mean one report in 30 seconds its the max.



Re: report system. - Yuval_Baruch - 22.06.2008

look in GF script... and add timer in the /report for 30sec...
and than allow him to report again...


Re: report system. - Nakash - 22.06.2008

Quote:
Originally Posted by Yuval_Baruch
look in GF script... and add timer in the /report for 30sec...
and than allow him to report again...
I dunno how,can you give me an example?


Re: report system. - Sandra18[NL] - 22.06.2008

//On top of your script:
Код:
new LastReport[MAX_PLAYERS];
//OnPlayerCommandText:
Код:
if(strcmp(cmdtext, "/report", true, 7)==0)
{
  if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /report [message]");
  new str[128];
  if((gettime()-LastReport[playerid]) < 30)
  {
    format(str, 128, "You have to wait %d seconds before you can send a new report!", (30-(gettime()-LastReport[playerid])));
	SendClientMessage(playerid, 0xFF0000AA, str); return 1;
  }
  format(str, 128, "[REPORT] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
  for(new i; i<MAX_PLAYERS; i++){
  if(IsPlayerConnected(i) && IsPlayerAdmin(i)){
    SendClientMessage(i, 0x00FFFFAA, str);
  }}
  SendClientMessage(playerid, 0x00FF00AA, "Report send to online admins!");
  LastReport[playerid] = gettime();
  return 1;
}



Re: report system. - Blt950 - 23.07.2008

Quote:
Originally Posted by =>Sandra<=
//On top of your script:
Код:
new LastReport[MAX_PLAYERS];
//OnPlayerCommandText:
Код:
if(strcmp(cmdtext, "/report", true, 7)==0)
{
  if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /report [message]");
  new str[128];
  if((gettime()-LastReport[playerid]) < 30)
  {
    format(str, 128, "You have to wait %d seconds before you can send a new report!", (30-(gettime()-LastReport[playerid])));
	SendClientMessage(playerid, 0xFF0000AA, str); return 1;
  }
  format(str, 128, "[REPORT] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
  for(new i; i<MAX_PLAYERS; i++){
  if(IsPlayerConnected(i) && IsPlayerAdmin(i)){
    SendClientMessage(i, 0x00FFFFAA, str);
  }}
  SendClientMessage(playerid, 0x00FF00AA, "Report send to online admins!");
  LastReport[playerid] = gettime();
  return 1;
}
Nice! Can you just make so it saves it in a .txt?


Re: report system. - Bogdan Cirstea - 23.07.2008

Nice! Can you just make so it saves it in a .txt?

Just copy the text in notepad and save it :P


Re: report system. - Blt950 - 23.07.2008

Quote:
Originally Posted by [BJT
Namtih ]
Nice! Can you just make so it saves it in a .txt?

Just copy the text in notepad and save it :P
But when no admin online.. will noone get it.. so it need to be like dudb or somthing


Re: report system. - superbryanb - 13.06.2009

Quote:
Originally Posted by =>Sandra<=
//On top of your script:
Код:
new LastReport[MAX_PLAYERS];
//OnPlayerCommandText:
Код:
if(strcmp(cmdtext, "/report", true, 7)==0)
{
  if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /report [message]");
  new str[128];
  if((gettime()-LastReport[playerid]) < 30)
  {
    format(str, 128, "You have to wait %d seconds before you can send a new report!", (30-(gettime()-LastReport[playerid])));
	SendClientMessage(playerid, 0xFF0000AA, str); return 1;
  }
  format(str, 128, "[REPORT] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
  for(new i; i<MAX_PLAYERS; i++){
  if(IsPlayerConnected(i) && IsPlayerAdmin(i)){
    SendClientMessage(i, 0x00FFFFAA, str);
  }}
  SendClientMessage(playerid, 0x00FF00AA, "Report send to online admins!");
  LastReport[playerid] = gettime();
  return 1;
}
Thnx Sandra!


Re: report system. - Battlaman - 31.07.2009