Veteran Member
Join Date: Oct 2013
Location: Serbia
|
04-25-2019
, 06:30
Re: Biohazard v2.00 Beta 3b (Zombie Mod)
|
#4072
|
https://forums.alliedmods.net/showthread.php?t=215468
Dasher zombie for biohazard mod.
I set that every zombie has this ability( because I do not use classes but zombie evolution).
If somebody needs for particular class,maybe we can adjust it.
PHP Code:
#include <amxmodx> #include <engine> #include <fakemeta_util> #include <biohazard>
new bool:g_cooldown[33], g_rushing[33], cvar_rush
public plugin_precache() { register_plugin("[BIO] Class: Rusher Zombie", "1.0", "Catastrophe") register_clcmd("drop","do_rush") cvar_rush = register_cvar("rush_cooldown","20.0") }
public do_rush(ent) { if(!is_user_alive(ent) || g_cooldown[ent] || !is_user_zombie(ent)) return
if(!(pev(ent, pev_flags) & FL_ONGROUND)) return
g_cooldown[ent] = true g_rushing[ent] = true
set_task(0.1, "rush_now", ent) set_task(get_pcvar_float(cvar_rush),"reset_cooldown",ent) set_task(1.0,"resetmd",ent) }
public rush_now(ent) { if(!is_user_alive(ent)) return static Float:Origin[3] get_position(ent, 1000.0, 0.0, 0.0, Origin) hook_ent2(ent, Origin, 2000.0) }
public reset_cooldown(id) { g_cooldown[id] = false }
public resetmd(id) { g_rushing[id] = false }
stock get_position(ent, Float:forw, Float:right, Float:up, Float:vStart[]) { new Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3] pev(ent, pev_origin, vOrigin) pev(ent, pev_view_ofs,vUp) //for player xs_vec_add(vOrigin,vUp,vOrigin) pev(ent, pev_v_angle, vAngle) // if normal entity ,use pev_angles vAngle[0] = 0.0 angle_vector(vAngle,ANGLEVECTOR_FORWARD,vForward) //or use EngFunc_AngleVectors angle_vector(vAngle,ANGLEVECTOR_RIGHT,vRight) angle_vector(vAngle,ANGLEVECTOR_UP,vUp) vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up }
stock hook_ent2(ent, Float:VicOrigin[3], Float:speed) { static Float:fl_Velocity[3] static Float:EntOrigin[3] pev(ent, pev_origin, EntOrigin) static Float:distance_f distance_f = get_distance_f(EntOrigin, VicOrigin) if (distance_f > 60.0) { new Float:fl_Time = distance_f / speed fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time } else { fl_Velocity[0] = 0.0 fl_Velocity[1] = 0.0 fl_Velocity[2] = 0.0 }
entity_set_vector(ent, EV_VEC_velocity, fl_Velocity) }
https://forums.alliedmods.net/showthread.php?t=150283
Houndeye Zombie for Biohazard mod.
I set that every zombie has this ability( because I do not use classes but zombie evolution).
If somebody needs for particular class,maybe we can adjust it.
PHP Code:
/* Houndeye Zombie v0.4 By Morte -. Description: Blast player and make it fly. -. Cvars: zp_houndeye_timeblast 2.5 (Time to Blast) zp_houndeye_radius 150.0 (Blast Radius) zp_houndeye_infect_blast 0 (Blast infect players) zp_houndeye_damage 0 (Blast Damage) zp_houndeye_damage_amount 25 (Blast Damage Amount) -. Changelog: # 0.1 - Plugin Release # 0.2 - Added 2 cvar's: 1) To activate the blast damage 2) To select the amount of the damage # 0.3 - Now you can't use blast hability if you are nemesis. # 0.4 - Fixed cvar "zp_houndeye_damage_amount". -. Credits: # shinoda - Help me with how to make players fly. # MeRcyLeZZ - For his Zombie Plague ^.^ # frk_14 - For the model.
*/
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #include <xs> #include <engine> #include <biohazard>
/*================================================================================ [Plugin Customization] =================================================================================*/ new const beam_cylinder[] = "sprites/white.spr"
new const houndeye_attack[][] = { "houndeye/he_attack1.wav", "houndeye/he_attack3.wav" } new const houndeye_blast[][] = { "houndeye/he_blast1.wav", "houndeye/he_blast3.wav" }
/*================================================================================ [End Customization] =================================================================================*/
#define is_player(%0) (1 <= %0 <= giMaxplayers) #define TASK_BARTIME 16000
// Zombie vars new gMsgBarTime, gMsgDeathMsg, gSprBeam, giMaxplayers, cvar_timeblast, cvar_radius, cvar_blast_infect, cvar_damage, cvar_damage_amount
public plugin_init() { register_plugin("Houndeye Zombie", "0.4", "Morte") cvar_timeblast = register_cvar("zp_houndeye_timeblast", "2.5") cvar_radius = register_cvar("zp_houndeye_radius", "150.0") cvar_blast_infect = register_cvar("zp_houndeye_infect", "0") cvar_damage = register_cvar("zp_houndeye_damage", "0") cvar_damage_amount = register_cvar("zp_houndeye_damage_amount", "25") register_forward( FM_CmdStart, "CmdStart") giMaxplayers = get_maxplayers() gMsgBarTime = get_user_msgid("BarTime") gMsgDeathMsg = get_user_msgid("DeathMsg") }
public plugin_precache() { gSprBeam = precache_model(beam_cylinder) for (new i = 0; i < sizeof houndeye_attack; i++) engfunc(EngFunc_PrecacheSound, houndeye_attack[i]) for (new i = 0; i < sizeof houndeye_blast; i++) engfunc(EngFunc_PrecacheSound, houndeye_blast[i]) }
public CmdStart(id) { if(!is_user_alive(id)) return; static iButton; iButton = pev(id, pev_button) static iOldButton; iOldButton = pev(id, pev_oldbuttons) if(is_user_zombie(id)) { if( ( iButton & IN_USE ) && !( iOldButton & IN_USE ) ) { if(!is_user_alive(id)) return;
message_begin(MSG_ONE, gMsgBarTime, _, id) write_byte(get_pcvar_num(cvar_timeblast)) write_byte(0) message_end() emit_sound(id, CHAN_VOICE, houndeye_attack[random_num(0, sizeof houndeye_attack - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) set_task(get_pcvar_float(cvar_timeblast), "blast_players", id+TASK_BARTIME) } if( iOldButton & IN_USE && !( iButton & IN_USE ) ) set_task(0.1, "blast_stop", id) } }
public blast_stop(id) { message_begin(MSG_ONE, gMsgBarTime, _, id) write_byte(0) write_byte(0) message_end() remove_task(id+TASK_BARTIME) }
public blast_players(id) { id -= TASK_BARTIME new Float: iOrigin[3] pev(id, pev_origin, iOrigin) emit_sound(id, CHAN_VOICE, houndeye_blast[random_num(0, sizeof houndeye_blast - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, iOrigin, 0) write_byte(TE_BEAMCYLINDER) engfunc(EngFunc_WriteCoord, iOrigin[0]) engfunc(EngFunc_WriteCoord, iOrigin[1]) engfunc(EngFunc_WriteCoord, iOrigin[2]) engfunc(EngFunc_WriteCoord, iOrigin[0]) engfunc(EngFunc_WriteCoord, iOrigin[1]) engfunc(EngFunc_WriteCoord, iOrigin[2]+385.0) write_short(gSprBeam) write_byte(0) write_byte(0) write_byte(4) write_byte(60) write_byte(0) write_byte(255) write_byte(255) write_byte(255) write_byte(200) write_byte(0) message_end() static Ent, Float: originF[3] while( (Ent = engfunc(EngFunc_FindEntityInSphere, Ent, iOrigin, get_pcvar_float(cvar_radius))) ) { if( is_player(Ent) && Ent != id ) { if(is_user_zombie(Ent)) return PLUGIN_CONTINUE; if(get_pcvar_num(cvar_blast_infect)) { infect_user(Ent, 1) SendDeathMsg(id, Ent) } if(get_pcvar_num(cvar_damage)) { fm_set_user_health(Ent, pev(Ent, pev_health) - get_pcvar_num(cvar_damage_amount)) } pev(Ent, pev_origin, originF) originF[0] = (originF[0] - iOrigin[0]) * 10.0 originF[1] = (originF[1] - iOrigin[1]) * 10.0 originF[2] = (originF[2] - iOrigin[2]) + 500.0 set_pev(Ent, pev_velocity, originF) } } return PLUGIN_HANDLED; }
SendDeathMsg(attacker, victim) { message_begin(MSG_BROADCAST, gMsgDeathMsg) write_byte(attacker) write_byte(victim) write_byte(1) write_string("infection") message_end() }
/*================================================================================ [Stocks] =================================================================================*/
stock print_chatColor(const id,const input[], any:...) { new msg[191], players[32], count = 1; vformat(msg,190,input,3); replace_all(msg,190,"!g","^4");// green replace_all(msg,190,"!n","^1");// normal replace_all(msg,190,"!t","^3");// team if (id) players[0] = id; else get_players(players,count,"ch"); for (new i=0;i<count;i++) if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]); write_byte(players[i]); write_string(msg); message_end(); } }
stock fm_set_user_health(id, health) { (health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id); }
__________________
Last edited by Krtola; 04-25-2019 at 06:42.
|
|