1. Mathias submitted a new resource:

    Join/Leave Messages - Broadcast messages when a player joins/leaves the server. Optional MOTD setting.

    Read more about this resource...
     
  2. Code:
    function PLUGIN:OnPlayerDisconnected(netuser)
        rust.BroadcastChat(netuser:GetLocalData().displayName.. self.Config.LeaveMSG)
    end
    displayName is for NetUser
    OnPlayerDisconnected uses NetworkPlayer, so you first need to get the netuser with GetLocalData()
    ^^
     
  3. Is this still working, it doesn't seem to work on my server.
    I have the rules plugin also.
     
  4. It works for me. You are running Oxide 2.0, right? Are there any error messages when you use my plugin?
     
  5. rust.BroadcastChat() was slightly changed in the last build and now takes a chatname as well. The function might change a tiny bit again in the future to make the chatname optional but I have to look into it how to handle it as it is already taking option arguments.
     
  6. Just to be sure - as I haven't updated my Oxide version yet - is this the correct way of using the updated rust.BroadcastChat function?:
    Code:
    function PLUGIN:OnPlayerConnected(netuser)
        if(self.Config.showMOTD == "true") then      
            rust.SendChatMessage(netuser, self.Config.MOTD)
        end
        rust.BroadcastChat(self.Config.chatName, netuser.displayName .. self.Config.JoinMSG)
    endfunction PLUGIN:OnPlayerDisconnected(netuser)
        rust.BroadcastChat(self.Config.chatName, netuser:GetLocalData().displayName.. self.Config.LeaveMSG)
    end
     
  7. That appears to be correct.
     
  8. The BroadcastChat doesn't work. It just prints the chatName
    e.g Oxide: Oxide

    [​IMG]
     
  9. I have asked my server provider to update to the newest version so I'll try to fix the issue ASAP. Sorry for the delay. If it worked in the previous version then you can download it here: http://oxidemod.org/plugins/join-leave-messages.953/history

    But if it works with the previous version, then I don't think you have updated your Oxide mod yourself.
     
    Last edited by a moderator: Apr 20, 2015
  10. The previous version 1.0.0 displays OnPlayerConnected fine. I'm running the latest Oxide (2.0.765) for Legacy.
    If I remove self.Config.chatName from BroadcastChat then it works fine.
     
  11. It actually depends on what your GSP uses, if they are running the latest download from the website then you still have the "old" BroadcastChat function that uses Oxide as the chatname, if your GSP uses the snapshots (as most do) then the new function is used that requires a chatname to be provided. If you are hosting it yourself you can get the latest snapshot (2.0.773) from Github here: https://github.com/OxideMod/Snapshots/blob/master/Oxide-RustLegacy.zip
     
  12. 2.0.773 doesn't seem to happy so will wait

    Code:
    12:47 AM [Info] Loading Oxide core v2.0.773...
    12:47 AM [Info] Loading extensions...
    12:47 AM [Info] Loaded extension CSharp v0.6.773 by bawNg
    12:47 AM [Info] Loaded extension JavaScript v1.0.773 by Nogrod
    12:47 AM [Info] Loaded extension Lua v1.0.773 by Oxide Team
    12:47 AM [Info] Loaded extension MySql v1.0.773 by Nogrod
    12:47 AM [Info] Loaded extension Python v1.0.773 by Nogrod
    12:47 AM [Info] Loaded extension RustLegacy v1.0.773 by Oxide Team
    12:47 AM [Info] Loaded extension SQLite v1.0.773 by Nogrod
    12:47 AM [Info] Loaded extension Unity v1.0.773 by Oxide Team
    12:47 AM [Info] Loading plugins...
    12:47 AM [Info] Loaded plugin Rust Legacy Core v1.0.0 by Oxide Team
    12:47 AM [Info] Loaded plugin Unity Core v1.0.0 by Oxide Team
    12:47 AM [Info] Loaded plugin Admin / Player v2.0.1 by Reneb
    12:47 AM [Info] Loaded plugin Auto Admin v1.0.0 by greyhawk, Ported by Reneb to Oxide 2.0
    12:47 AM [Info] Loaded plugin Helptext v1.0.1 by #Domestos
    12:47 AM [Info] Loaded plugin Join-Leave Messages v1.0.2 by mvrb
    12:47 AM [Info] Loaded plugin Private Messaging v1.0.0 by #Domestos
    12:47 AM [Info] Loaded plugin Server Rules v1.0.0 by mvrb
    12:47 AM [Info] AdminAirdrop, AdminTeleportation, AntiCheat, AntiGlitch, DoorShare, GatherMultiplier, KickBan, Kits, Location, LootSpawnLists, PlayerDatabase, Prod, RemoverTool, Share, TimeManagement and TPR were compiled successfully in 1233ms
    12:47 AM [Info] Loaded plugin AdminAirdrop v1.0.2 by Reneb
    12:47 AM [Info] Loaded plugin AdminTeleportation v1.0.0 by Reneb
    12:47 AM [Info] Loaded plugin AntiCheat v2.0.11 by Reneb
    12:47 AM [Info] Loaded plugin AntiGlitch v2.0.4 by Reneb
    12:47 AM [Info] Loaded plugin DoorShare v1.0.2 by Reneb
    12:47 AM [Info] Loaded plugin GatherMultiplier v1.0.2 by Reneb
    12:47 AM [Info] Loaded plugin KickBan v1.0.1 by Reneb & Mughisi
    12:47 AM [Info] Loaded plugin Kits v1.0.7 by Reneb
    12:47 AM [Info] Loaded plugin Location v1.0.1 by Reneb
    12:47 AM [Info] Loaded plugin LootSpawnLists v2.0.0 by Reneb from thomasfn
    12:47 AM [Info] Loaded plugin PlayerDatabase v1.2.3 by Reneb
    12:47 AM [Info] Loaded plugin Prod v1.0.2 by Reneb
    12:47 AM [Info] Loaded plugin RemoverTool v1.0.3 by Reneb
    12:47 AM [Info] Loaded plugin Share v1.0.1 by Reneb
    12:47 AM [Info] Loaded plugin TimeManagement v1.0.0 by Reneb
    12:47 AM [Info] Loaded plugin TPR v1.0.2 by Reneb
    12:47 AM [Info] 31 custom loot tables were loaded!
    12:47 AM [Error] Failed to call hook 'OnPlayerConnected' on plugin 'Join-Leave Messages'
    File: JoinLeaveMessages.lua Line: 23 invalid arguments to method call:
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    12:48 AM [Error] Failed to call hook 'cmdHelp' on plugin 'Helptext'
    File: helptext.lua Line: 28 invalid arguments to method call:
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
     
  13. Code:
    File: JoinLeaveMessages.lua Line: 23 invalid arguments to method call:
    @Mughisi has
    Code:
    rust.SendChatMessage()
    changed as well?

    If yes, would it be:
    Code:
            rust.SendChatMessage(netuser, self.Config.chatName, self.Config.MOTD)    
    ?
     
  14. Yea :) I'll probably PR a change tonight to have the name optional so it will work with (netuser, msg) and (netuser, chatname, msg) but that will still take a few hours as I'm not able to access my pc right now.
     
  15. Ah, well that makes sense then. And cool!
     
  16. Can it do more than one line? For the motd
     
    Last edited by a moderator: Apr 20, 2015
  17. What exactly do you mean?