I made an plugin for zombie plague mod where I checking if an human shot in head an AFK zombie then victim will be kicked .but I need to check this for many times because i tested and if an zombie is not moving and i shot in head he is kicked from first head shot and i need to be kicked from a many head shots here is the code .
in the code you will se farm ... i am not shure what is mean for you but i called this when 2 players make team to make ammo packs faster , when zonbie stay and human shot him to make more ammo packs .
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#define m_LastHitGroup 75
new g_oldangles[33][3]
public plugin_init()
{
register_plugin("Anti-Farm","1.0","killer zm")
RegisterHam( Ham_TakeDamage, "player", "CheckFarmers", 1 );
}
public CheckFarmers(victim, inflictor, attacker, Float:damage, damage_type)
{
for (new i = 1; i <= get_maxplayers(); i++)
{
if( is_user_alive(i) && zp_get_user_zombie(i) && get_pdata_int( i, m_LastHitGroup ) == HIT_HEAD )
{
if (is_user_alive(i) && zp_get_user_zombie(i) && is_user_connected(i))
{
new newangle[3]
get_user_origin(i, newangle)
if ( newangle[0] == g_oldangles[i][0] && newangle[1] == g_oldangles[i][1] && newangle[2] == g_oldangles[i][2] )
{
new name[32]
get_user_name(i, name, 31)
new afkattacker = attacker
client_print(0, print_chat, "[A-F] %s was kicked for farm with %s", name, afkattacker)
log_amx("[A-F] %s was kicked for farm with %i", name, afkattacker)
server_cmd("kick #%d ^"[A-F] You was kicked for farm with %s^"", get_user_authid(victim), afkattacker)
}
else
{
g_oldangles[i][0] = newangle[0]
g_oldangles[i][1] = newangle[1]
g_oldangles[i][2] = newangle[2]
return PLUGIN_CONTINUE
}
}
}
}
return PLUGIN_HANDLED
}