1. I have changed the config and saved it yet it shows the default message for the plugin.
     
  2. Did you reload the plugin?
     
  3. When you say reload do you mean restarting my server 5 times? Than yes or oxide.load welcome.lua <- for ex don't know file name off the top of my head
     
  4. Hmm, normally when you edit the configuration (.json) file in the config folder and then reload the plugin (oxide.reload) it should load the new config.
    Make sure the config is valid after editing it by running it through www.jsonlint.com or something similar.
     
  5. Wulf

    Wulf Community Admin

    oxide.reload pluginname will make it reload the conifg. You don't have to restart. If your configuration is resetting, then it's likely it was corrupt through modification. See what Mughisi said above.
     
  6. This plugin does not say welcome after player reconnects, how to fix?
     
  7. Wulf

    Wulf Community Admin

    The plugin was designed by the author to be a welcome message for new users, not a MOTD type setup.
     
  8. I added the following two lines between line 63 and 64 I hope it was safe:
    Code:
        tmpuser = ( ply.displayName )
        self.DisplayedWelcome[tmpuser] = nil
     
  9. Wulf

    Wulf Community Admin

    You can delete all the DisplayedWelcome stuff if you wanted it to be every time.
     
  10. Then it would display it at each wake-up would not it?
     
  11. Hi! Update plugin for new version please.
     
  12. Doesn't works on new version...
     
  13. None of the print to chat functions work, so wait for an oxide fix..
     
  14. It loads fine but it won't show up in the chat haha.

    Lets give time to dev :)
     
  15. Wulf

    Wulf Community Admin

    Try with this version. It has been updated, but untested.
     
  16. the welcome msg wont work ;)
    [DOUBLEPOST=1422711519][/DOUBLEPOST]
    Code:
    PLUGIN.Title = "User Connection Notification"
    PLUGIN.Version = V(1, 1, 4)
    PLUGIN.Description = "Welcome message"
    PLUGIN.Author = "Taffy"
    PLUGIN.HasConfig = true
    PLUGIN.ResourceId = 652function PLUGIN:Init()
        self.DisplayedWelcome = {}
        self:LoadDefaultConfig()
    endfunction PLUGIN:LoadDefaultConfig()
        self.Config.MultipleLineMessage = self.Config.MultipleLineMessage or { "Hi USERNAME! Welcome to the server","Enjoy you time with us." }
        self.Config.ChatName= self.Config.ChatName or "SERVER"
        self.Config.AllUserMessage = self.Config.AllUserMessage or "USERNAME has connected"
        self.Config.AllUserMessageBye = self.Config.AllUserMessageBye or "USERNAME has disconnected"
        self.Config.ShowConnected = self.Config.ShowConnected or "true"
        self.Config.ShowDisconnected = self.Config.ShowDisconnected or "true"
        self.Config.ShowWelcomeMessage = self.Config.ShowWelcomeMessage or "true"
    endfunction PLUGIN:OnPlayerInit(ply)
        if (self.Config.ShowConnected == "true") then
            self.tmpuser = (ply.displayName)
            allusermsg = (self.Config.AllUserMessage):gsub("USERNAME", self.tmpuser)
            rust.BroadcastChat(self.Config.ChatName, allusermsg)
        end
    endfunction PLUGIN:OnPlayerSpawn(ply)
        if (self.Config.ShowWelcomeMessage == "true") then
            DName = ply.displayName
            if self.DisplayedWelcome[DName] == nil then
                for k,v in pairs (self.Config.MultipleLineMessage) do
                    usermsg = v
                    usermsg = usermsg:gsub("USERNAME", DName)
                    usermsg = UnityEngine.StringExtensions.QuoteSafe(usermsg)
                    rust.SendChatMessage(ply, self.Config.ChatName, usermsg)
                end
                self.DisplayedWelcome[DName] = DName
            end
        end
    endfunction PLUGIN:OnPlayerDisconnected(ply, connection)
        if (ply.displayName and self.Config.ShowDisconnected == "true") then
            self.tmpuser = (ply.displayName)
            allusermsg = (self.Config.AllUserMessageBye):gsub("USERNAME", self.tmpuser)
            rust.BroadcastChat(self.Config.ChatName, allusermsg)
        else
            return
        end
        if (self.DisplayedWelcome[self.tmpuser] ~= nil) then
            self.DisplayedWelcome[self.tmpuser] = nil
        end
    end
    
     
  17. CHR

    CHR

    Connection message works but the welcome msg isnt displayed. Still ty. Waiting for Fix :)
     
  18. try it with rust.SendChatMessage .
     
  19. Still busted.