|
本帖最后由 KzFun.小鱼 于 2009-5-10 05:54 编辑
我只发源码
不是本人原创 貌似去年的东西 不过这个插件感觉很好用
我看到有人需要 就发出来了
算是转帖的吧!
转自
10-21-08 , 02:58 AM ZP: Regeneration
zp_regeneration <1|0> - 开启/关闭插件[默认1].
zp_regen_time <#> - 每多少秒的间隔自动回血[默认1].
zp_regen_amount <#> - 每次回血多少点[默认10].
zp_regen_nemesis <1|0> - 开启/关闭复仇者的自动回血的功能[默认1].
zp_regen_firstzombie <1|0> - 开启/关闭第一个僵尸自动回血的功能[默认1].
zp_regen_lastzombie <1|0> - 开启/关闭最后一个僵尸自动回血的功能[默认1].
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
new g_Status, g_Time, g_Amount, g_ZombiePlague, g_Nemesis, g_FirstZombie, g_LastZombie;
public plugin_init()
{
register_plugin("ZP: Regeneration", "1.2 Final Fixed", "hleV");
g_Status = register_cvar("zp_regeneration", "1");
g_Time = register_cvar("zp_regen_time", "1");
g_Amount = register_cvar("zp_regen_amount", "10");
g_Nemesis = register_cvar("zp_regen_nemesis", "1");
g_FirstZombie = register_cvar("zp_regen_firstzombie", "1");
g_LastZombie = register_cvar("zp_regen_lastzombie", "1");
register_event("Damage", "SetRegeneration", "be", "2>0");
g_ZombiePlague = get_cvar_pointer("zp_on");
}
public SetRegeneration(Client)
{
if (!g_ZombiePlague || !get_pcvar_num(g_Status) || !is_user_connected(Client) || !is_user_alive(Client) || !zp_get_user_zombie(Client))
return;
new Health = get_user_health(Client);
if (Health < 1)
return;
if (!get_pcvar_num(g_Nemesis) && zp_get_user_nemesis(Client))
return;
if (!get_pcvar_num(g_FirstZombie) && zp_get_user_first_zombie(Client))
return;
if (!get_pcvar_num(g_LastZombie) && zp_get_user_last_zombie(Client))
return;
if (get_user_health(Client) < zp_get_zombie_maxhealth(Client))
set_task(get_pcvar_float(g_Time), "Regenerate", Client, _, _, "b");
}
public Regenerate(Client)
{
if (!g_ZombiePlague || !get_pcvar_num(g_Status) || !is_user_connected(Client) || !is_user_alive(Client))
return;
new Health = get_user_health(Client);
if (Health < 1)
return;
new NeededHealth = zp_get_zombie_maxhealth(Client) - Health;
if (NeededHealth <= get_pcvar_num(g_Amount))
{
set_pev(Client, pev_health, Health + float(NeededHealth));
remove_task(Client);
return;
}
set_pev(Client, pev_health, Health + get_pcvar_float(g_Amount));
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|