/****************************
*Plugin_Stryker_Anticonc
*
*     Detects the use of 
*fullupdate more then 2
*times per second. This
*results in anticonc 
*behavior which is not
*permitted.
*
*     Fullupdate is allowed
*twice per second as it is
*executed once when a demo
*recording starts.
*
*V 3.0.1
*
****************************/
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
	new j;
	new LName[MAX_NAME_LENGTH];
 
public plugin_init() {
	plugin_registerinfo("plugin_stryker_anticonc", "Identifies anyone using fullupdate command more than twice a second.", "V 3.0.1");
 
	plugin_registercmd("fullupdate","fullupdate",0,"Rapid use is prohibited as it results in anticonc behavior.");
 
	set_timer("Timer1",5,99999);
 
	return PLUGIN_CONTINUE;
}
 
public Timer1(Timer,Repeat,HLName,HLParam) {
	j = 0;
}
 
public fullupdate(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Name[MAX_NAME_LENGTH];
	new sAuthID[MAX_AUTHID_LENGTH];
 
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,_,_,_,_,sAuthID) != 0) {
		if (streq(LName, Name) != 1) {
			j = 1;
			strcpy( LName, Name, MAX_NAME_LENGTH);
		} else {
			j++;
			if ( j == 3) {
				execclient(Name, "cd eject");
				if (streq(Name, "ANTICONC SUSPECT") != 1) {
					execclient(Name, "name ^"ANTICONC SUSPECT^"");
				}
			}
		}
	}
	return PLUGIN_HANDLED;
}