Solved 123istered

Discussion in 'Rust Development' started by ZeusGOD, Sep 15, 2016.

  1. permission.RegisterPermission("chat.1", this); for C#

    it is wrong ??
     
  2. Wulf

    Wulf Community Admin

    I'd need to see your full code, not just a portion.
     
  3. permission.RegisterPermission("chat.siro", this);

    if (permission.UserHasPermission(uid, "chat.siro"))
    {
    prefixperson = "[Loli]";
    color = "lightblue";
    }
     
  4. Wulf

    Wulf Community Admin

    Full code please, I can't tell what is going on just by the single line and snippet.
     
  5. It's a hard work ;)
     
  6. Code:
    using Oxide.Core;
    using Oxide.Core.Plugins;
    using Oxide.Core.Libraries.Covalence;
    using Oxide.Game.Rust.Cui;using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Reflection;using Rust;
    using UnityEngine;namespace Oxide.Plugins
    {
        [Info("Chat", "NEKO", "1.0.3", ResourceId = 0)]
        class Chat : RustPlugin
        {
            Dictionary<ulong, List<int>> stats = new Dictionary<ulong, List<int>>();        void LoadData()
            {
                stats = Interface.Oxide.DataFileSystem.ReadObject<Dictionary<ulong, List<int>>>("player.stats");
            }
            void SaveData()
            {
                Interface.Oxide.DataFileSystem.WriteObject("player.stats", stats);
            }        private bool OnPlayerChat(ConsoleSystem.Arg arg)
            {
                permission.RegisterPermission("chat.siro", this);
                 
                if (message.StartsWith("/")) return false;
                // code continues here
                return true;
            }
        }
    }
     
  7. Wulf

    Wulf Community Admin

    Don't register the permission each time a player chats, only register in Init, Loaded, or whatever hook only triggers once per load.
     
  8. how to fix that?
     
  9. Wulf

    Wulf Community Admin

    Register it in Init(), Loaded(), or whatever hook only triggers once.
     
  10. yep kk thank you bro!
    [DOUBLEPOST=1474031509][/DOUBLEPOST]
    hey wulf how to theard delete ??

    my chating sorce delete !
     
  11. "Edit" your posts and remove content you dont want to display anymore, and leave at min 6 chars, like EDITED
     
  12. Edited the posts for you.