点通粉丝 发表于 2011-5-25 16:15:17

求助.如何设置坐标文件

看图..................

点通粉丝 发表于 2011-5-25 16:21:55

本帖最后由 点通粉丝 于 2011-5-25 16:24 编辑

各位高手看一下这代码.我重写的
#include <amxmodx>
#include <amxmisc>
#include <engine>

public plugin_init(){
        register_plugin("Trasistor Radio","1.0","AssKicR")
        register_clcmd("amx_big_rock","Ass_CreateRadio",ADMIN_KICK)       //设置模型命令
        register_clcmd("big_rock","Ass_DelRadios",ADMIN_KICK)             //设消模型命令   
        register_cvar("radio_station","1")
        return PLUGIN_CONTINUE
}

public plugin_precache() {

        precache_model("models/big_rock.mdl")
        return PLUGIN_CONTINUE
}

public Ass_CreateRadio(id,level,cid){
        if (!cmd_access(id,level,cid,1))
                return PLUGIN_HANDLED

        if(entity_get_int(id, EV_INT_deadflag) != 0)
                return PLUGIN_HANDLED

        new Float:vOrigin
        new Float:vAngles
        entity_get_vector(id, EV_VEC_origin, vOrigin)
        entity_get_vector(id, EV_VEC_v_angle, vAngles)

      new NewEnt
      NewEnt = create_entity("info_target")

      if(NewEnt == 0) {
            return PLUGIN_HANDLED_MAIN
      }

        entity_set_string(NewEnt, EV_SZ_classname, "ass_radio")
        entity_set_model(NewEnt, "models/big_rock.mdl")
        entity_set_int(NewEnt, EV_INT_body, 1)
        entity_set_int(NewEnt, EV_INT_sequence, 1)
        entity_set_int(NewEnt, EV_INT_solid, 2)
      set_rendering(NewEnt,kRenderFxNone,200,20,120,kRenderTransAlpha,150);
        new Float:MinBox
        new Float:MaxBox

        MinBox = -16.0
        MinBox = -16.0
        MinBox = -12.0
        MaxBox = 16.0
        MaxBox = 16.0
        MaxBox = 12.0

        entity_set_vector(NewEnt, EV_VEC_mins, MinBox)
        entity_set_vector(NewEnt, EV_VEC_maxs, MaxBox)

        new Float:vNewOrigin
        new Float:vNormal
        new Float:vTraceDirection
        new Float:vTraceEnd
        new Float:vTraceResult
        new Float:vEntAngles

        VelocityByAim(id, 64, vTraceDirection)
       
        vTraceEnd = vTraceDirection + vOrigin
        vTraceEnd = vTraceDirection + vOrigin
        vTraceEnd = vTraceDirection + vOrigin

        trace_line(id, vOrigin, vTraceEnd, vTraceResult)

        if(trace_normal(id, vOrigin, vTraceEnd, vNormal) == 0) {
                remove_entity(NewEnt)
                console_print(id, " You must plant the radio on a wall!")
                return PLUGIN_HANDLED_MAIN
        }


        vNewOrigin = vTraceResult + (vNormal * 16.0)
        vNewOrigin = vTraceResult + (vNormal * 16.0)
        vNewOrigin = vTraceResult + (vNormal * 12.0)

        entity_set_origin(NewEnt, vNewOrigin)
        vector_to_angle(vNormal, vEntAngles)

        entity_set_vector(NewEnt, EV_VEC_angles, vEntAngles)


        new Float:vBeamEnd
        new Float:vTracedBeamEnd
        vBeamEnd = vNewOrigin + (vNormal * 8192)
        vBeamEnd = vNewOrigin + (vNormal * 8192)
        vBeamEnd = vNewOrigin + (vNormal * 8192)
        trace_line(-1, vNewOrigin, vBeamEnd, vTracedBeamEnd)
        entity_set_vector(NewEnt, EV_VEC_vuser1, vTracedBeamEnd)

        entity_set_int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.


        return PLUGIN_HANDLED_MAIN
}我就想问一下一楼那两张图内的石头模型如何
能像广告插件一样..把设置好的石头梯子坐标保存下来
不用每次开服都要设置一次
帮忙修改一下谢谢

wk703 发表于 2011-6-27 10:53:31

谢谢谢谢

673734294 发表于 2011-8-9 03:59:02

:shutup: 我只看看 、
页: [1]
查看完整版本: 求助.如何设置坐标文件