Listening for BUTTON.INVENTORY not working, any new way?
Discussion in 'Rust Development' started by Tuntenfisch, Dec 3, 2015.
-
Care to give an example on how I would use that to detect if the inventory - button was pressed? I'm kind of lost on how to approach this.
-
You can bind your commands...
-
Sorry but I'm still lost...
-
I tryed to bind them, but they dont work with plugins commands..
-
Wulf Community Admin
They'd work with console commands only, not chat commands. -
So how exactly would I detect if the inventory - button is pressed? I still can't think of a solution...
[DOUBLEPOST=1449192087][/DOUBLEPOST]So I came up with the following:
It works like a charm, though I'm not sure if you can bind the inventory - button itself to something, so I guess you need to just assume the player is using one specific button to open his inventory.Code:void OnPlayerInit(BasePlayer player) { ConsoleSystem.SendClientCommand(player.net.connection, "bind tab inventory.toggle;killfeed.inventory"); }[ConsoleCommand("killfeed.inventory")] private void SaveCommand(ConsoleSystem.Arg arg) { Puts("tab pressed"); }
Seems clunky at first, but opens up a lot of possibilities!
Edit 1#: I guess it could lead to console command conflicts if different plugins define the same console command.Last edited by a moderator: Dec 4, 2015
