1. When you use MOTD like this:
    Code:
        "1": "Welcome to GrayHeartGames",
        "2": "Join out TeamSpeak at Voice.GrayHeartGames.com"
    JUST ADD "," on second line, add new line without "," > like this

    Code:
        "1": "Welcome to GrayHeartGames",
        "2": "Join out TeamSpeak at Voice.GrayHeartGames.com",
        "3": "TODAY IS BEAUTIFUL DAY!"
     
  2. problem is only shows the MotD Title and the first line the 2 and 3 not show
     
  3. Code:
    10:45 AM [Error] Failed to call hook 'OnPlayerConnected' on plugin 'MOTD v1.0.0' (InvalidCastException: Cannot cast from source type to destination type.)
    10:45 AM [Debug]   at Oxide.Plugins.MOTD.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
     
    Last edited by a moderator: Dec 20, 2015
  4. Wulf

    Wulf Community Admin

    Here's an updated version that allows for multiple messages. Also removed the title/prefix and color settings as they are pointless, as you can easily add those to any message if you wanted to, but personally I find no prefix to be cleaner for server messages. Also switched to the Oxide API for message sending, and removed some unnecessary duplicate code and unused using statements. Ideally the messages would also be moved to the Lang API for localization per player, but that's something for a later date. As always, make sure to increment versions too, and keep the file name casing consistent.
     
  5. Code:
    [Oxide] 7:22 AM [Error] Failed to call hook 'OnPlayerConnected' on plugin 'MOTD
    v1.2.1' (InvalidCastException: Cannot cast from source type to destination type.
    )
    [Oxide] 7:22 AM [Debug]   at Oxide.Plugins.MOTD.Motd (.PlayerSession session) [0
    x00000] in <filename unknown>:0
      at Oxide.Plugins.MOTD.OnPlayerConnected (.PlayerSession session) [0x00000] in
    <filename unknown>:0
      at Oxide.Plugins.MOTD.DirectCallHook (System.String name, System.Object& ret,
    System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo metho
    d, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[]
    args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[]
    args) [0x00000] in <filename unknown>:0
     
  6. Wulf

    Wulf Community Admin

    Try the below attachment.
     
  7. get it worked now :D
     
  8. Wulf

    Wulf Community Admin

    Please see the post above your post.
     
  9. Wulf is it a potion to Reload autoexec.cfg ingame in the chat ?
     
  10. Wulf

    Wulf Community Admin

    No, there's nothing to reload that from the chat currently.
     
  11. 10:55 AM [Error] Error while compiling MOTD.cs(48,35): error CS1501: No overload for method `AppendChatboxServerSingle' takes `2' arguments
     
  12. Wulf

    Wulf Community Admin

    See MOTD | Page 2 | Oxide.
     
  13. Thanks Wulf
    11:06 AM [Info] MOTD was compiled successfully in 1629ms
    11:06 AM [Info] Loaded plugin MOTD v1.2.2 by [GHG] Gray
    [DOUBLEPOST=1451492437,1451405227][/DOUBLEPOST]
    Code:
    11:19 AM [Error] Failed to call hook 'OnPlayerConnected' on plugin 'MOTD v1.2.2' (NullReferenceException: Object reference not set to an instance of an object)
    11:19 AM [Debug]   at Oxide.Core.Configuration.DynamicConfigFile.ConvertValue (System.Object value, System.Type destinationType) [0x00000] in <filename unknown>:0
      at Oxide.Core.Configuration.DynamicConfigFile.ConvertValue[List`1] (System.Object value) [0x00000] in <filename unknown>:0
      at Oxide.Core.Configuration.DynamicConfigFile.Get[List`1] (System.String[] path) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MOTD.Motd (.PlayerSession session) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MOTD.OnPlayerConnected (.PlayerSession session) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MOTD.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
     
  14. Wulf

    Wulf Community Admin

    Delete your config, reload the plugin.
     
  15. Perfect! thanks wulf!
     
  16. Do I just place the MOTD,cs file into the oxide plugins folder?
     
  17. Wulf

    Wulf Community Admin

    Yes, use the version posted here: MOTD | Page 2 | Oxide.
     
  18. hi . please help me :) .


    MOTD PLUGIN 18:41 [Error] Error while compiling MOTD.cs(48,13): error CS0103: The name `ChatManager' does not exist in the current context.
    ForbiddenStakes 18:41 [Error] Error while compiling ForbiddenStakes.cs(163,49): error CS0117: `TerrainSettingsManager' does not contain a definition for `Instance'
     
    Last edited by a moderator: Oct 11, 2016
  19. Same here with MOTD.cs plugin.