1. Does anyone know how to fix this?
    FortWars.cs(570,27): error CS0117: `ConsoleSystem' does not contain a definition for `Broadcast'

    Want to run Fortwars on a second server.
     
  2. Wulf

    Wulf Community Admin

  3. I looked at that last night and had no success (Still a noob with plugins)

    This is the original


    void BroadcastToChat(string msg)
    {
    Debug.Log(msg);
    ConsoleSystem.Broadcast("chat.add", new object[] { 0, msg });
    }
    private void SendChatMessage(BasePlayer player, string message)
    {
    player?.SendConsoleCommand("chat.add", -1, message);
    }


    This is what i changed it too


    void MessageToAll(string message)
    {
    Debug.Log(message);
    PrintToChat(string.Format(Format)+ message);
    }
    private void MessageToPlayer(BasePlayer player, string message)
    {
    PrintToChat(player, string.Format(Format)+ message);
    }


    Now im getting an error error "CS0103: the name 'format' does not exist in the current context"
     
  4. Wulf

    Wulf Community Admin

    Why are you trying to make your own chat sending methods? Just use PrintToChat directly. The error is from "format" not existing in your code from what I can tell.
     
  5. Like i said still a noob trying to understand the codings etc xD I will learn just need help pointing in the right direction. So instead of using ConsoleSystem.Broadcast i should just use PrintToChat?
     
  6. Wulf

    Wulf Community Admin

    No worries, and yes, that would be the best option, less code too.
     
  7. Think im a little to stupid for this xD changed
    "ConsoleSystem.Broadcast("chat.add", new object[] { 0, msg });" >>> "PrintToChat("chat.add", new object[] { 0, msg });"

    Now sitting here with an error "error CS1501: No overload for method `Spawn' takes `1' arguments"

    Also would i need to change "player?.SendConsoleCommand("chat.add", -1, message);" i dont know how most of you plugin devs find this so easy lol
     
  8. Wulf

    Wulf Community Admin

    Broadcasting to all would be: PrintToChat("message goes here")
    Sending to one player would be: PrintToChat(player, "message goes here")

    The spawn message isn't related to anything mentioned in this thread.
     
  9. Fixed it was to do with the entity.spawn(true) changed it to entity.spawn() maybe there is hope of me actually learning this stuff after all appreciate your help wulf
     
  10. Off topic wulf but anyway i can add timed chat commands into the plugin? Want messages every 5 minutes saying how long is left
     
  11. Wulf

    Wulf Community Admin

    Check out the Timer library in our Docs or on GitHub. My AutoBroadcast plugin is also an example.
     
  12. Thanks for the help on that one! :) Now trying to fix another plugin "Mind Freeze" im assuming this is the line causing the error "current.Player.ClientRPCPlayer(null, current.Player, "ForcePositionTo", new object[] { current.FrozenPosition });"

    i looked around and see others suggesting using "Player.ClientRPCPlayer" but using that gives me a new error "error cs0103: The name 'Player' does not exist in the current context".

    Any idea's?
     
  13. You should maybe start a new thread, because its a complete new topic on an already solved thread.