|
发表于 2009-5-9 16:06:36
|
显示全部楼层
来自 中国–广东–深圳
- #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);
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|