4915820 发表于 2007-9-6 14:57:58

求助修改wall或amx_wall,谢谢。

wall.amxx跟amx_wall.amxx都有缺点,我想要一个能安置多个墙,墙的方向跟管理员安的时候的头部方向一致,并且只能管理员能穿过墙,其他玩家不能,wall如果不是不能放多个的话,我就用了,但是用上了amx_wall后,墙的方向只是朝着一个面,而且谁都不能通过,请高手给修改下谢谢。 修改其中任何一个都可能可以。


这个是amx_wall下面上传的是wall:
/*##########################################################################
##
## -- www.SteamTools.net
##      ___       ________    __       _          __      ___   _       _      
##   /   |   /   |/   | \ \/ /      | |      / /   /   | | |   | |   
##    / /| |    / /|   /| |\ \/ /       | |__   / /   / /| | | |   | |   
##   / / | |   / / |__/ | |   }{      | | /| / /   / / | | | |   | |   
##/ /| |/ /       | |/ /\ \       | |/   |/ /   / /| | | |___| |___
## /_/   |_| /_/      |_| /_/\_\      |___/|___/   /_/   |_| |_____| |_____|
##                                                      
##          |__                   |__o _|_   ___   __ __o |__,___
##      --|__) (__|   (__(__( |) ||_, (__/_ |)) | |\ (__/_
##                  |                                                   
##
##   This fun plugin was originally created by AssKicR over at the AMXMod.net
## forums, and little did I know he ported it to AMXX (link in thread). I decided
## that even though he ported it to AMXX, I should add some features, and did.
## You can now place virtually unlimited walls (up to 9999) and clear all the
## walls at one time, or can you "undo" them and have your last wall cleared.
##
##   Feel free to contact me
## via PM or email (mellis@traxio.net) if you have any questions
## or comments.
##
##   Enjoy!
##
##
## CHANGELOG
##------------------------------------------------------------------------
## Since this is the first version, these changes are from AssKicR's code
## - - -
## 1) You can place up to 9,999 walls at any given time.
## 2) Walls are solid, nobody can walk through them except owner (see cvar)
## 3) You have 2 seconds to run before your wall becomes solid
## 4) Walls no longer explode or do damage, they just disappear
##             -- NOTE: This feature may be re-added in future releases
##
##
## INSTALLATION
##------------------------------------------------------------------------
## 1) Unzip (which you may have done already)
## 2) Place 'amx_wall.amxx' in 'cstrike/addons/amxmodx/plugins'
## 3) Add a line in 'configs/plugins.ini' containing 'amx_wall.amxx'
## 4) Put 'wall.mdl' in 'cstrike/models' folder
## 5) Open 'cstrike/server.cfg' and add the cvar listed below
## 6) -- Visit www.SteamTools.net and enjoy your new plugin!
##
##
##
## THE CVARs
##------------------------------------------------------------------------
##
## amx_wall_immunity
##   - Does the person that placed the wall have the ability to walk through it?
##   + Default is 0 (no)
##
##
##########################################################################*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
new g_wallEnts
new g_wallCount = 0
new g_wallSolidCount = 0
new g_wallCreators
public plugin_init() {
register_plugin("墙壁制造者", "1.11", "whitemike/AssKicR")
register_clcmd("amx_wall_create", "wallCreate", ADMIN_SLAY)
register_clcmd("amx_wall_clear", "wallClear", ADMIN_SLAY)
register_clcmd("amx_wall_undo", "wallUndo", ADMIN_SLAY)
register_cvar("amx_wall_immunity", "0")
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/wall.mdl")
return PLUGIN_CONTINUE
}
public wallClear(id, level, cid) {
if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED
if(g_wallCount > 0) {
new i = 0
for(i=1; i<=g_wallCount; i++) {
   remove_entity(g_wallEnts)
   g_wallEnts = false
   g_wallCreators = false
}
client_print(id, print_chat, "[墙壁制造者] %i 墙壁拆除.", i-1)
g_wallCount = 0
g_wallSolidCount = 0
}
else {
client_print(id, print_chat, "[墙壁制造者] 没有墙壁可拆除!")
}
return PLUGIN_HANDLED
}
public wallCreate(id, level, cid) {
if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED
if (!is_user_alive(id)) {
client_print(id, print_chat, "[墙壁制造者] 你不能制造墙壁! 原因: 你已经死亡")
return PLUGIN_HANDLED
}
else {
g_wallCount = g_wallCount + 1
new tmpWall
tmpWall = create_entity("info_target")
entity_set_string(tmpWall, EV_SZ_classname, "AMX_Wall_Maker")
entity_set_model(tmpWall, "models/wall.mdl")
new Float:MinBox
new Float:MaxBox
MinBox = -10.0
MinBox = -85.0
MinBox = -125.0
MaxBox =10.0
MaxBox =85.0
MaxBox =125.0
// 10/85/125

entity_set_vector(tmpWall, EV_VEC_mins, MinBox)
entity_set_vector(tmpWall, EV_VEC_maxs, MaxBox)
entity_set_vector(tmpWall, EV_VEC_absmin, MinBox)
entity_set_vector(tmpWall, EV_VEC_absmax, MaxBox)

new Float:PlayerOrigin
entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
entity_set_origin(tmpWall, PlayerOrigin)
if(get_cvar_num("amx_wall_immunity") == 1) {
   entity_set_edict(tmpWall, EV_ENT_owner, id)
}
client_print(id, print_chat, "[墙壁制造者] 墙壁 #%i 已经创造.", g_wallCount)
g_wallEnts = tmpWall
g_wallCreators = id
set_task(2.0, "wallMakeSolid")
}
return PLUGIN_HANDLED
}
public wallMakeSolid() {
g_wallSolidCount = g_wallSolidCount + 1
new tmpWall = g_wallEnts
client_print(g_wallCreators, print_chat, "[墙壁制造者] 墙壁 #%i 现在是固体.", g_wallSolidCount)
entity_set_int(tmpWall, EV_INT_solid, 2)
entity_set_int(tmpWall, EV_INT_movetype, 4)
g_wallEnts = tmpWall
}
public wallUndo(id, level, cid) {
if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED
if(g_wallCount > 0) {
remove_entity(g_wallEnts)
g_wallEnts = false
client_print(id, print_chat, "[墙壁制造者] 墙壁 #%i 已经被拆除.", g_wallCount)
if(id != g_wallCreators) {
   new playerName
   get_user_name(g_wallCreators, playerName, 31)
   client_print(id, print_chat, "[墙壁制造者] 你的墙壁 (#%i) 已经成功拆除: %s", g_wallCount, playerName)
}
g_wallCreators = false
g_wallCount = g_wallCount - 1
g_wallSolidCount = g_wallSolidCount -1
}
else {
client_print(id, print_chat, "[墙壁制造者] 没有墙壁可以被拆除!")
}
return PLUGIN_HANDLED
}
页: [1]
查看完整版本: 求助修改wall或amx_wall,谢谢。