Push changes that should have been pushed with 1.4.0
Fix permission issues with aliases causing the script to return that a command doesn't exist when you don't have access to the alias instead of saying you don't have the permission as expected
[Refactor] Change ExecuteCommand and TryExecuteCommand function names to reflect changes made in the T6 script that fixed an issue. The change here is only made to keep a logic between the scripts but that bug didn't exist in the IW5 version due to how IW5 works
Added an alias system so that a command can be called with different names.
The alias commands respects the permission system and can be used seemingly with the help and alias command.
The commands command still only lists the original/full command name, it doesn't list aliases
CreateCommand now has an addition argument commands can use: commandAliases
Added a new !alias or !aliases command
With these commands you can get the available alias(es) of a command by its original name or one of its alias
For example !alias god or !alias godmode
Some refactor to make the ChatListener function easier to read along with some comments to separate each command logic (built-in commands and "any other command")
Added CommandAliasesDoesNotExistError
Added GetCommandNameFromAlias util function
Only create variables for the port currently in-use
For example: there's no need to create level.chat_commands["27017"] if the currently used port is 27016. This simply adds a bunch of variables and child variables for no reason, this was a flawed implementation that create an array per port on every server. Now it will only create an array for its own port as expected
Removed 27018 from the default ports
This is to make the default experience more generic across other chat_commands projects. One port for default private games and another port the expected/most used port for dedicated servers
Give dead silence pro to avoid dying when falling from a high height.
This only gives it if the player doesn't have it already and it only takes it away if it was granted by the god mode in the first time
This update adds an optional permission system that commands can use to determine what the minimum permission level is to be able to access that specific command
This update forces changes on the other commands scripts. If you download this version make sure to download the updated version of your individual chat command(s) script as well
Added cc_debug dvar
Added cc_permission_enabled
Added cc_commands_mode dvar
Added cc_permission_mode dvar
Added cc_permission_default dvar
Added cc_permission_max dvar
Added cc_permission_0, cc_permission_1, cc_permission_2, cc_permission_3 & cc_permission_4 dvars
Added InsufficientPermissionError error
Added InvalidPermissionLevelError error
Added GetPlayerPermissionLevelFromDvar util function
Added GetPlayerPermissionLevel util function
Added SetPlayerPermissionLevel util function
Added PlayerHasSufficientPermissions util function
Added SetDvarIfNotInitialized util function
Added IsBot util function
Added DebugIsOn util function
Added PermissionIsEnabled util function
[Refactor]
Replaced player.chat_commands with player.pers["chat_commands"]
This is to make sure the variables are kept between rounds
Replaced level scoped variables with a single level scoped array variable <level.chat_commands> holding all properties (prefix, ports etc.)
This is a refactor/dev that changes how the commands work but the usage stays the same for the end user. The only difference is that you now have to install each command as a separate file
[Refactor]
Moved all the commands to their respective file, just like a plugin system to easily allow the user to add/remove commands
If the server has no commands it will display a message when trying to run any command with the prefix
[Dev]
Added args comment for the CreateCommand function (commandValue and commandHelp)
Added wallhack command to grant or remove access to a wallhack (red boxes) to a player (toggle)
[DEV]
This showcases how to implement a status/toggle command with a non permanent logic (implementing OnPlayerSpawned())
Added invisible command to grant or remove the invisible state to a player (toggle)
Note that this does not make you invisible to bots in the sense that even if they can't see you they will still know your position and shoot you on sight
All commands that require a player name to be passed now work both with a player name or with "me" to target yourself
[Dev]
All commands that use FindPlayerByName will now work with "me" passed as the player out of the box since FindPlayerByName now returns self if the name param is "me"
[Refactor]
Fix undefined errors when calling a status command for the first time on a player
Added norecoil command to grant or remove access to no recoil to a player (toggle)
[DEV]
Introduced the status system to make implementing toggle commands easier.
It allows the dev to get and set a status on a player per command and display messages both for the person running the command and for the player affected when the player status changes (for example no recoil ON/OFF).
Note that the status is always OFF by default since we always grant something to a player
Added teleport command to teleport a player or yourself to another player or yourself
!teleport me Eldor
!teleport Eldor me
!teleport Eldor Rektinator
[Refactor]
Replaced array[array.size] = value with AddElementToArray(array, value)
Made it possible to have a default randomized map and mode from a user defined list when the human players count is between two values defined by the user
Added dvar mapvote_default_rotation_maps
Added dvar mapvote_default_rotation_modes
Added dvar mapvote_default_rotation_min_players
Added dvar mapvote_default_rotation_max_players
Added the possibility to have no maps at all in the mapvote_maps dvar.
This is useful for when you want to organise your maps dvar and you don't want any MW3 map for example