I'm working on a plugin that will need to access when an industrial conveyor is turned on/off. I don't see this listed in the documentation here - https://umod.org/documentation/games/rust/definitions#items, and I didn't see any hook regarding power state being on/off, excep for the switch one (?). Question is, are the docs out of date, or am I just missing something?
If anyone could provide a quick example of accessing the power state of industrial controls I'd appreciate it greatly.
Thanks!
Industrial Conveyor access from plugin
Have you tried looking at the server source code for existing hooks? That method is never out of date. While the definition list will often lag behind and not show all the hooks.
Merged post
// IndustrialConveyor
// Token: 0x06001355 RID: 4949 RVA: 0x00072EBC File Offset: 0x000710BC
[global::BaseEntity.RPC_Server]
[global::BaseEntity.RPC_Server.IsVisible(3f)]
[global::BaseEntity.RPC_Server.CallsPerSecond(2UL)]
private void SvSwitch(global::BaseEntity.RPCMessage msg)
{
if (Interface.CallHook("OnSwitchToggle", this, msg.player) != null)
{
return;
}
this.SetSwitch(!base.IsOn());
Interface.CallHook("OnSwitchToggled", this, msg.player);
}
note "this" is the instance of the IndustrialConveryor. From there you can get the power state.