Hello,
how i can do baricades, and other entity imunne to damage? I create PVP arena, and there all time baricades destroy form bullets :/
Next q is- how i can disable command kill for suecide?
Last question... When player die he while lying and waiting for help. If he die for bleeding or
or never arrives him - how i can get info who shot last bullet?
Disabling hits, command kill, and getting last attacker?
Discussion in 'Rust Development' started by zhulenejsnek, Feb 22, 2017.
-
Please... No help? :/
-
Hello Zhule You should get ZoneManager That can prevent enitity dmg + no suicide /zone Undestr True and /zone NoSuicide True
Hf! -
Yea, but the less plugins the better....
Any work, there is for developer who find it:
Block command kill:
Code:private void cmdKill(ConsoleSystem.Arg arg) { var player = arg.Player(); PrintToChat(player, "Sorry, but command kill is disabled. You must wait for help or die."); return; }
Code:void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info) { if(entity is Barricade) { info.damageTypes = new DamageTypeList(); info.DoHitEffects = false; info.HitMaterial = 0; info.HitEntity = null; } }
-
There should be an example to block suicide in ZoneManager - I know I've seen that code in there...
Look into the hook OnPlayerDie - this hook is called right before a player dies or is wounded, so you could keep track of last hits using that hook, then if a player is wounded (detect with OnPlayerWound) you can look up their last hit and do what you want with it...