1. Ok thanks. At work at the moment so will look as soon as I get back tomorrow or will try tonight from hotel.
     
  2. To fix spawn broadcast

    Make the changes below:

    Change:
    Code:
    function PLUGIN:OnPlayerSpawn( ply,connection )
        if(self.Config.ShowConnected) then
            tmpuser= ( connection.username )
                --Send message to all connected users
                    allusermsg = (self.Config.AllUserMessage)
                    allusermsg = allusermsg:gsub("USERNAME",tmpuser)
                    global.ConsoleSystem.Broadcast("chat.add \"" .. self.Config.ChatName .. "\" \"" .. allusermsg .. "\"")
        end
    end---testing for when player clicks wake up
    function PLUGIN:OnRunCommand( arg , ply)
        -- Sanity checks
        if (not arg) then return end
        if (not arg.connection) then return end
        if (not arg.connection.player) then return end
        local ply = arg.connection.player
        DName = ply.displayName
        if (ply.wakeup) then -- user has pressed the wake up button
            if self.DisplayedWelcome[DName] == nil then
                usermsg = (self.Config.UserMessage)
                usermsg = usermsg:gsub("USERNAME",DName)
                ply:ChatMessage(usermsg)  -- sends the message to the connecting player
                self.DisplayedWelcome[DName] = DName
            end
        end
    end
    To:
    Code:
    --Logged into the game world
    function PLUGIN:OnPlayerSpawn(ply, connection)
    end---When player wakes up
    function PLUGIN:OnRunCommand( arg , ply)
        -- Sanity checks
        if (not arg) then return end
        if (not arg.connection) then return end
        if (not arg.connection.player) then return end
        local target = arg.connection.player
        displayName = target.displayName
        if (target.wakeup) then -- user has pressed the wake up button
            if self.DisplayedWelcome[displayName] == nil then
                broadcast = self.Config.Messages.BroadcastLogin
                broadcast = broadcast:gsub("{UserName}",displayName)
                global.ConsoleSystem.Broadcast("chat.add \"" .. self.Config.Settings.ChatName .. "\" \"" .. broadcast.. "\"")
                usermsg = (self.Config.Messages.NewUserMessage)
                usermsg = usermsg:gsub("{UserName}",displayName)
                target:ChatMessage(usermsg)  -- sends the message to the connecting player
                target:ChatMessage("Use /list to see available commands!")
                self.DisplayedWelcome[displayName] = displayName
            end
        end
    end
    Edit: Sorted variables, a copy paste should work for those that need it as long you, yourself have not changed the script. In which case simply adjust it accordingly.

    Note: This solution moves the spawn broadcast to when the player wakes up, not on world entry.

    Forgot to mention very nice work Taffy!
     
    Last edited by a moderator: Oct 24, 2014
  3. Taffy updated Welcome Message and Notifications with a new update entry:

    Changed user connection method following Oxide Update

     
  4. Still do not understand how this works?

    if (ply.wakeup) then

    There is no thing called wakeup associated with the baseplayer class. Also it doesn't conform to the coding standards they use (i.e. ply.displayName). How is this detecting that the player has clicked the wakeup button?

    Code:
     public enum Type
        {
            Normal,
            Sleeping,
            Dead,
            Spectating
        }
    To do this correctly you probably need to evaluate the player state.

    I think you want the following

    if ( ply.playerState.state == 1 ) then
    end
     
    Last edited by a moderator: Oct 24, 2014
  5. Beats me how the hell I came up with that code and how it works tbh :confused: Bad idea to be coding and drinking at the same time. Going to update the evaluator as follows;

    Code:
    if (arg.cmd.name == "wakeup") 
    Will update new version with this code in a sec

    Cheers
    Dave
     
  6. awesome thanks...no it makes sense...funny thing maybe I need to start drinking when I work on this stuff...for some reason I NEVER even thought of evaluating the arg!!!
     
  7. [​IMG]
    Had this issue all day, updating the plugin still causes this error.
     
  8. Cant seem to recreate the problem myself mate. Let me know what plugins and versions of them you are running, I will put them on my test box and see if I can recreate. Perhaps there is a conflict with another plugin.
     
  9. hi m8 just added this is there a tip for loading plugin , i used oxide.load but since oxide update doesnt
    work is there any other way, i cant restart server because if i do all keys on server stop working ???
     
  10. oxide.load
    oxide.unload
    oxide.reload

    That should be correct, if they don't work try reinstalling oxide.

    Once you've loaded a plugin you can reload it to get the config files working and then reload again to get the modded versions (the mods you made) working.
     
  11. thanks very much
     
  12. Would it be possible to add timed notifications (like motd, rules, etc) to this plugin?
     
  13. probably better to make a new plugin for it :)
     
  14. Working on either implementing an optional timed broadcast message or another plugin, intention is to make it part of this plugin though
     
  15. Hi, v1.0.5 , spam :
    [​IMG]

    Oxide b16 for v313