• Nazwa pluginu: ExtTeleport
    Wersja pluginu: 3.9.1

    Witam posiadam problem z konfiguracją permisji odnośnie "tpr". W momencie kiedy wpisuje /tpr wyskakuje mi Misc - No Permission. Ogólnie plugin działa. Sprawdzone na /tprhere i /setwarp. Załączam plugin.[0_1584129133639_ExtTeleport.cs](Wysyłanie 100%)

  • Administrator

    @Blondyna Ustawiłaś odpowiednie permisje na komendę tpr?


  • No właśnie tak czy mam grupę admin czy player nie działa. Prześlę część odpowiadającą za tą komendę.

    [ChatCommand("tpr")]
            private void CommandPlayerRequest(PlayerSession session, string command, string[] args)
            {
                var canTPHook = Interface.Oxide.CallHook("canExtTeleport", session);
    
                if (canTPHook != null)
                {
                    return;
                }
    			
                if (!_helpers.HasPermission(session, "player"))
                {
                    _helpers.SendChatMessage(session,
                        lang.GetMessage("Misc - No Permission", this, _helpers.GetPlayerId(session)));
                    return;
                }			
    
                if (!_helpers.GetConfig(true, "Player", "Enabled"))
                {
                    _helpers.SendChatMessage(session,
                        lang.GetMessage("Misc - Not Enabled", this, _helpers.GetPlayerId(session)));
                }
                if (args.Length != 1)
                {
                    _helpers.SendChatMessage(session,
                        lang.GetMessage("Misc - Syntax", this, _helpers.GetPlayerId(session))
                            .Replace("{syntax}", "/tpr <player>"));
                    return;
                }
    
                var pSession = _helpers.GetPlayerSession(session, args.First());
    
                if (pSession != null)
                {
                    var playerId = _helpers.GetPlayerId(session);
                    var teleportation = GetTeleportation(playerId);
                    var tPlayerId = _helpers.GetPlayerId(pSession);
                    var tTeleportation = GetTeleportation(tPlayerId);
    
                    if (_helpers.SessionEquals(session, pSession))
                    {
                        _helpers.SendChatMessage(pSession, lang.GetMessage("Player - Request Self", this, tPlayerId));
                        return;
                    }
                    if (tTeleportation.HasPendingPlayer(session))
                    {
                        _helpers.SendChatMessage(session,
                            lang.GetMessage("Player - Already Pending", this, playerId)
                                .Replace("{name}", pSession.Name));
                        return;
                    }
                    if (!CanTeleport(ETeleportType.Player, session, pSession, teleportation,
                        pSession.WorldPlayerEntity.transform.position, true))
                    {
                        return;
                    }
    
                    _helpers.SendChatMessage(session,
                        lang.GetMessage("Player - Request Sent", this, playerId).Replace("{name}", pSession.Name));
                    _helpers.SendChatMessage(pSession,
                        tTeleportation.GetPendingCount() > 0
                            ? lang.GetMessage("Player - Request Got Multiple", this, tPlayerId)
                                .Replace("{name}", session.Name)
                            : lang.GetMessage("Player - Request Got Single", this, tPlayerId)
                                .Replace("{name}", session.Name));
    
                    tTeleportation.AddPending(session);
    
                    timer.Once(_helpers.GetConfig(30f, "Player", "Pending Timer"), delegate
                    {
                        if (tTeleportation.HasPendingPlayer(session))
                        {
                            tTeleportation.RemovePending(session);
                            _helpers.SendChatMessage(session,
                                lang.GetMessage("Player - Request To Ran Out", this, playerId)
                                    .Replace("{name}", pSession.Name));
                            _helpers.SendChatMessage(pSession,
                                lang.GetMessage("Player - Request From Ran Out", this, tPlayerId)
                                    .Replace("{name}", session.Name));
                        }
                    });
                }
            }
    
  • Administrator

    Jeżeli plugin odpowiada Misc - No Permission to znaczy że coś nie tak z lokalizacją która jest w katalogu
    /oxide/lang/en/ExtTeleport trzeba by tam sprawdzić linijkę Misc - No Permission.

    W kwestii uprawnień trzeba by je najpierw sprawdzić czy grupa default - czyli gracz posiada dostęp do komendy.
    Sprawdzenie czy default posiada uprawnienia: /o.show group default
    Komenda na dodanie uprawnień: /o.group add default extteleport.player

    Tu są opisane uprawnienia: Klik


  • Dziękuję. Udało się ^_^

  • uModundefined uMod locked this topic on

Sugerowane tematy