插件开发

l4d_hats:头顶帽子装饰

!hat 给自己戴个帽子(其实是各种模型),纯娱乐。

l4d_hats(Silvers 的 Hats 插件)让玩家头顶戴上各种道具模型,纯娱乐装饰。

它做什么

  • !hat 打开帽子菜单选择佩戴;!hats 定制显示设置。
  • !hatshow / !hatview 切换自己视角是否可见;!hatall 切换所有人帽子可见性;!hatoff 开关佩戴能力。
  • 管理员可给指定玩家戴帽(sm_hatclient)、调整位置/角度/大小(sm_hatpos / sm_hatang / sm_hatsize)并保存到配置(sm_hatsave),增删模型(sm_hatadd / sm_hatdel)。

文件位置

项目路径
插件文件plugins/extend/l4d_hats.smx
源码addons/sourcemod/scripting/extend/l4d_hats.sp
更新源清单Anne_Updater_All.txt(公开)

命令一览

命令类型权限说明
sm_hat玩家/控制台-Displays a menu of hats allowing players to change what they are wearing. Optional args: [0 - 128 or hat name or "random"]
sm_hatadd管理员ADMFLAG_ROOTAdds specified model to the config (must be the full model path).
sm_hatall玩家/控制台-Toggles the visibility of everyone's hats.
sm_hatallc管理员ADMFLAG_ROOTToggle the visibility of all hats on specific players.
sm_hatang管理员ADMFLAG_ROOTShows a menu allowing you to adjust the hat angles (affects all hats/players).
sm_hatc管理员ADMFLAG_ROOTDisplays a menu listing players, select one to change their hat.
sm_hatclient管理员ADMFLAG_ROOTSet a clients hat. Usage: sm_hatclient <#userid\
sm_hatdel管理员ADMFLAG_ROOTRemoves a model from the config (either by index or partial name matching).
sm_hatlist管理员ADMFLAG_ROOTDisplays a list of all the hat models (for use with sm_hatdel).
sm_hatload管理员ADMFLAG_ROOTChanges all players hats to the one you have.
sm_hatoff玩家/控制台-Toggle to turn on or off the ability of wearing hats.
sm_hatoffc管理员ADMFLAG_ROOTToggle the ability of wearing hats on specific players.
sm_hatpos管理员ADMFLAG_ROOTShows a menu allowing you to adjust the hat position (affects all hats/players).
sm_hatrand管理员ADMFLAG_ROOTRandomizes all players hats.
sm_hatrandom管理员ADMFLAG_ROOTRandomizes all players hats.
sm_hats玩家/控制台-Displays a menu to customize various settings for hats.
sm_hatsave管理员ADMFLAG_ROOTSaves the hat position and angels to the hat config.
sm_hatshow玩家/控制台-Toggle to see or hide your own hat. Applies to first person view or third person using the optional command argument "tp" e.g. "sm_hatshow tp"
sm_hatshowoff玩家/控制台-Hide your own hat. Applies to first person view or third person using the optional command argument "tp" e.g. "sm_hatshowoff tp"
sm_hatshowon玩家/控制台-See your own hat. Applies to first person view or third person using the optional command argument "tp" e.g. "sm_hatshowon tp"
sm_hatsize管理员ADMFLAG_ROOTShows a menu allowing you to adjust the hat size (affects all hats/players).
sm_hatview玩家/控制台-Toggle to see or hide your own hat. Applies to first person view or third person using the optional command argument "tp" e.g. "sm_hatview tp"

聊天中输入 !命令名(去掉 sm_ 前缀)等价于控制台命令。