For the plugin I am working on currently, im using player.EndLooting() to attempt and force a player to stop looting a quarry. From what I can tell it works for anything but a quarry! Im just using a fix as seen below.
This code just makes it so a player stops looting via loading them in again.Code:looter.SetPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot, true); looter.UpdateNetworkGroup(); looter.SendNetworkUpdateImmediate(false); looter.ClientRPCPlayer(null, looter, "StartLoading", null, null, null, null, null); looter.SendFullSnapshot();
Player.EndLooting() not working for quarries
Discussion in 'Rust Development' started by DylanSMR, Apr 8, 2016.
-
When are you trying to call EndLooting? Perhaps it's too early?
-
Shouldn't be, its being called just after "[HookMethod("OnLootEntity")]"
[DOUBLEPOST=1460080859][/DOUBLEPOST][C#] [HookMethod("OnLootEntity")] void OnLootEntity(BasePlayer loote - Pastebin.com -
Are you trying to make it so that if the owner of the quarry is not the person currently looting, it stops them from looting?
Regardless of that, I think I encountered the same issue, and this is what I used (and what worked) in one of my plugins:
It's called shortly after looting, instead of during/slightly before the looting actually starts, like I think the hook does. You could also just use a timer, but I prefer to invoke it instead.Code:player.Invoke("EndLooting", 0.135f); -
Ah ok I see, i'll test it later! If you wanted a full view of that code I just posted it via plugin submission! QuarryLocks for Rust | Oxide
