1. Guys hello to all, it seems to me or a hook CanSeeStash does not work
     
  2. Wulf

    Wulf Community Admin

    How are you using it exactly?
     
  3. In the plugin Stash Traps
    I tried to catch Puts ("test"); in this hook, whether the action occurs when digging out the hiding place, nothing comes to me, before the global renovation of the rust, everything worked.
    Code:
    private void CanSeeStash(StashContainer stash, BasePlayer player)
            {
                if (!_data.Stashes.Contains(stash.net.ID) || HasPermission(player))
                    return;            _data.Stashes.Remove(stash.net.ID);
                _data.SaveData(_data.Stashes, "Stashes");
                var nearbyPlayers = FormatNearbyPlayers(player);
                var body = MessageJson
                    .Replace("{player}", $"{player.displayName} ({player.UserIDString})")
                    .Replace("{nearbyPlayers}", string.IsNullOrEmpty(nearbyPlayers) ? "None" : nearbyPlayers)
                    .Replace("{position}", FormatCoordinates(stash.transform.position))
                    .Replace("{networkID}", stash.net.ID.ToString());            webrequest.Enqueue(_configuration.WebHookURL, body, (code, response) =>
                {
                    if (code != 204)
                        PrintWarning($"Warning, the Discord API responded with code {code}.");
                }, this, RequestMethod.POST);            if (string.IsNullOrEmpty(nearbyPlayers))
                {
                    LogToFile("Stashes", string.Format(lang.GetMessage("StashLogAlone", this), DateTime.Now.ToShortDateString(), $"{player.displayName} ({player.UserIDString})", FormatCoordinates(stash.transform.position)), this, false);
                    foreach (var target in BasePlayer.activePlayerList.Where(x => HasPermission(x)))
                        MessagePlayer(target, "StashAlertAlone", $"{player.displayName} ({player.UserIDString})", FormatCoordinates(stash.transform.position), stash.net.ID);                return;
                }            LogToFile("Stashes", string.Format(lang.GetMessage("StashLogTogether", this), DateTime.Now.ToShortDateString(), $"{player.displayName} ({player.UserIDString})", nearbyPlayers, FormatCoordinates(stash.transform.position)), this, false);
                foreach (var target in BasePlayer.activePlayerList.Where(x => HasPermission(x)))
                    MessagePlayer(target, "StashAlertTogether", $"{player.displayName} ({player.UserIDString})", nearbyPlayers, FormatCoordinates(stash.transform.position), stash.net.ID);
            }
     
  4. Wulf

    Wulf Community Admin

    Swap the arg order.
     
  5. Yes, just noticed in the documentation, thanks now I'll check
    [DOUBLEPOST=1529766899][/DOUBLEPOST]
    Checked, everything works, solved