|
楼主 |
发表于 2011-2-1 23:57:36
|
显示全部楼层
来自 中国–广东–广州
本帖最后由 点通粉丝 于 2011-2-1 23:58 编辑
但有一些地方还望点通上的代码高手..帮一下忙了.就是怎样才能永久保留
因为这个插件要开一次图OP就要设置一次.太麻烦了..可不可以像广告插件那样
永久保存呢..因本人技术有限..望点通高人..出山帮忙了...本人在此先谢谢了.........- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- 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[3]
- new Float:vAngles[3]
- 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)
- new Float:MinBox[3]
- new Float:MaxBox[3]
- MinBox[0] = -15.0
- MinBox[1] = -15.0
- MinBox[2] = -12.0
- MaxBox[0] = 15.0
- MaxBox[1] = 15.0
- MaxBox[2] = 12.0
- entity_set_vector(NewEnt, EV_VEC_mins, MinBox)
- entity_set_vector(NewEnt, EV_VEC_maxs, MaxBox)
- new Float:vNewOrigin[3]
- new Float:vNormal[3]
- new Float:vTraceDirection[3]
- new Float:vTraceEnd[3]
- new Float:vTraceResult[3]
- new Float:vEntAngles[3]
- VelocityByAim(id, 64, vTraceDirection)
-
- vTraceEnd[0] = vTraceDirection[0] + vOrigin[0]
- vTraceEnd[1] = vTraceDirection[1] + vOrigin[1]
- vTraceEnd[2] = vTraceDirection[2] + vOrigin[2]
- trace_line(id, vOrigin, vTraceEnd, vTraceResult)
- if(trace_normal(id, vOrigin, vTraceEnd, vNormal) == 0) {
- remove_entity(NewEnt)
- console_print(id, "[Radio] You must plant the radio on a wall!")
- return PLUGIN_HANDLED_MAIN
- }
- vNewOrigin[0] = vTraceResult[0] + (vNormal[0] * 15.0)
- vNewOrigin[1] = vTraceResult[1] + (vNormal[1] * 15.0)
- vNewOrigin[2] = vTraceResult[2] + (vNormal[2] * 12.0)
- entity_set_origin(NewEnt, vNewOrigin)
- vector_to_angle(vNormal, vEntAngles)
- entity_set_vector(NewEnt, EV_VEC_angles, vEntAngles)
- new Float:vBeamEnd[3]
- new Float:vTracedBeamEnd[3]
- vBeamEnd[0] = vNewOrigin[0] + (vNormal[0] * 8192)
- vBeamEnd[1] = vNewOrigin[1] + (vNormal[1] * 8192)
- vBeamEnd[2] = vNewOrigin[2] + (vNormal[2] * 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
- }
- public plugin_init(){
- register_plugin("Trasistor Radio","1.0","AssKicR")
- register_clcmd("amx_big_rock","Ass_CreateRadio",ADMIN_KICK)
- register_cvar("radio_station","1")
- return PLUGIN_CONTINUE
- }
- public plugin_precache() {
- precache_model("models/big_rock.mdl")
- return PLUGIN_CONTINUE
- }
复制代码 |
|