Garry's Mod

Garry's Mod

评价数不足
Hook Sounds
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 快乐
文件大小
发表于
更新日期
1.253 KB
2024 年 7 月 12 日 上午 7:11
2024 年 7 月 12 日 上午 7:46
2 项改动说明 ( 查看 )

订阅以下载
Hook Sounds

描述
An addon that allows for sounds to be played when events (i.e. hooks, such as EntityTakeDamage) are triggered.

To add a hook sound entry, modify GarrysMod/garrysmod/data/hook_sounds.json. If this file does not exist, it can be created manually. In the future there may be an in-game UI for editing sound entries, but for now the file must be edited manually.

The hook_sounds.json format is as follows:
{ "shared": [ // Entries shared between client and server. Sound entry objects go here, separated by commas. ], "client": [ // Clientside only entries. Sound entry objects go here, separated by commas. ], "server": [ // Serverside only entries. Sound entry objects go here, separated by commas. ] }

The format for individual sound entry objects is as follows:
{ "hook": "<Insert event name here>", "sound": "<Insert sound path relative to sounds folder here>" }

Event names included in Garry's Mod can be found at the Garry's Mod Wiki[wiki.facepunch.com]. For the hook "GM:DoPlayerDeath", called serverside when a player dies, the event name is "DoPlayerDeath". Some addons may also add their own events.

There are also some special cases in which sounds are played differently. If the first input value of an event is an Entity (Or any other type that is an entity, such as a Player) then the sound will be played at that entity's position instead of everywhere. Other addons are able to add their own cases by hooking into the OnHookSound event, which runs whenever a hook sound is played, and passes the sound name as well as all of the input values of the triggering hook.
1 条留言
noewaeda 2024 年 7 月 21 日 下午 4:17 
definitely using this