How to find out if a player is mining ore and once so what is the health of the ore?
This is what im at currently
[DOUBLEPOST=1456885272][/DOUBLEPOST]What I meant by health of ore is it on the last hit till it dies/runs out of ore.Code:namespace Oxide.Plugins { [Info("HQLast", "DylanSMR", "0.0.1", ResourceId = 3821)] [Description("Makes it so you earn the high qual metal on the last hit.")] class HQLast : RustPlugin { private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item) { if (!entity.ToPlayer()) return; var gatherType = dispenser.gatherType.ToString("G"); var player = entity.ToPlayer(); //Need to ask if a player is mining "ore"if() //{ // //} } } }
Detecting if player is gathering, and resource amount?
Discussion in 'Rust Development' started by DylanSMR, Mar 2, 2016.
-
@DylanSMR you have any result of this plugin? i have a few ideas with him.
-
Maybe something like this:
Code:void OnDispenserGather( ResourceDispenser dispenser, BaseEntity entity, Item item ) { var player = entity as BasePlayer; string type = dispenser.gatherType.ToString(); if( type == "Ore" ) { float remaining = dispenser.fractionRemaining; player.ChatMessage( remaining.ToString() ); } }
