Hey.
I'm trying to stop players from being able to loot other dead players' bodies.
Could someone help me with this?
I also need to be able to send a message to the looter saying that they can't loot that person or whatever.
I'm using C# btw.
Thanks,
PsychoTea
Solved Stop looting of other players? (C#)
Discussion in 'Rust Development' started by PsychoTea, Nov 15, 2015.
-
Oxide API for Rust (click it)
-
Wulf Community Admin
Or look at my NoSleepers or LootProtection plugins.
-
Thanks!
[DOUBLEPOST=1447618045][/DOUBLEPOST]Ah. I have a problem. CanLootPlayer is for sleeping players, I need it for dead players' bodies. If there is a way to remove certain players' bodies when they die that would be even better. -
Code:
void OnPlayerLoot(PlayerLoot inventory, BaseEntity target) { Puts("OnPlayerLoot works!"); }
-
-
-
Calytic Community Admin Community Mod
Code:(BasePlayer)inventory.entitySource
-
Here's my code
Code:void OnPlayerLoot(PlayerLoot inventory, BaseEntity target) { BasePlayer looter = (BasePlayer)inventory.entitySource; if (storedData.playerClass[target.ToPlayer().userID] == "god") { SendReply(looter, RAPrefix + "You're not allowed to loot god class players!" + RASuffix); inventory.Clear(); } }
-
Calytic Community Admin Community Mod
Try this instead
Code:inventory.GetComponent<BasePlayer>()
-
-
Wulf Community Admin
-
-
-
-
Code:
if (entity.GetComponent<PlayerCorpse>() != null) Puts(entity.GetComponent<PlayerCorpse>().playerSteamID.ToString());
-
-
Maybe you should take a look at the assembly before asking -
-