【急!】200点通币求僵尸回血插件
本帖最后由 8874323 于 2009-5-10 05:16 编辑100点通币求ZP僵尸回血插件
求丧尸回血插件
每秒回血3HP 回血时 HP显示0~255 有的发下。。。 #include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <zombieplague>
#include <hamsandwich>
new g_maxplayers
new cvar_replyhp,cvar_replytime,cvar_replymaxhp,cvar_reply_on
public plugin_init()
{
register_plugin("ZP ReplyHp", "1.0", "Jakyo")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
cvar_reply_on = register_cvar("zp_reply_time", "1") // 插件开关
cvar_replytime = register_cvar("zp_reply_time", "3") // 回血间隔
cvar_replyhp = register_cvar("zp_reply_hp", "9") // 回血数
cvar_replymaxhp = register_cvar("zp_reply_maxhp", "0") // 回血量能超过上限,默人关闭
g_maxplayers = get_maxplayers()
}
// 会合开始
public event_round_start()
{
remove_task(121913)
if (get_pcvar_num(cvar_reply_on))
{
set_task(get_pcvar_float(cvar_replytime), "reply_hp", 121913, _, _, "b")
}
}
public reply_hp()
{
for (new id = 1; id <= g_maxplayers; id++)
{
if (is_user_connected(id))
{
if (is_user_alive(id))
{
if (zp_get_user_zombie(id))
{
if (get_pcvar_num(cvar_replymaxhp))
{
fm_set_user_health(id, pev(id, pev_health)+ get_pcvar_num(cvar_replyhp))
}
else
{
if (pev(id, pev_health)+get_pcvar_num(cvar_replyhp)==zp_get_zombie_maxhealth(id))
{
continue;
}
else if (pev(id, pev_health)+get_pcvar_num(cvar_replyhp)>=zp_get_zombie_maxhealth(id))
{
fm_set_user_health(id, zp_get_zombie_maxhealth(id))
}
else
{
fm_set_user_health(id, pev(id, pev_health)+ get_pcvar_num(cvar_replyhp))
}
}
}
}
}
}
}
// 设置玩家血量
stock fm_set_user_health(id, health)
{
(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
} 未测试. 我也下过这个插件,但是没找到原码,我做的僵尸服里没加这个插件 不是我想要的 。。。。。。。。。 本帖最后由 KzFun.小鱼 于 2009-5-10 05:40 编辑
#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));
}
是否是这个 世界上没有不劳而获
页:
[1]