1. Domestos submitted a new resource:

    Custom Chat Commands - Completely dynamic and unlimited custom chat commands

    Read more about this resource...
     
  2. ChatName = SERVER :)
     
  3. Hello , i have modified my chat commands.
    But Oxide displays only the last Text Entry of each command Block.
    Can someone help me ?
    Sorry for my bad english ...

    Here is my work:
    Code:
    PLUGIN.Name = "CustomChatCommands"
    PLUGIN.Title = "Custom Chat Commands"
    PLUGIN.Description = "Set completely custom chat commands"
    PLUGIN.Author = "#Domestos"
    PLUGIN.Version = V(2, 0, 0)
    PLUGIN.HasConfig = truefunction PLUGIN:Init()
        for key, value in pairs(self.Config.ChatCommands) do
            command.AddChatCommand(key, self.Object, "cmdChatCmd")
        end
    endfunction PLUGIN:LoadDefaultConfig()
        self.Config.Settings = self.Config.Settings or {}
        self.Config.Settings.ChatName = self.Config.Settings.ChatName or "SERVER"
        self.Config.ChatCommands = self.Config.ChatCommands or {
        ["hilfe"] = {
                ["text"] = {"Hilfesystem by Juergen Grey"},
                ["text"] = {"*************************************************************"},
                ["text"] = {"Die Server Regeln bitt elesen und beachten ==> /regeln"},
                ["text"] = {"Hilfe zum Teleport System ==> /htp"},
                ["text"] = {"Hilfe zu Kits ==> /hkit"},
                ["text"] = {"Wer ist Online ? ==> /who"},
                ["text"] = {"Hilfe zum Remove Befehl ==> /hrem"},
                ["text"] = {"Admin Hilfe ==> /hadm"},
                ["admin"] = false
                },
            ["hadm"] = {
                ["text"] = {"Admin Hilfe"},
                ["text"] = {"Admin Teleport Befehle"},
                ["text"] = {"/tp Spielername ==> teleportiert dich zum Spieler"},
                ["text"] = {"/tp Spieler1 Spieler2 ==> teleportiert die Spieler zueinander"},
                ["admin"] = true
                },
            ["htp"] = {
                ["text"] = {"Hilfe zu den Teleport Befehlen"},
                ["text"] = {"************************************************************************"},
                ["text"] = {"wenn du Dich zu einem anderen Spieler teleportieren moechtest benutze:"},
                ["text"] = {"/tpr Spielername"},
                ["text"] = {"Wenn du eine Teleport Anfrage annehmen willst benutze:"},
                ["text"] = {"/tpa"},
                ["text"] = {"Wenn du eine Teleport Anfrage ablehnen willst benutze:"},
                ["text"] = {"/tpd"},
                ["text"] = {"Wenn du eine Teleport Anfrage abbrechen willst benutze:"},
                ["text"] = {"/tpc"},
                ["admin"] = false
                },
            ["hkit"] = {
                ["text"] = {"Es gibt leider noch keine starter Kits."},
                ["text"] = {"wenn du Hilfe brauchst frage im Chat ob ein Admin on ist !"},
                ["text"] = {"wenn ich online bin helfe ich gerne !"},
                ["admin"] = false
                },
            ["who"] = {
                ["text"] = {"Mit diesem Befehl erhältst du eine Liste der Spieler die online sind"},
                ["admin"] = false
            },
            ["hrem"] = {
                ["text"] = {"Der Remove Befehl ist im Moment fuer Spieler gesperrt"},
                ["text"] = {"wenn du Hilfe brauchst wenn du Hilfe brauchst wende Dich an einen Admin"},
                ["admin"] = false
            },
            ["regeln"] = {
                ["text"] = {"Die Sprache im Chat ist ausschliesslich DEUTSCH !!!"},
                ["text"] = {"bitte keine schlafenden Spieler killen"},
                ["text"] = {"bitte keine schlafenden Spieler looten"},
                ["text"] = {"bitte unterstützt die Anfaenger"},
                ["admin"] = false
            }
        }
    endfunction PLUGIN:cmdChatCmd(player, cmd, args)
        for key, value in pairs(self.Config.ChatCommands) do
            if(cmd == key) then
                -- Check if command is admin only
                if(self.Config.ChatCommands[key].admin == true) then
                    -- Check if user has permission to use command
                    if(player:IsAdmin() == true) then
                        -- Output the text
                        for k, v in pairs(self.Config.ChatCommands[key].text) do
                            player:ChatMessage(self.Config.ChatCommands[key].text[k])
                            -- player:SendConsoleCommand("chat.add \""..self.Config.Settings.ChatName.."\""..self.Config.ChatCommands[key].text[k])
                        end
                    end
                else
                    -- Command can be used by everyone
                    for k, v in pairs(self.Config.ChatCommands[key].text) do
                        player:ChatMessage(self.Config.ChatCommands[key].text[k])
                        -- player:SendConsoleCommand("chat.add \""..self.Config.Settings.ChatName.."\""..self.Config.ChatCommands[key].text[k])
                    end
                end
            end
        end
    end
    
    br
    Juergen
     
  4. Dont edit the .lua file. Everything is controlable in the config file.
     
  5. Ok.
    I gone Back to the Original Lua and edited the Config File like this:

    Code:
    {
         "ChatCommands": {
        ["hilfe"] = {
                ["text"] = {"Hilfesystem by Juergen Grey"},
            ["text"] = {"*************************************************************"},
                ["text"] = {"Die Server Regeln bitt elesen und beachten ==> /regeln"},
                ["text"] = {"Hilfe zum Teleport System ==> /htp"},
                ["text"] = {"Hilfe zu Kits ==> /hkit"},
            ["text"] = {"Wer ist Online ? ==> /hwho"},
            ["text"] = {"Hilfe zum Remove Befehl ==> /hrem"},
            ["text"] = {"Admin Hilfe ==> /hadm"},
                ["admin"] = false
                },
            ["hadm"] = {
                ["text"] = {"Admin Hilfe"},
                ["text"] = {"Admin Teleport Befehle"},
                ["text"] = {"/tp Spielername ==> teleportiert dich zum Spieler"},
                ["text"] = {"/tp Spieler1 Spieler2 ==> teleportiert die Spieler zueinander"},
                ["admin"] = true
                },
            ["htp"] = {
                ["text"] = {"Hilfe zu den Teleport Befehlen"},
                ["text"] = {"************************************************************************"},
                ["text"] = {"wenn du Dich zu einem anderen Spieler teleportieren moechtest benutze:"},
                ["text"] = {"/tpr Spielername"},
                ["text"] = {"Wenn du eine Teleport Anfrage annehmen willst benutze:"},
                ["text"] = {"/tpa"},
                ["text"] = {"Wenn du eine Teleport Anfrage ablehnen willst benutze:"},
                ["text"] = {"/tpd"},
                ["text"] = {"Wenn du eine Teleport Anfrage abbrechen willst benutze:"},
                ["text"] = {"/tpc"},
                ["admin"] = false
                },
            ["hkit"] = {
                ["text"] = {"Es gibt leider noch keine starter Kits."},
                ["text"] = {"wenn du Hilfe brauchst frage im Chat ob ein Admin on ist !"},
                ["text"] = {"wenn ich online bin helfe ich gerne !"},
                ["admin"] = false
                },
            ["hwho"] = {
                ["text"] = {"Mit diesem Befehl erhältst du eine Liste der Spieler die online sind"},
                ["admin"] = false
            },
            ["hrem"] = {
                ["text"] = {"Der Remove Befehl ist im Moment fuer Spieler gesperrt"},
                ["text"] = {"wenn du Hilfe brauchst wenn du Hilfe brauchst wende Dich an einen Admin"},
                ["admin"] = false
            },
            ["regeln"] = {
                ["text"] = {"Die Sprache im Chat ist ausschliesslich DEUTSCH !!!"},
                ["text"] = {"bitte keine schlafenden Spieler killen"},
                ["text"] = {"bitte keine schlafenden Spieler looten"},
                ["text"] = {"bitte unterstützt die Anfaenger"},
                ["admin"] = false
            }
        }
    if i try "/hilfe" i become back unknown command !
     
  6. Because your whole config file isnt in the right format. Delete your config file, reload the plugin to let it generate a new default one and then simply edit the entries, dont change the format. There are examples in the default config to see how multiline messages are formatted.
     
  7. Thank you for your Tips , now it works PERFECT !

    br
    Juergen
     
  8. Domestos updated Custom Chat Commands with a new update entry:

    helptext, resourceid, cleanup

     
  9. How does the example config distinguish what the /rules, /website and /givehelp are?

    I used your example config and the error returned unknown command /website
     
    Last edited by a moderator: Nov 9, 2014
  10. Any way to execute other commands, so I can create shortcuts for things like the glue plugin? Or is it just for text?
     
  11. Only text currently.
     
  12. Domestos updated Custom Chat Commands with a new update entry:

    Rust update

     
  13. CHR

    CHR

    Does it work with 0256?
     
  14. I dont see a reason why it wouldnt. Just test it.
     
  15. CHR

    CHR

    I got some Problems after i Change something it dosnt work... for no reason im sure i do it right...

    Could u check this ist attached
     
  16. Never edit the .lua files. There is a config file generated in your config folder.
     
  17. CHR

    CHR

    Allright Ty.

    Last game i have played i had alltime to Change the .lua... u helped me a lot.
     
  18. Nice plugin, thanks.

    FIX THE CONFIG:
    "helptext":false[[,]]

    Code:
    {
      "Settings":{
        "ChatName":"SERVER"
      },
      "ChatCommands":{
        "rules":{
          "text":["1 - Dont cheat", "2 - No discrimination", "3 - Be nice"],
          "helptext":"use /rules to display our rules",
          "admin":false
        },
        "website":{
          "text":["Our website is www.example.com"],
          "helptext":"use /website to get our homepage url",
          "admin":false
        },
        "givehelp":{
          "text":["The syntax for /give is /give name item amount"],
          "helptext":false,
          "admin":true
        }
      }
    }