issac240
|
分享:
▲
▼
#include <amxmodx> #include <hamsandwich> #include <zombieplague> #include <fakemeta_util>
#define STR_T 32 #define MAX_PLAYERS 32
#define SUPPORT_BOT_TO_USE //支援BOT使用.(在最前面加上 // 即取消对BOT的技援)
// Climbing Zombie Atributes new const zclass_name[] = { "爬墙丧尸" } // name new const zclass_info[] = { "拥有爬墙的能力" } // description new const zclass_model[] = { "skeletons_arctic" } // model new const zclass_clawmodel[] = { "v_knife_sald.mdl" } // claw model const zclass_health = 2000 // health const zclass_speed = 230 // speed const Float:zclass_gravity = 1.0 // gravity const Float:zclass_knockback = 1.50 // knockback
new g_zclass_climb
new cvar_speed, g_smoke, cvar_minillum, cvar_damage, cvar_delay, cvar_damagelight
new Float:g_wallorigin[33][3] new Float:g_nextdmg[33] new Float:g_shoottime[33]
public plugin_init() { register_plugin("[ZP] Class:Climbing Zombie","1.3","bipbip")
cvar_speed = register_cvar("zp_climbingspeed", "100") //爬墙的速度 cvar_minillum = register_cvar("zp_minlight", "10.0") //在什么程度的光照下会受伤 cvar_damage = register_cvar("zp_lightdamage", "30.0") //光照伤害的数值 cvar_delay = register_cvar("zp_climbdelay", "0.3") //更新受光照伤害的延迟时间 cvar_damagelight = register_cvar("zp_damagebylight", "0") //光照伤害 [1开启/0关闭] RegisterHam(Ham_Touch, "player", "cheese_player_touch", 1) RegisterHam(Ham_Player_PreThink, "player", "cheese_player_prethink", 1) RegisterHam(Ham_TakeDamage, "player", "cheese_takedamage", 1) }
public plugin_precache() { g_zclass_climb = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) g_smoke = precache_model( "sprites/steam1.spr" ) }
public zp_user_infected_post(id, infector) { if (zp_get_user_zombie_class(id) == g_zclass_climb) client_print(id, print_chat, "爬墙丧尸提示:靠近墙壁时同时按住'E'键不放可以爬墙.") }
public cheese_player_touch(id, world) { if(!is_user_alive(id)) return HAM_IGNORED new classname[STR_T] pev(world, pev_classname, classname, (STR_T-1)) if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable")) pev(id, pev_origin, g_wallorigin[id]) return HAM_IGNORED }
public cheese_player_prethink(id) {
// Player not alive or not zombie if(!is_user_alive(id) || !zp_get_user_zombie(id)) { return HAM_IGNORED } static Float:test ; pev(id, pev_light_level, test) // Player has not our zombie class or Nemesis if(zp_is_nemesis_round() || zp_get_user_zombie_class(id) != g_zclass_climb) { return HAM_IGNORED } static Float:origin[3] pev(id, pev_origin, origin) if (get_pcvar_num(cvar_damagelight)) { if (get_gametime() > g_nextdmg[id]) { static Float:lightlevel; pev(id,pev_light_level, lightlevel) if (lightlevel > get_pcvar_float(cvar_minillum)) { fm_fakedamage(id, "light", get_pcvar_float(cvar_damage), DMG_BURN) // do some smokes message_begin( MSG_BROADCAST, SVC_TEMPENTITY ) write_byte( TE_SMOKE ) engfunc(EngFunc_WriteCoord, origin[ 0 ] ) engfunc(EngFunc_WriteCoord, origin[ 1 ] ) engfunc(EngFunc_WriteCoord, origin[ 2 ] ) write_short( g_smoke ) write_byte( 20 ) write_byte( 10 ) message_end() g_nextdmg[id] = get_gametime() + 1.0 } } } // from Cheap_Suit's Upgrades Mod eXtended static button ; button = pev(id, pev_button) #if defined SUPPORT_BOT_TO_USE if((button & IN_USE) || is_user_bot(id)) #else if(button & IN_USE) #endif { if(get_distance_f(origin, g_wallorigin[id]) > 10.0) return HAM_IGNORED if(pev(id, pev_flags) & FL_ONGROUND) return HAM_IGNORED if (get_gametime() < g_shoottime[id]) { return HAM_IGNORED } if(button & IN_FORWARD) { static Float:velocity[3] velocity_by_aim(id, get_pcvar_num(cvar_speed), velocity) fm_set_user_velocity(id, velocity) } else if(button & IN_BACK) { static Float:velocity[3] velocity_by_aim(id, -get_pcvar_num(cvar_speed), velocity) fm_set_user_velocity(id, velocity) } } return HAM_IGNORED }
public event_infect(victim, attacker) { g_nextdmg[victim] = 0.0 g_shoottime[victim] = 0.0 }
public cheese_takedamage(victim, inflictor, attacker, Float:damage, damagetype) {
if (is_user_alive(victim)) { if (zp_get_user_zombie_class(victim) != g_zclass_climb) { g_shoottime[victim] = get_gametime() + get_pcvar_float(cvar_delay); } } return HAM_IGNORED }
/* Float:getillumination(id) { static Float:i ; i = float(engfunc(EngFunc_GetEntityIllum, id)) if (i > 75.0) i = 75.0 return (100.0 * xs_sqrt(i / 75.0)); }*/
|