Raised This Month: $ Target: $400
 0% 

Admin Abuse Log


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
prozac420
New Member
Join Date: Feb 2007
Old 02-14-2007 , 23:54   Admin Abuse Log
Reply With Quote #1

hi prozac here again i have this problem with a plugin (admin abuse log) it logs everything typed in console and the problem it it spams the advertise message everytime the map is restarted or changed only way to make it stop is in console to type in "amx_cvar aa_advertise" can somone edit this source to make it stop it...Thanks
Quote:
* Written For AMXMODX 1.6
*
* Author: GHW_Chronic
*
* Current Version - 1.3
* -Fixed vote bugs reported by llustig in version 1.3
* -Added Vote system in version 1.2
*
*
*
#include <amxmodx>
#include <amxmisc>

/**************
Init
**************/
new logfile[200]
new bool:usingrcon[33]
new target[33]
new arg2[64][33]
new cvarstring[40][33]
new yes=0
new no=0
new bool:currentlyvoting=false
new bool:currentlyvotingrcon=false
new bool:currentvotedelay=false
public plugin_init()
{
register_plugin("Anti-Admin Abuse All In One","1.3","GHW_Chronic")
register_clcmd("amx_report","reportabuse")
register_clcmd("Yes","saidyes")
register_clcmd("No","saidno")
register_menucmd(register_menuid("aa_votean") ,(1<<0)|(1<<1)|(1<<9),"aa_Pressedvote")
register_cvar("aa_vote_length","45.0")
register_cvar("aa_vote_delay","20.0")
register_cvar("aa_vote_on","1")
register_cvar("aa_advertise","150.0")
new configsdir[200]
get_configsdir(configsdir,199)
format(logfile,199,"%s/admin_abuse_log.log",configsdir)
}

/**************
Advertise
**************/
public Advertise(id)
{
if(is_user_connected(id)) client_print(id,print_chat,"Type amx_report in console to find out how to report Admin Abuse.")
if(is_user_connected(id)) set_task(get_cvar_float("aa_advertise"),"Adve rtise",id)
return PLUGIN_HANDLED
}

/**********************************
Command + Rcon Ececution Recording
**********************************/
public client_connect(id)
{
if(!is_user_bot(id))
{
set_task(6.0,"querytime",id)
set_task(60.0,"Advertise",id)
}
}
public querytime(id)
{
if(is_user_connected(id)) query_client_cvar(id,"rcon_password","rcon_re sult")
return PLUGIN_HANDLED
}
public rcon_result(id,cvarname[],cvarresult[])
{
if(strlen(cvarresult) && !equali(cvarresult,cvarstring[id]))
{
format(cvarstring[id],39,"%s",cvarresult)
new name[32], authid[32]
get_user_name(id,name,31)
get_user_authid(id,authid,31)
new string[500]
new time[200]
format_time(time,199,"%m-%d-%Y - %H:%M:%S",-1)
format(string,499,"%s (%s)",name,authid)
new text2[400]
format(text2,399,"Player set his RCON Pass to %s",cvarresult)
write_file(logfile,"",-1)
write_file(logfile,time,-1)
write_file(logfile,string,-1)
write_file(logfile,text2,-1)
}
set_task(10.0,"querytime",id)
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
format(cvarstring[id],39,"")
usingrcon[id]=false
remove_task(id)
}
public client_command(id)
{
new arg0[64]
read_argv(0,arg0,63)
if(containi(arg0,"amx")==0 && !equali(arg0,"amx_flood_time") && !equali(arg0,"amx_sql_table") && !equali(arg0,"amx_report"))
{
new arg1[64]
new arg22[64]
new arg3[64]
new arg4[64]
new arg5[64]
new arg6[64]
read_argv(1,arg1,63)
read_argv(2,arg22,63)
read_argv(3,arg3,63)
read_argv(4,arg4,63)
read_argv(5,arg5,63)
read_argv(6,arg6,63)
new name[32], authid[32]
get_user_name(id,name,31)
get_user_authid(id,authid,31)
new string[500]
new time[200]
format_time(time,199,"%m-%d-%Y - %H:%M:%S",-1)
format(string,499,"%s (%s)",name,authid)
new text2[400]
format(text2,399,"Command Syntax: %s %s %s %s %s %s %s",arg0,arg1,arg22,arg3,arg4,arg5,arg6)
write_file(logfile,"",-1)
write_file(logfile,time,-1)
write_file(logfile,string,-1)
write_file(logfile,text2,-1)
}
return PLUGIN_CONTINUE
}

/*****************
Handle amx_report
*****************/
public reportabuse(id)
{
new arg1[32]
new arg3[32]
read_argv(1,arg1,31)
read_argv(2,arg2[id],63)
read_argv(3,arg3,31)
if(!strlen(arg1) || !strlen(arg2[id]) || strlen(arg3))
{
console_print(id,"")
console_print(id,"amx_report ^"<admin's name>^" ^"<comment>^" - Report Admin Abuse.")
console_print(id,"Example Usage: amx_report ^"GHW_Chronic^" ^"He slapped me 20 times for no reason.^"")
return PLUGIN_HANDLED
}
target[id] = cmd_target(id,arg1,10)
if(!target[id])
{
return PLUGIN_HANDLED
}
if(!is_user_admin(target[id]))
{
usingrcon[id]=true
console_print(id,"")
console_print(id,"That player is not an admin.")
console_print(id,"Report him anyways? (Yes/No)")
set_task(60.0,"unvar",id)
return PLUGIN_HANDLED
}
new adminname[32]
get_user_name(target[id],adminname,31)
if(get_cvar_num("aa_vote_on"))
{
if(currentvotedelay)
{
console_print(id,"Sorry, It is too soon to start another admin report vote.")
return PLUGIN_HANDLED
}
if(currentlyvoting)
{
console_print(id,"Sorry, There is already another admin abuse report vote in progress..")
return PLUGIN_HANDLED
}
for(new i=1;i<=32;i++)
{
if(is_user_connected(i) && i!=target[id])
{
aa_showvotean(i,target[id],0)
}
}
console_print(id,"A vote to report %s for admin abuse has been started.",adminname)
set_task(get_cvar_float("aa_vote_length"),"vo te_over",id)
}
else
{
new bool:booler=false
write_abuse(id,0,0,booler)
console_print(id,"%s has been reported for admin abuse.",adminname)
}
return PLUGIN_HANDLED
}
public saidno(id)
{
if(!usingrcon[id])
{
return PLUGIN_HANDLED
}
usingrcon[id]=false
new targetname[32]
get_user_name(target[id],targetname,31)
console_print(id,"%s was not reported. If you feel that he could be using RCON to abuse, please report him.",targetname)
return PLUGIN_HANDLED
}
public saidyes(id)
{
if(!usingrcon[id])
{
return PLUGIN_HANDLED
}
new adminname[32]
get_user_name(target[id],adminname,31)
usingrcon[id]=false
if(get_cvar_num("aa_vote_on"))
{
if(currentvotedelay)
{
console_print(id,"Sorry, It is too soon to start another admin report vote.")
return PLUGIN_HANDLED
}
if(currentlyvoting)
{
console_print(id,"Sorry, There is already another admin abuse report vote in progress..")
return PLUGIN_HANDLED
}
for(new i=1;i<=32;i++)
{
if(is_user_connected(i) && i!=target[id])
{
aa_showvotean(i,target[id],1)
}
}
console_print(id,"A vote to report %s for RCON abuse has been started.",adminname)
set_task(get_cvar_float("aa_vote_length"),"vo te_over",id)
}
else
{
new bool:booler=true
write_abuse(id,0,0,booler)
console_print(id,"%s has been reported for RCON abuse.",adminname)
}
return PLUGIN_HANDLED
}
public unvar(id)
{
usingrcon[id]=false
return PLUGIN_HANDLED
}

/***********************
Writing Abuse Complaint
***********************/
public write_abuse(id,yesnum,nonum,bool:rconer)
{
new name[32], authid[32], adminname[32], adminauthid[32]
get_user_name(id,name,31)
get_user_name(target[id],adminname,31)
get_user_authid(id,authid,31)
get_user_authid(target[id],adminauthid,31)
new string[500]
new time[200]
format_time(time,199,"%m-%d-%Y - %H:%M:%S",-1)
format(string,499,"%s (%s) Reported %s (%s) for Admin Abuse. %s's Comment:",name,authid,adminname,adminauthid,n ame)
write_file(logfile,"",-1)
write_file(logfile,"************************* ****",-1)
write_file(logfile,"****** Abuse Report!!! ******",-1)
write_file(logfile,"",-1)
write_file(logfile,time,-1)
write_file(logfile,string,-1)
write_file(logfile,arg2[id],-1)
if(yesnum+nonum)
{
new string2[100]
format(string2,99,"%d / %d people voted that he was abusing his powers.",yesnum,yesnum + nonum)
write_file(logfile,string2,-1)
}
if(rconer)
{
write_file(logfile,"User is not admin, however he could be using RCON to abuse people.",-1)
}
write_file(logfile,"",-1)
write_file(logfile,"************************* ****",-1)
console_print(id,"%s has been reported for admin abuse.",adminname)
return PLUGIN_HANDLED
}

/*********************
Vote Show
*********************/
public aa_showvotean(id,admin,rconer)
{
yes=0
no=0
currentlyvoting=true
currentlyvotingrcon=false
if(rconer)
{
currentlyvotingrcon=true
}
new adminname[32]
get_user_name(admin,adminname,31)
new menuBody[576]
new len
if(!rconer)
{
len = format(menuBody,575,"\bIs %s abusing his admin powers?^n^n",adminname)
}
else
{
len = format(menuBody,575,"\bIs %s abusing his RCON powers?^n^n",adminname)
}
len += format(menuBody[len],575-len, "\w1. Yes^n")
len += format(menuBody[len],575-len, "\w2. No^n^n")
len += format(menuBody[len],575-len, "\w0. Not Sure.")
show_menu(id,(1<<0)|(1<<1)|(1<<9),menuBody,-1,"aa_votean")
}

/*********************
Vote Handle
*********************/
public aa_Pressedvote(id,key)
{
if(!currentlyvoting)
{
return PLUGIN_CONTINUE
}
switch(key)
{
case 0:
{
yes++
client_print(0,print_chat,"[ Yes ]")
}
case 1:
{
no++
client_print(0,print_chat,"[ No ]")
}
case 9:
{
client_print(0,print_chat,"[ Don't Care ]")
}
}
return PLUGIN_CONTINUE
}

/*********************
Vote Over
*********************/
public vote_over(id)
{
write_abuse(id,yes,no,currentlyvotingrcon)
client_print(0,print_chat,"Vote finished. %d [Yes] - %d [No]",yes,no)
yes=0
no=0
currentlyvoting=false
currentlyvotingrcon=false
currentvotedelay=true
set_task(get_cvar_float("aa_vote_delay"),"end delay")
return PLUGIN_HANDLED
}
public enddelay()
{
currentvotedelay=false
return PLUGIN_HANDLED
}
prozac420 is offline
Martin1
BANNED
Join Date: May 2006
Old 02-16-2007 , 09:50   Re: Admin Abuse Log
Reply With Quote #2

Please indent this, it hurts my eyes
Martin1 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-16-2007 , 12:20   Re: Admin Abuse Log
Reply With Quote #3

If the no indent hurts your eyes, here is the plugins topic ( http://forums.alliedmods.net/showthr...738#post207738 )


Also, it says in that topic this
Quote:
Log file can get pretty large if not checked daily / weekly depending on the number of admins on your server. After Checking the log file IT IS OK TO DELETE THE LOG FILE, and a new one will take its place.
So, I think it is supposed to do that. If you want it removed, it might be better to ask in that topic than here. But, I don't know
YamiKaitou is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode