1. I am overwritting the default chat for my plugin to use, and upon trying to send the chat to console using something like
    Code:
    global.ServerConsole.PrintColoured(System.ConsoleColor.Cyan, msg)
    
    I get the response of the following error:
    Code:
    [Oxide] 5:24 PM [Error] Failed to call hook 'OnPlayerChat' on plugin 'Ranks And Titles' (InvalidCastException: Cannot cast from source type to destination type.)
    [Oxide] 5:24 PM [Debug]   at ServerConsole.PrintColoured (System.Object[] objects) [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 
    
    Is there a different way to run this in JavaScript? Or am I just applying it incorrectly?
     
  2. the PrintColoured method expects params as int and string, but in JavaScript all numbers are double values and the method fails to convert...i've currently no idea how to fix it without patching the method...
     
  3. Is there a work around I can pull to get around this issue instead?
     
  4. Wulf

    Wulf Community Admin

    You can use the regular printing methods instead.
     
  5. Oh, right, I can just use print. Duh... Thanks @Wulf