痾 抱歉又是我
问大大 如果我想将某只僵尸拥有感染x人后就换模组且加乘血量
那我可以将这些指令加上去吗?(取自abcdzxc大大的暴走僵尸)
首先
new const kzm_kills = 3 // 感染多少人才会进化为僵尸王
new const kkzm_kills = 5 // 感染多少人才会进化为僵尸魔王
new const first_zclass_model[] = { "zombie_source" } // 僵尸王的模组
接着
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
g_kzm_health = register_cvar("zp_zclass_kzm_health", "7000")
g_kkzm_health = register_cvar("zp_zclass_kkzm_health", "14000")
register_forward(FM_PlayerPreThink, "fw_playerprethink")
register_forward(FM_ClientUserInfoChanged, "fw_changemodel")
register_clcmd("drop", "cmd_drop")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
再来
public plugin_precache()
{
new model[64]
format(model, 63, "models/player/%s/%s.mdl", first_zclass_model, first_zclass_model)
first_zm_model = precache_model(model)
precache_sound(rage_sound)
precache_sound(change_sound)
g_zclass_rage = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public zp_user_infected_post(id, infector)
{
if (zp_gamemode == MODE_INFECTION || zp_gamemode == MODE_MULTI)
{
if (is_user_alive(infector) && zp_get_user_zombie(infector) && zp_get_user_zombie_class(infector) == g_zclass_rage)
{
infect_num[infector]++
if (!g_kzm[infector] && !g_kkzm[infector] && infect_num[infector] == kzm_kills)
{
g_kzm[infector] = true
fm_set_user_model(infector, first_zclass_model)
fm_set_user_model_index(infector, first_zm_model)
set_pev(infector, pev_health, float(get_pcvar_num(g_kzm_health)))
client_print(infector, print_chat, "[ZP] 你进化成为僵尸王!!!")
engfunc(EngFunc_EmitSound, infector, CHAN_VOICE, change_sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
infect_num[infector] = 0
}
if (g_kzm[infector] && !g_kkzm[infector] && infect_num[infector] == kkzm_kills)
{
g_kkzm[infector] = true
set_pev(infector, pev_health, float(get_pcvar_num(g_kkzm_health)))
client_print(infector, print_chat, "[ZP] 你进化成为僵尸魔王,你现在有大量的血量来使用'暴走'技能!!!")
engfunc(EngFunc_EmitSound, infector, CHAN_VOICE, change_sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
}
if (zp_get_user_zombie_class(id) == g_zclass_rage)
set_task(0.5, "show_zm_msg", id)
}
还有
public show_zm_msg(id)
{
if (g_kzm[id])
client_print(id, print_chat, "[ZP] 你被感染为僵尸王,按G可以使用'暴走'技能,损失血量%d,效用时间%2.1f秒.", get_pcvar_num(g_health), get_pcvar_float(g_time))
else
client_print(id, print_chat, "[ZP] 你被感染为小僵尸,按G可以使用'暴走'技能,损失血量%d,效用时间%2.1f秒,冷却时间%2.1f秒", get_pcvar_num(g_health), get_pcvar_float(g_normal_time), get_pcvar_float(g_cooldown))
}
就这样
我知道我这样必定是乱加 (真的不懂插件..抱歉)
还有甚么需要再加或修改的地方吗??
那如果我这方法行的通
这些指令会不会影响到原来僵尸的技能?
烦请各位大大帮忙了
对了这是插件的sma