PreFiX submitted a new resource:
DeadPlayersAPI - Developers usage only to check if player is currently dead
Read more about this resource...
DeadPlayersAPI [Unmaintained]
Discussion in 'Plugin Support' started by PreFiX, May 14, 2016.
-
Wulf Community Admin
Just a tip: All of the using statements excluding Oxide.Core.Plugins in your example can be removed, as can the first null check, as you're already checking for null in the line right after it via null propagation.
Code:using Oxide.Core.Plugins;namespace Oxide.Plugins { [Info("DeadPlayerPreventTP", "Prefix", "0.1.0")] class DeadPlayerPreventTP : RustLegacyPlugin { [PluginReference] Plugin DeadPlayersAPI; object CanTeleport(NetUser netuser) { var isdead = DeadPlayersAPI?.Call("IsDead", netuser); if (isdead != null && (bool)isdead) return false; return null; } } }