搜索
查看: 4046|回复: 7

[AMXX 带源码] 【急!】200点通币求僵尸回血插件

[复制链接]
发表于 2009-5-6 12:52:08 | 显示全部楼层 |阅读模式 来自 中国–广东–韶关
本帖最后由 8874323 于 2009-5-10 05:16 编辑

100点通币求ZP僵尸回血插件

求丧尸回血插件
每秒回血3HP 回血时 HP显示0~255
 楼主| 发表于 2009-5-9 14:30:26 | 显示全部楼层 来自 中国–广东–韶关
有的发下。。。
回复

使用道具 举报

发表于 2009-5-9 16:06:36 | 显示全部楼层 来自 中国–广东–深圳
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <engine>
  5. #include <zombieplague>
  6. #include <hamsandwich>

  7. new g_maxplayers
  8. new cvar_replyhp,cvar_replytime,cvar_replymaxhp,cvar_reply_on

  9. public plugin_init()
  10. {
  11.         register_plugin("ZP ReplyHp", "1.0", "Jakyo")
  12.         register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  13.         cvar_reply_on   = register_cvar("zp_reply_time", "1")                        // 插件开关
  14.         cvar_replytime    = register_cvar("zp_reply_time", "3")                        // 回血间隔
  15.         cvar_replyhp             = register_cvar("zp_reply_hp", "9")                        // 回血数
  16.         cvar_replymaxhp   = register_cvar("zp_reply_maxhp", "0")                // 回血量能超过上限,默人关闭
  17.         g_maxplayers = get_maxplayers()
  18.        
  19. }


  20. // 会合开始
  21. public event_round_start()
  22. {
  23.         remove_task(121913)
  24.         if (get_pcvar_num(cvar_reply_on))
  25.         {
  26.                 set_task(get_pcvar_float(cvar_replytime), "reply_hp", 121913, _, _, "b")
  27.         }
  28. }
  29. public reply_hp()
  30. {
  31.         for (new id = 1; id <= g_maxplayers; id++)
  32.         {
  33.                 if (is_user_connected(id))
  34.                 {
  35.                         if (is_user_alive(id))
  36.                         {
  37.                                 if (zp_get_user_zombie(id))
  38.                                 {
  39.                                         if (get_pcvar_num(cvar_replymaxhp))
  40.                                         {
  41.                                                 fm_set_user_health(id, pev(id, pev_health)+ get_pcvar_num(cvar_replyhp))
  42.                                         }
  43.                                         else
  44.                                         {
  45.                                                 if (pev(id, pev_health)+get_pcvar_num(cvar_replyhp)==zp_get_zombie_maxhealth(id))
  46.                                                 {
  47.                                                         continue;
  48.                                                 }
  49.                                                 else if (pev(id, pev_health)+get_pcvar_num(cvar_replyhp)>=zp_get_zombie_maxhealth(id))
  50.                                                 {
  51.                                                         fm_set_user_health(id, zp_get_zombie_maxhealth(id))
  52.                                                 }
  53.                                                 else
  54.                                                 {
  55.                                                         fm_set_user_health(id, pev(id, pev_health)+ get_pcvar_num(cvar_replyhp))
  56.                                                 }
  57.                                         }
  58.                                 }
  59.                         }
  60.                 }

  61.         }       
  62. }

  63. // 设置玩家血量
  64. stock fm_set_user_health(id, health)
  65. {
  66.         (health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
  67. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2009-5-9 16:06:54 | 显示全部楼层 来自 中国–广东–深圳
未测试.
回复

使用道具 举报

发表于 2009-5-9 21:05:54 | 显示全部楼层 来自 中国–安徽–合肥
我也下过这个插件,但是没找到原码,我做的僵尸服里没加这个插件
回复

使用道具 举报

 楼主| 发表于 2009-5-10 05:14:41 | 显示全部楼层 来自 中国–广东–韶关
不是我想要的 。。。。。。。。。
回复

使用道具 举报

发表于 2009-5-10 05:36:41 | 显示全部楼层 来自 中国–湖北–黄冈
本帖最后由 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));
}

是否是这个

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2013-2-14 15:39:50 | 显示全部楼层 来自 中国–辽宁–鞍山–海城市
世界上没有不劳而获
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表