xiangxiangasd 发表于 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
new Float:g_nextdmg

public plugin_init() {         
        register_plugin("bio_climbingzombie","1.1","bipbip")
        is_biomod_active() ? plugin_init2() : pause("ad")
}

public event_clearclientdata(id) {
        g_nextdmg = 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
        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)
       
        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'sUpgrades Mod eXtended
        static button ; button = pev(id, pev_button)
        static Float:origin
        pev(id, pev_origin, origin)
        if(button & IN_JUMP && button & IN_DUCK)
        {
                if(get_distance_f(origin, g_wallorigin) > 10.0)
                        return HAM_IGNORED
               
                if(pev(id, pev_flags) & FL_ONGROUND)
                        return HAM_IGNORED
               
                if(button & IN_FORWARD)
                {
                        static Float:velocity
                        velocity_by_aim(id, get_pcvar_num(cvar_speed), velocity)
                        fm_set_user_velocity(id, velocity)
                }
                else if(button & IN_BACK)
                {
                        static Float:velocity
                        velocity_by_aim(id, -get_pcvar_num(cvar_speed), velocity)
                        fm_set_user_velocity(id, velocity)
                }
        }       
       
        if (get_gametime() > g_nextdmg) {
                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 = 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));
}*/

点通粉丝 发表于 2011-3-12 23:29:36

建议以后发这些帖.把功能说清楚.和需要改些什么...就这样帖个代码出来算什么呢???????爱莫难助了

xiangxiangasd 发表于 2011-3-13 22:26:58

1# xiangxiangasd


哦我是新手 对这些不了解不过我会研究的这个源码错误是读不出fakemeta_util

rsdtt 发表于 2011-3-13 23:48:13

估计是缺了这个吧#include <fakemeta_util>

rsdtt 发表于 2011-3-13 23:51:35

在include里添加这个

xiangxiangasd 发表于 2011-3-19 10:54:19

4# rsdtt


多谢帮主~\(≧▽≦)/~啦啦啦:handshake

wk703 发表于 2011-4-2 10:37:21

看看好不好用
页: [1]
查看完整版本: 帮忙修改个源码