Soo I am still working on my system of "guest" users and I would like to prevent them to access any other inventories than... lets say campfires.
What would be a good point of entry?
Preventing inventory operations?
Discussion in 'Rust Development' started by Kyrah Abattoir, May 1, 2016.
-
You could use that. Not sure if it works didn't test it.Code:
void OnLootEntity(BaseEntity entitySource, BaseEntity targetEntity) { BasePlayer source = entitySource as BasePlayer; if(source == null) return; //check here is source is guest or something NextTick(() => { source.EndLooting(); }); }Last edited by a moderator: May 2, 2016 -
It appears to be working, but why the NextTick Call?
Nevermind I got it.
Thanks, it appears to be working.Last edited by a moderator: May 3, 2016 -
Wulf Community Admin
It just delays it a bit, otherwise if doesn't always work I believe. -
Lol good to know, was always confused on why it never worked!
-
Probably because when OnLootEntity is called looting hasn't really started yet, so BasePlayers.EndLooting doesn't work.
