I want to make a simple plugin that notifies the chat if an item has been taken out of the supply drop so they know it has been claimed...
How would I do that? Been messing around with
Doesn't work....Code:void OnItemRemovedFromContainer(ItemContainer container, Item item) { if (container == "supply_drop")
Neither does
Can someone give me a hand please?Code:if (container.ShortPrefabName == "supply_drop")Thanks.
Getting player on BaseNetworkable
Discussion in 'Rust Development' started by jackcat, Mar 7, 2018.
-
Code:
void OnItemRemovedFromContainer(ItemContainer container, Item item) { if (container.entityOwner is SupplyDrop)
-
-
Is there an easy way to make it so it only PrintToChat's once? Not every time an item is taken out. And also how to get player?
-
I managed to get it working using OnEntityKill instead
Code:void OnEntityKill(BaseNetworkable entity) { if (entity is SupplyDrop) { PrintToChat("Supply drop has been claimed."); } }
-
Code:
void OnEntityKill(BaseNetworkable entity) { var player = entity.net.connection.player as BasePlayer; if (entity is SupplyDrop) { PrintToChat($"{player.displayName} has claimed a Supply Drop."); } }
Code:private void OnExplosiveThrown(BasePlayer player, BaseEntity entity) { if (!(entity is SupplySignal)) return; PrintToChat($"{player.displayName} has thrown a Supply Signal!"); }
Last edited by a moderator: Mar 9, 2018 -