|
发表于 2011-3-12 13:38:43
|
显示全部楼层
|阅读模式
来自 中国–浙江–温州–瑞安市
是什么错误 ? 帮忙改改
:Q
#include <amxmodx>
#include <biohazard>
#include <hamsandwich>
#include <fakemeta_util>
#if !defined _biohazard_included
#assert Biohazard functions file required!
#endif
#define STR_T 32
#define MAX_PLAYERS 32
new cvar_speed, g_smoke, cvar_minillum, cvar_damage
new Float:g_wallorigin[33][3]
new Float:g_nextdmg[33]
public plugin_init() {
register_plugin("bio_climbingzombie","1.1","bipbip")
is_biomod_active() ? plugin_init2() : pause("ad")
}
public event_clearclientdata(id) {
g_nextdmg[id] = 0.0
}
public plugin_init2() {
cvar_speed = register_cvar("bh_zm_climbingspeed", "240")
cvar_minillum = register_cvar("bh_zm_minlight", "20.0")
cvar_damage = register_cvar("bh_zm_lightdamage", "0")
RegisterHam(Ham_Touch, "player", "cheese_player_touch", 1)
RegisterHam(Ham_Player_PreThink, "player", "cheese_player_prethink", 1)
}
public cheese_player_touch(id, world) {
//if(!is_user_alive(id) || g_clsid != BH_get_user_classid(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) || !is_user_firstzombie(id)) {
set_hudmessage(255, 5, 12, -1.0, 0.40, 0, 6.0, 5.0)
show_hudmessage(id, "fisrst zombie ke yi pa qiang !")
return HAM_IGNORED
}
// Player has not our zombie class
//if(g_clsid != BH_get_user_classid(id)) {
// return HAM_IGNORED
//}
// from Cheap_Suit's Upgrades Mod eXtended
static button ; button = pev(id, pev_button)
static Float:origin[3]
pev(id, pev_origin, origin)
if(button & IN_JUMP && button & IN_DUCK)
{
if(get_distance_f(origin, g_wallorigin[id]) > 10.0)
return HAM_IGNORED
if(pev(id, pev_flags) & FL_ONGROUND)
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)
}
}
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
}
}
return HAM_IGNORED
}
public event_zombify(id) if (is_user_alive(id)) {
get_user_msgid( "To climb a wall : press JUMP + DUCK")
}
/*
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));
}*/ |
|