Can someone tell me what I'm doing wrong? Sometimes it works sometimes not...
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#define PLUGIN "Anti HE"
#define VERSION "1.0"
#define AUTHOR "Toster v 2.1"
new wname
new clip,ammo
new file[128]
new buf[128]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink, "Prethink", 0)
checkmap()
register_cvar("amx_antihe","1")
}
public Prethink(id)
{
wname=get_user_weapon(id,clip,ammo)
if(get_cvar_num("amx_antihe")!=0)
{
if((pev(id,pev_button)&IN_ATTACK)&&wname==4)
{
set_pev(id,pev_button,IN_CANCEL)
}
}
}
public checkmap()
{
if(get_cvar_num("amx_antihe")!=0)
{
set_cvar_num("amx_antihe",0)
get_configsdir(file,127)
format(file[strlen(file)],127-strlen(file),"/antihemaps.txt")
new trash
new next
new cur[128]
get_mapname(cur,127)
while((next = read_file(file,next,buf,127,trash)) != 0)if(equali(cur,buf))set_cvar_num("amx_antihe",1)
}
}
antihemaps.txt
Code:
cs_deagle5
deagleknivez
fy_pool_day
__________________