Garry's Mod

Garry's Mod

评价数不足
ULX Module for Randomat 2.0
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
文件大小
发表于
更新日期
28.882 KB
2020 年 5 月 14 日 下午 6:54
5 月 26 日 下午 7:59
50 项改动说明 ( 查看 )

订阅以下载
ULX Module for Randomat 2.0

描述
Thanks to Dem for the 'Randomat 2.0 ULX Menu' mod which this is an update to.

Edits (and replaces) the original version to support custom added events with little-to-no developer interaction

Chat Commands
!rdmt EventId - Starts an event with the given "EventId".
!srdmt EventId - Safely starts an event with the given "EventId". Will cause a server-side error if the event's conditions are not met.
!clearevent EventId/!stopevent EventId - Stops an event with the given "EventId". Will cause a server-side error if no event with that ID is running.
!clearevents/!stopevents - Stops all active events.
!rdmtnr EventId - Starts an event with the given "EventId" next round.
!srdmtnr EventId - Starts an event with the given "EventId" next round. Will cause a server-side error if the event's conditions are not met.
!clearnr - Clears the event scheduled for the next round, if there is one.

For Developers
This version of the ULX menu takes advantage of the fact that the list of Randomat events is globally available and uses that to add all custom events to the menu. Unfortunately the list of Randomat events does not contain their ConVars so I had to modify the Randomat event meta API slightly to support that.

Custom Event Compatibility
All custom events that work with the Randomat 2.0 will show in the Randomat ULX menu. However, without any code changes the only things available for these custom events will be the Enabled checkbox and the Trigger Event button.

Adding ConVar Support
To add ConVar support to a custom event, the GetConVars meta method must be implemented.
The GetConVars method returns three lists of ConVar information:
1. The list of ConVars which should be configured by a slider control (e.g. number ranges)
2. The list of ConVars which should be configured by a checkbox control (e.g. booleans)
3. The list of ConVars which should be configured by a textbox control

See the README file in the code repository[github.com] for an example of the GetConVars implementation

Special Thanks

Source Code
https://github.com/Malivil/TTT-Randomat-20-ULX
12 条留言
Malivil  [作者] 2021 年 8 月 21 日 下午 6:25 
Yea, it would use whatever you have "ttt_randomat_event_weight" set to
EnderSlayer366 2021 年 8 月 21 日 下午 6:09 
ok so -1 makes it use the default weight, if you have the default set to something other than 1, like 6 or something, would it do that instead
Malivil  [作者] 2021 年 8 月 21 日 下午 5:46 
A weight of -1 on an event makes it use the default weight of 1
EnderSlayer366 2021 年 8 月 21 日 下午 4:25 
What exactly does a weight of -1 do for the events? Does it just make it less likely or does it never happen? Does it do some other thing?
Malivil  [作者] 2021 年 3 月 17 日 上午 4:39 
I don't want to do that because some people (myself included) get the latest ULX and install it as a filesystem addon rather than through the workshop.
The Stig 2021 年 3 月 16 日 下午 11:01 
Hey it's been a while, just a small thing this time: Could ULX be added as a required mod? It would make things a little easier when getting others to install this.
Malivil  [作者] 2021 年 1 月 26 日 上午 10:42 
The first error is not related to this.

The second error means you don't have a Randomat 2.0 addon installed, or at least not a compatible one.
[KaP] Portres 2021 年 1 月 26 日 上午 10:28 
Yea its really strange but deleting this worked:
[ULib] HTTP failed - ISteamHTTP isn't available!

1. Fetch - lua/includes/modules/http.lua:42
2. fn - lua/ulib/shared/plugin.lua:186
3. unknown - lua/ulib/shared/hook.lua:109


[ULX Module for Randomat 2.0] lua/ulx/xgui/server/sv_randomat.lua:24: attempt to index global 'Randomat' (a nil value)
1. fn - lua/ulx/xgui/server/sv_randomat.lua:24
2. unknown - lua/ulib/shared/hook.lua:109
Malivil  [作者] 2021 年 1 月 26 日 上午 10:21 
What error messages?

This is a ULX plugin so it shouldn't affect the gamemode at all.
[KaP] Portres 2021 年 1 月 26 日 上午 9:51 
Broken with TTT2 getting Error messages and gamemode not starting