[DOUBLEPOST=1509729802][/DOUBLEPOST]Changing rust.BroadcastChat(message) to rust.BroadcastChat(null,message) fixed itCode:(18:10:32) | Web request callback raised an exception (NullReferenceException: Object reference not set to an instance of an object) (18:10:32) | at Oxide.Core.Libraries.Covalence.Formatter+Lexer.Lex (System.String text) [0x00000] in <filename unknown>:0 at Oxide.Core.Libraries.Covalence.Formatter.Parse (System.String text) [0x00000] in <filename unknown>:0 at Oxide.Core.Libraries.Covalence.Formatter.ToTreeFormat (System.String text, System.Collections.Generic.Dictionary`2 translations) [0x00000] in <filename unknown>:0 at Oxide.Core.Libraries.Covalence.Formatter.ToUnity (System.String text) [0x00000] in <filename unknown>:0 at Oxide.Game.Rust.Libraries.Server.Broadcast (System.String message, System.String prefix, UInt64 userId) [0x00000] in <filename unknown>:0 at Oxide.Game.Rust.Libraries.Rust.BroadcastChat (System.String name, System.String message, System.String userId) [0x00000] in <filename unknown>:0 at Oxide.Plugins.PlayRustLastNews.APIResponse (Int32 code, System.String response, System.String apiType, Int32 numberCheck) [0x00000] in <filename unknown>:0 at Oxide.Plugins.PlayRustLastNews+<CheckWebsite>c__AnonStorey0.<>m__0 (Int32 code, System.String response) [0x00000] in <filename unknown>:0
Solved SendChatMessage and Broadcast usage?
Discussion in 'Rust Development' started by GhostGaming, Nov 2, 2017.
-
Whats happend with my plugin?
[Error] Failed to call hook 'OnPlayerChat' on plugin 'PlayerCount v1.0.99' (NullReferenceException: Object reference not set to an instance of an object)
18:50 [Stacktrace] at Oxide.Core.Libraries.Covalence.Formatter+Lexer.Lex (System.String text) [0x00000] in <filename unknown>:0
at Oxide.Core.Libraries.Covalence.Formatter.Parse (System.String text) [0x00000] in <filename unknown>:0
at Oxide.Core.Libraries.Covalence.Formatter.ToTreeFormat (System.String text, System.Collections.Generic.Dictionary`2 translations) [0x00000] in <filename unknown>:0
at Oxide.Core.Libraries.Covalence.Formatter.ToUnity (System.String text) [0x00000] in <filename unknown>:0
at Oxide.Game.Rust.Libraries.Server.Broadcast (System.String message, System.String prefix, UInt64 userId) [0x00000] in <filename unknown>:0
at Oxide.Game.Rust.Libraries.Rust.BroadcastChat (System.String name, System.String message, System.String userId) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PlayerCount.OnPlayerChat (.Arg arg) [0x00000] in <filename unknown>:0
at Oxide.Plugins.PlayerCount.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod 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 hook, System.Object[] args) [0x00000] in <filename unknown>:0 -
I tried to compare notifier with deathnotes to find any clue, how i can fix this, but i don't know :/ -
Wulf Community Admin
-
i am still confused as i do not know anything about coding. can someone fix my Notifier so that its messages dont show the prefix code like in the screenshot i have attached.
thanks in advance to whoever does this or helps me outAttached Files:
Last edited by a moderator: Nov 3, 2017 -
-
Please, help me for Notifier SkinN.
After this update I could not update more
sorry for my EnglishLast edited by a moderator: Nov 4, 2017 -
@Wulf Could you explain how this code works? and what is the null for?
Code:rust.SendChatMessage(player, SimpleColorFormat(null, "<silver>" + msg + "<end>"), profile);
-
The "Null" is a reference to the message prefix. So if you wanted to send a message like its coming from a player, you would pass the player's name there.
However, if you pass Null it just ignores the prefix and puts the message in chat.
Personally I just use:
Code:player.SendConsoleCommand("chat.add", userId, message, 1.0);
-
Wulf Community Admin
-
-
@Wulf with what Can I change the RestrictedInventory because I'm getting this error RestirectedInventory could not be found are you missing a reference?
-
Wulf Community Admin