Domestos submitted a new resource:
Custom Chat Commands - Completely dynamic and unlimited custom chat commands
Read more about this resource...
Custom Chat Commands [Replaced]
Discussion in 'Plugin Support' started by Domestos, Oct 16, 2014.
-
ChatName = SERVER
-
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
Juergen -
-
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 } }
-
-
Thank you for your Tips , now it works PERFECT !
br
Juergen -
Domestos updated Custom Chat Commands with a new update entry:
fixed chatname
-
Domestos updated Custom Chat Commands with a new update entry:
helptext, resourceid, cleanup
-
How does the example config distinguish what the /rules, /website and /givehelp are?
I used your example config and the error returned unknown command /websiteLast edited by a moderator: Nov 9, 2014 -
Domestos updated Custom Chat Commands with a new update entry:
permissions
-
Any way to execute other commands, so I can create shortcuts for things like the glue plugin? Or is it just for text?
-
-
Domestos updated Custom Chat Commands with a new update entry:
Rust update
-
Does it work with 0256?
-
-
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 -
-
Last game i have played i had alltime to Change the .lua... u helped me a lot. -
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 } } }