#include #include #include #define PLUGIN "Anti_Self-Gauss" #define VERSION "2.1" #define AUTHOR "LetiLetiLepestok" new g_MaxPlayers, g_Allow public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") RegisterHam ( Ham_TraceAttack, "player", "fw_TraceAttack") g_Allow = register_cvar("antisg_on", "1") g_MaxPlayers = get_maxplayers() } public fw_TraceAttack(victim, inflictor, Float:damage, Float:direction[3], traceresult, damagebits) { if(!get_pcvar_num(g_Allow)) return HAM_IGNORED static e_class[64] if(inflictor == victim && (1 <= inflictor <= g_MaxPlayers)) return HAM_SUPERCEDE else if(pev(inflictor, pev_owner) == victim && pev(inflictor, pev_classname, e_class, 63) && equal(e_class, "weapon_gauss")) return HAM_SUPERCEDE return HAM_IGNORED } public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { static e_class[64] if(attacker != victim || !(1 <= attacker <= g_MaxPlayers) || !get_pcvar_num(g_Allow)) return HAM_IGNORED if (attacker == inflictor || (pev(inflictor, pev_classname, e_class, 63) && equal(e_class, "weapon_gauss"))) return HAM_SUPERCEDE return HAM_IGNORED } /* // Ver 0.6 new allow, messg new e_class[64] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("antisg_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY) allow = register_cvar("antisg_on", "0") // plugin on/off messg = register_cvar("antisg_msg", "0") // self-gauss message RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") } public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if(attacker != victim || !(1 <= attacker <= 32) || !get_pcvar_num(allow)) return HAM_IGNORED pev(inflictor, pev_classname, e_class, 63) if (attacker == inflictor || equal(e_class, "weapon_gauss")) { if(damage > 1 && get_pcvar_num(messg)) client_print(attacker, print_chat, "* You got the self-gauss with power: %d", floatround(damage)) return HAM_SUPERCEDE } return HAM_IGNORED } */ /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } */