痾 抱歉又是我
問大大 如果我想將某隻殭屍擁有感染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