SA-MP Forums Archive
Report Administrator .txt Command? - 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 Administrator .txt Command? (/showthread.php?tid=100277)



Report Administrator .txt Command? - DeltaAirlines12 - 03.10.2009

Ok, I wanna make a command that you type:


/reportadmin [id] [reason]

And it will save the reason in a .txt located in your script files.
Anyone have an idea on how to make a command like that?


Re: Report Administrator .txt Command? - brett7 - 03.10.2009

script request thread


Re: Report Administrator .txt Command? - DeltaAirlines12 - 03.10.2009

Quote:
Originally Posted by brett7
script request thread
?


Re: Report Administrator .txt Command? - [03]Garsino - 03.10.2009

Quote:
Originally Posted by DeltaAirlines12
Quote:
Originally Posted by brett7
script request thread
?
http://forum.sa-mp.com/index.php?topic=114903.0


Re: Report Administrator .txt Command? - coole210 - 04.10.2009

....


Re: Report Administrator .txt Command? - DeltaAirlines12 - 04.10.2009

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?


Re: Report Administrator .txt Command? - [03]Garsino - 04.10.2009

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


Re: Report Administrator .txt Command? - DeltaAirlines12 - 04.10.2009

Yes,if you read the code you will see that only admins will get the report
[/quote]

C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 017: undefined symbol "Logged"
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : warning 215: expression has no effect
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 001: expected token: ";", but found "]"
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 029: invalid expression, assumed zero
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Re: Report Administrator .txt Command? - (.Aztec); - 04.10.2009

Quote:
Originally Posted by DeltaAirlines12
Yes,if you read the code you will see that only admins will get the report
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 017: undefined symbol "Logged"
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : warning 215: expression has no effect
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 001: expected token: ";", but found "]"
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : error 029: invalid expression, assumed zero
C:\Users\Dustin\Desktop\World War 3\gamemodes\WW3.pwn(195) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
[/quote]

if(strcmp(cmd, "/report", true)==0) if(Logged[playerid] == 1)

Remove the bolded part.


Re: Report Administrator .txt Command? - mike25620 - 04.10.2009

I removed the bolded part yet i get a TON of errors

C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(19 : error 017: undefined symbol "tmp"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(19 : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(199) : error 017: undefined symbol "tmp"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(200) : error 017: undefined symbol "tmp"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(202) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(204) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(204) : warning 215: expression has no effect
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(206) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(20 : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(210) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(211) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(211) : warning 215: expression has no effect
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(213) : error 017: undefined symbol "idx"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(219) : warning 217: loose indentation
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(220) : error 017: undefined symbol "PlayerName"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(225) : error 017: undefined symbol "fcreate"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(226) : error 017: undefined symbol "PlayerName"

HELP


Re: Report Administrator .txt Command? - coole210 - 04.10.2009

....