Stopped working on TimCommands, use ChatCommands instead.
ChatCommands: https://modwork.shop/15977
Chat replace feature is now a extra mod found here:
ChatChars: https://modwork.shop/18960
About
This mod adds the ability to run commands from the chat.
You can use this to run your scripts via a chat command. Just paste your things in the right position in "/lua/tim.lua".
This mod also adds the ability to write some of the special chars to the ingame chat. e.g. the ghost or skull symbol.
Features
- use commands in chat
- add own commands if you like + set your help localization (help text)
- write special chars into the chat
- extra option to auto replace chars, so the "/c" command is not needed before the message (configurable in options)
- chat message if your health is below 15% (configurable in options)
- chat message if your ammo is below 15% (configurable in options)
- system messages (client and if others have installed) -> not tested out yet
- safe-mode -> to function with other mods if you need so
Languages: english, Deutsch
add your own Commands
where to add?
There is an comment in "TimCommands/lua/tim.lua" called"-- new commands can be added here". Right after there you can write your command.
how to add?
just take this:
TimClass:AddCommand('test', false, '', function(parameter)
--your code--
end)
it works so:
AddCommand(commands(s), host, helptextid, function(parameter)
--your code--
end)
command(s): The command you want to use eg: "test" or for multiple names for it {"t", "test", "testirunthesamething"} .
host: Do you try cheaty things? Sometimes its better you check, that you are the host... values: true or false
helptextid: When you run /help, you can have a help text for your command.
Just open up the "TimCommands/langugage/" folder, open the language you need a text for (english is prefered if eg a german string is not given in the de.txt) and add the string. Do like this: "the_id" : "the translation", <- Look if a comma is needed! if its the last entry you don't need a comma. (just to remind you) and put the id into the code.
Little hint:
You can get every string in the localization by using:
managers.localization:text("the_id")
parameter: This is the string after the command. At the moment is is returned as a string, so you may need to split it, if you have more than one parameter.
--your code--: Now it's your turn. The help ends here. But I allow you to look a bit and copy things from within this mod. ;D
Compatibility
- normal mode: this mod will do its thing
- hybrid mode: this mod will do its thing, and write the cmd into the chat, so other mods can use
tip: You can rename the commands to use this mod with other mods like this. Look over to "add commands". You can edit the commands written by me. ;) - safe-mode: only the safemode command will work (to enable the mod again)
BLT will keep this mod on the newest version once installed.
