引用 | 编辑
龙心
2017-09-06 23:33 |
楼主
▼ |
||
![]() 图 1. ![]() 【插件资讯】 插件来源:网路资源转载提供会员参考 http://bbs.mychat.tw/reads.php?tid=927921 使用指令:自行修改编译及参考http://bbs.mychat.tw/reads.php?tid=927921 安装路径:自行修改编译及参考http://bbs.mychat.tw/reads.php?tid=927921 【插件介绍】 复制程式 new cumulative[33]; new g_Time; new g_Amount; new Float:get_attack_time[33]; new g_hamczbots; new cvar_botquota; public plugin_init() { register_plugin(320, "1.0", 412); register_event("Damage", "NeedRecovery", "be", "2>0"); register_event("HLTV", "event_round_start", "a", "1=0", "2=0"); g_Time = register_cvar("mychat_recovery_time", "3", 0, 0.00); g_Amount = register_cvar("mychat_recovery_health", "20", 0, 0.00); RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage", 0); return 0; } public plugin_precache() { precache_sound("mychat/memberid_604597/post_in_mychat.wav"); return 0; } public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if (attacker != victim && !is_user_connected(attacker)) { return 1; } if (zp_get_user_zombie(victim) == zp_get_user_zombie(attacker)) { return 1; } if (!zp_get_user_zombie(victim)) { return 1; } if (!damage_type & 2 || !damage_type & 4) { return 1; } static id; id = victim; if (task_exists(id, 0)) { remove_task(id, 0); } if (task_exists(id + 9988, 0)) { remove_task(id + 9988, 0); } cumulative[id] = 0; return 1; } public NeedRecovery(id) { if (!is_user_alive(id) || !zp_get_user_zombie(id)) { return 0; } if (1 <= cumulative[id][0][0]) { return 0; } new max_health = 0; max_health = zp_get_zombie_maxhealth(id); if (max_health > get_user_health(id)) { new var2 = cumulative[id]; var2 = var2[0][0] + 1; new param[2]; param[0] = id; if (cumulative[id][0][0] == 1) { param[1] = 0; set_task(get_pcvar_float(g_Time), "RecoveryRate", id, param, 2, "b", 0); } else { param[1] = 1; set_task(get_pcvar_float(g_Time), "RecoveryRate", id + 9988, param, 2, "", 0); } } return 0; } public RecoveryRate(param[2]) { if (!is_user_alive(id) || !zp_get_user_zombie(id)) { return 0; } new health = get_user_health(id); new max_health = 0; max_health = zp_get_zombie_maxhealth(id); new need_health = max_health - health; if (get_pcvar_num(g_Amount) >= need_health) { engfunc(EngFunc_EmitSound, id, 2, "mychat/memberid_604597/post_in_mychat.wav", 1.00/*1065353216*/, 0.80/*1061997773*/, 0, 100); set_user_health(id, max_health); remove_task(id, 0); remove_task(id + 9988, 0); cumulative[id] = 0; } else { set_user_health(id, get_pcvar_num(g_Amount) + health); if (deduct_times == 1) { cumulative[id] = max(cumulative[id][0][0] - 1, 0); } } return 0; } public client_PreThink(id) { if (!is_user_alive(id) || !zp_get_user_zombie(id)) { return 0; } if (get_gametime() - get_attack_time[id][0][0] < 0.50/*1056964608*/) { if (task_exists(id, 0)) { remove_task(id, 0); } if (task_exists(id + 9988, 0)) { remove_task(id + 9988, 0); } cumulative[id] = 0; return 0; } new speed = fm_get_speed(id); if (floatround(0.10/*1036831949*/ * 240, floatround_round) < speed) { if (task_exists(id, 0)) { remove_task(id, 0); } if (task_exists(id + 9988, 0)) { remove_task(id + 9988, 0); } cumulative[id] = 0; return 0; } if (!task_exists(id, 0)) { cumulative[id] = 0; } new health = get_user_health(id); if (health >= 1) { if (health < max_health && cumulative[id][0][0]) { NeedRecovery(id); } } return 0; } public event_round_start() { new i = 1; while (i <= 32) { cumulative[i] = 0; i++; } client_print(0, print_chat, "仿CSO丧尸自愈插件 By MyChat - 文♂[会员ID:604597],此插件仅发布于MyChat数位男女论坛,若出现于其他论坛均为盗文!"); return 0; } public client_putinserver(id) { if (is_user_bot(id)) { if (!g_hamczbots && cvar_botquota) { set_task(0.10, "register_ham_czbots", id, "", 0, "", 0); } } return 0; } public register_ham_czbots(id) { if (g_hamczbots || !is_user_connected(id) || !get_pcvar_num(cvar_botquota)) { return 0; } RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage", 0); g_hamczbots = 1; return 0; } fm_get_speed(entity) { static Float:velocity[3]; pev(entity, pev_velocity, velocity); return floatround(vector_length(velocity), floatround_round); } ![]()
|
引用 | 编辑
qq1677438990
2017-09-09 11:07 |
1楼
▲ ▼ |
没图吗
![]() |
引用 | 编辑
zxzyman
2017-09-09 21:26 |
2楼
▲ ▼ |
原文没有提供SMA 他提供的是部分写法,并非复制文章
你发的文章内容根本无法转档,原码内都缺少inc 建议在文内写上一些只供参考的说明,免得其他人无法转档造成误会.... ![]() |
引用 | 编辑
龙心
2017-11-04 23:44 |
5楼
▲ ▼ |
下面是引用 zxzyman 于 2017-09-09 21:26 发表的 : 【插件资讯】 ![]() ![]() |