Removing unwrap button?
Discussion in 'Rust Development' started by ツンデレラ, Mar 16, 2016.
-
Just a bit of help, you could use like
That wont work most likely but its something you can base off of.Code:object OnItemConsumed(BasePlayer player, ItemInfo iteminfo) { if(item == "item.present") return false; else return true: } -
Wulf Community Admin
You can block any commands sent to the server, but you can't remove any client buttons or elements.
-
Hm would i be able to stop people from picking up an item in specific or stopping them from opening a chest? Just a bit curious. Also where could i get an example of that if it is possible
-
Wulf Community Admin
To prevent them from opening a chest/box, something like this should work:
For item pickups, you could probably change what they get via the OnItemPickup hook and some others.Code:object CanUseDoor(BasePlayer player, BaseLock door) { if (prefab.Contains("box")) { return false; } } -
Thanks i just didn't think you could just do a return like that. This is enough info
[DOUBLEPOST=1458355352,1458312512][/DOUBLEPOST]Well sorry for the double post, but i have this it does trigger it, but i can't seem to make it get blocked?
Code:object OnConsumableUse(Item item) { BasePlayer player = item.GetOwnerPlayer(); if (item.info.itemid == -1732316031) { SendReply(player,"test 1"); return false; }else{ SendReply(player,"test 2"); return true; } } -
Wulf Community Admin
There is no return behavior, see Rust. You can only modify, not cancel. -
Hmm okay well i thought of a different idea. Is it possible to use ray casting to see if a player is looking at a physical present? like these? http://i.imgur.com/PT1n4Wx.jpg If so how? Because i i know how to do terrain or water, but not too sure how to do an object with ray casting.
