Łap:/* AMX Mod X
* Admin no recoil
*
* / \ / \ ___________________________
* / / \_/ \ \ / \
* \__/\ /\__/ / GIVE ME A CARROT OR I WILL \
* \O O/ \ BLOW UP YOUR HOUSE /
* ___/ ^ \___ / ___________________________/
* \___/ /_/
* _/ \_
* __// \\__
* /___\/_\/___\
*
* (c) Copyright 2008 by FakeNick
*
* This file is provided as is (no warranties)
*
* DESCRIPTION
* This plugin allows admins with ADMIN_KICK flag to earn no recoil.
*
* MODULES
* fakemeta
* hamsandwich
*
* CVARS
* admin_no_recoil_on - turns plugin on/off
* admin_no_recoil_sound - turns "activated" sound on/off
*
* VERSIONS
* 1.0 - first release
*
*/
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
new const VERSION[] = "1.0"
new const sound_activated[] = "norecoil/activ.wav"
new pcvar_on,pcvar_sound
new g_norecoil[33],Float:g_angle[3] = {0.0,0.0,0.0}
public plugin_init()
{
register_plugin("Admin no recoil", VERSION, "FakeNick");
pcvar_on = register_cvar("admin_no_recoil_on","1");
if(get_pcvar_num(pcvar_on))
{
pcvar_sound = register_cvar("admin_no_recoil_sound","1")
RegisterHam(Ham_Spawn,"player","func_spawn",1);
register_forward(FM_PlayerPreThink,"func_prethink");
}
}
public plugin_precache()
{
engfunc(EngFunc_PrecacheSound,sound_activated);
}
public func_spawn(id)
{
if(!is_user_alive(id))
return;
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
g_norecoil[id] = true;
if(get_pcvar_num(pcvar_sound))
client_cmd(id,"spk %s",sound_activated);
client_print(id,print_chat,"[ANR] Admin no recoil activated! Have Fun!");
}
}
public func_prethink(id)
{
if(!is_user_alive(id) && !g_norecoil[id])
return;
set_pev(id,pev_punchangle,g_angle);
}