report system.
#1

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.
Reply
#2

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

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?
Reply
#4

//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;
}
Reply
#5

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?
Reply
#6

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

Just copy the text in notepad and save it :P
Reply
#7

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
Reply
#8

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!
Reply
#9

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)