When you use MOTD like this:
JUST ADD "," on second line, add new line without "," > like thisCode:"1": "Welcome to GrayHeartGames", "2": "Join out TeamSpeak at Voice.GrayHeartGames.com"
Code:"1": "Welcome to GrayHeartGames", "2": "Join out TeamSpeak at Voice.GrayHeartGames.com", "3": "TODAY IS BEAUTIFUL DAY!"
MOTD [Unmaintained]
Discussion in 'Plugin Support' started by [GHG] Gray, Dec 11, 2015.
-
problem is only shows the MotD Title and the first line the 2 and 3 not show
-
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 -
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.
-
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
-
Wulf Community Admin
-
get it worked now
-
Wulf Community Admin
-
Wulf is it a potion to Reload autoexec.cfg ingame in the chat ?
-
Wulf Community Admin
-
oh ok
-
10:55 AM [Error] Error while compiling MOTD.cs(48,35): error CS1501: No overload for method `AppendChatboxServerSingle' takes `2' arguments
-
Wulf Community Admin
-
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
-
Wulf Community Admin
-
Perfect! thanks wulf!
-
Do I just place the MOTD,cs file into the oxide plugins folder?
-
Wulf Community Admin
-
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 -