Настройки в исходнике: |
#define ONLY_ACTIVE_WEAPON // заполнять патронами только активное оружие |
// #define ONLY_HEADSHOT_KILL // заполнять патронами только при убийстве в голову |
// Copyright 2017 Vaqtincha
/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
#define ONLY_ACTIVE_WEAPON
// #define ONLY_HEADSHOT_KILL
/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
#define PL_VERSION "0.0.1"
#include <amxmodx>
#include <reapi>
public plugin_init()
{
register_plugin("Refill Weapon On Kill", PL_VERSION, "Vaqtincha")
RegisterHookChain(RG_CSGameRules_DeathNotice, "CSGameRules_DeathNotice", .post = true)
}
public CSGameRules_DeathNotice(const pPlayer, const pKiller, pevInflictor)
{
if(pPlayer == pKiller || !is_user_alive(pKiller) || pKiller != pevInflictor)
return HC_CONTINUE
#if defined ONLY_HEADSHOT_KILL
if(!get_member(pPlayer, m_bHeadshotKilled))
return HC_CONTINUE
#endif
#if defined ONLY_ACTIVE_WEAPON
if(!is_nullent((pevInflictor = get_member(pKiller, m_pActiveItem))))
rg_instant_reload_weapons(pKiller, pevInflictor)
#else
rg_instant_reload_weapons(pKiller)
#endif
return HC_CONTINUE
}