搜索
查看: 2204|回复: 0

求助修改wall或amx_wall,谢谢。

[复制链接]
发表于 2007-9-6 14:57:58 | 显示全部楼层 |阅读模式 来自 中国–辽宁–沈阳
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[9999]
new g_wallCount = 0
new g_wallSolidCount = 0
new g_wallCreators[9999]
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, "[AMXX][墙壁制造者] %i 墙壁拆除.", i-1)
  g_wallCount = 0
  g_wallSolidCount = 0
}
else {
  client_print(id, print_chat, "[AMXX][墙壁制造者] 没有墙壁可拆除!")
}
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, "[AMXX][墙壁制造者] 你不能制造墙壁! 原因: 你已经死亡")
  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[3]
  new Float:MaxBox[3]
  MinBox[0] = -10.0
  MinBox[1] = -85.0
  MinBox[2] = -125.0
  MaxBox[0] =  10.0
  MaxBox[1] =  85.0
  MaxBox[2] =  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[3]
  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, "[AMXX][墙壁制造者] 墙壁 #%i 已经创造.", g_wallCount)
  g_wallEnts[g_wallCount] = tmpWall
  g_wallCreators[g_wallCount] = id
  set_task(2.0, "wallMakeSolid")
}
return PLUGIN_HANDLED
}
public wallMakeSolid() {
g_wallSolidCount = g_wallSolidCount + 1
new tmpWall = g_wallEnts[g_wallSolidCount]
client_print(g_wallCreators[g_wallSolidCount], print_chat, "[AMXX][墙壁制造者] 墙壁 #%i 现在是固体.", g_wallSolidCount)
entity_set_int(tmpWall, EV_INT_solid, 2)
entity_set_int(tmpWall, EV_INT_movetype, 4)
g_wallEnts[g_wallSolidCount] = 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_wallCount])
  g_wallEnts[g_wallCount] = false
  client_print(id, print_chat, "[AMXX][墙壁制造者] 墙壁 #%i 已经被拆除.", g_wallCount)
  if(id != g_wallCreators[g_wallCount]) {
   new playerName[32]
   get_user_name(g_wallCreators[g_wallCount], playerName, 31)
   client_print(id, print_chat, "[AMXX][墙壁制造者] 你的墙壁 (#%i) 已经成功拆除: %s", g_wallCount, playerName)
  }
  g_wallCreators[g_wallCount] = false
  g_wallCount = g_wallCount - 1
  g_wallSolidCount = g_wallSolidCount -1
}
else {
  client_print(id, print_chat, "[AMXX][墙壁制造者] 没有墙壁可以被拆除!")
}
return PLUGIN_HANDLED
}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表