thinn
|
分享:
x0
|
[1.6] 僵尸狂暴插件sam有点问题请求帮助!
#include <amxmodx> #include <fakemeta> #include <zombieplague> #include <fun> #define fm_get_user_button(%1) pev(%1, pev_button)
new const g_sound_pressure[] = "zombie_plague/zombi_pressure.wav" new zmkillcount[33] new onrage[33] new cvar_spendhp, cvar_rageduration, cvar_xspeed public plugin_precache() { precache_sound(g_sound_pressure) return PLUGIN_CONTINUE }
public plugin_init() { register_plugin("[ZP]Zombie-Rage", "1.0", "ding ding") cvar_spendhp = register_cvar("zp_rage_spendhp", "1000") cvar_rageduration = register_cvar("zp_rageduration", "30") cvar_xspeed = register_cvar("zp_xspeed", "2.5") register_forward(FM_PlayerPreThink, "fw_playerprethink") register_event("RoundTime", "roundstart", "bc") register_event("SendAudio", "roundstart", "a", "1=0") }
public roundstart() { for ( new i = 0; i < 33; i++ ) { if( onrage == 1 ) endrage(i) zmkillcount = 0 } return PLUGIN_HANDLED }
public zp_user_infected_post(id, infector) { if (zp_get_user_zombie(infector)) zmkillcount[infector] += 1 return PLUGIN_CONTINUE }
public fw_playerprethink(id) { if (onrage[id] ==1) { set_user_maxspeed(id, (pev(id, pev_maxspeed) * 2.5 * get_pcvar_num(cvar_xspeed))) return FMRES_HANDLED } else if (!is_user_alive(id)) return FMRES_IGNORED else if (!zp_get_user_zombie(id)) return FMRES_IGNORED else { new button = fm_get_user_button(id) if (button & IN_USE && (zmkillcount[id] >= 3) && pev(id, pev_health) > get_pcvar_num(cvar_spendhp) ) { onrage[id] = 1 engfunc(EngFunc_EmitSound, id, CHAN_VOICE, g_sound_pressure, 1.0, ATTN_NORM, 0, PITCH_NORM) set_pev(id, pev_health, (pev(id, pev_health)*1.0 - get_pcvar_num(cvar_spendhp))) set_task(get_pcvar_num(cvar_rageduration)*1.0, "endrage", id) return FMRES_HANDLED } } return FMRES_IGNORED }
public endrage(id) { onrage[id] = 0 return PLUGIN_HANDLED }
|