Loading Reports and deleting them
#6

PHP код:
CMD:report(playerid,params[])
{
    new 
Target,reason[50],rstring[128];
    if(
IsJailedOrMuted(playerid))return 1;
    if(
sscanf(params,"us[50]",Target,reason))return SendClientMessage(playerid,GREY,"USAGE: /report [playerid] [reason]");
    if(!
IsPlayerConnectedEx(Target)) return SendClientMessage(playerid,GREY,"Invalid player ID");
    if(
strlen(reason) > 50) return SendClientMessage(playerid,GREY,"Reason can't be longer than 50 characters");
    
format(rstring,sizeof(rstring),"SERVER: {FFFFFF}%s reported %s(Reason: %s)\r\n",PlayerName(playerid),PlayerName(Target),reason);
    
SendMessageToAdmins(RED,rstring);
    
SendClientMessage(playerid,YELLOW,"Your report has been sucessfully sent to the online admins");
      new 
Filefile fopen("report_log.txt"io_append);
    
fwrite(filerstring);
    
fclose(file);
    return 
1;
}
CMD:reports(playeridparams[])
{
    if (
adlvl[playerid] < 1) return 0;
    new 
string[256];
    new 
strings[128], Filefile fopen("report_log.txt"io_read), idxx=1;
    
SendClientMessage(playeridCOLOR_ORANGE"[Server Reports]:");
    while(
fread(filestrings))
    {
        
format(stringssizeof(strings), "%d) %s"idxxstrings);
        
SendClientMessage(playeridCOLOR_ORANGEstrings);
        
AddAdminCmdLog(playeridstring);
        
idxx ++;
    }
    
fclose(file);
    return 
1;

Reply


Messages In This Thread
Loading Reports and deleting them - by Marven - 23.10.2016, 12:04
Re: Loading Reports and deleting them - by Micko123 - 23.10.2016, 12:23
Re: Loading Reports and deleting them - by Vince - 23.10.2016, 12:29
Re: Loading Reports and deleting them - by Marven - 23.10.2016, 12:36
Re: Loading Reports and deleting them - by Marven - 24.10.2016, 07:24
Re: Loading Reports and deleting them - by IceBilizard - 24.10.2016, 10:08

Forum Jump:


Users browsing this thread: 3 Guest(s)