diff --git a/modules/ExpGamingCommands/tags/control.lua b/modules/ExpGamingCommands/tags/control.lua new file mode 100644 index 00000000..358c8399 --- /dev/null +++ b/modules/ExpGamingCommands/tags/control.lua @@ -0,0 +1,31 @@ +--- A full ranking system for factorio. +-- @module ExpGamingCommands.kill +-- @author Cooldude2606 +-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE + +local Game = require('FactorioStdLib.Game') +local Ranking = require('ExpGamingCore.Ranking') + +--- Gives you a tag +-- @command tag +-- @param tag the tag you want to have +commands.add_command('tag', 'Give yourself a custom tag. Use "" to have more than one word.', { + ['tag'] = {true,'string-len',20} +}, function(event,args) + local player = Game.get_player(event) + local rank = Ranking.get_rank(player) + player.tag = rank.tag..' - '..args.tag + player.print('Your tag has been set. Use /tag-clear to remove your tag') +end) + +--- Gives you a tag +-- @command tag +-- @param tag the tag you want to have +commands.add_command('tag-clear', 'Removes a custom tag. Player can be self (/tag-clear self)', { + ['player'] = {true,'player-rank'} +}, function(event,args) + local player = args.player + local rank = Ranking.get_rank(player) + player.tag = rank.tag + player.print('Your tag has been removed.') +end) diff --git a/modules/ExpGamingCommands/tags/softmod.json b/modules/ExpGamingCommands/tags/softmod.json new file mode 100644 index 00000000..a421505a --- /dev/null +++ b/modules/ExpGamingCommands/tags/softmod.json @@ -0,0 +1,21 @@ +{ + "name": "tags", + "version": "4.0.0", + "type": "Module", + "description": "Allows tags to be used by users.", + "location": "", + "keywords": [ + "Tags", + "Custom Tags", + "Commands", + "ExpGaming" + ], + "author": "", + "contact": "", + "license": "", + "dependencies": { + "ExpGamingCore.Ranking": "^4.0.0", + "ExpGamingCore.Commands": "^4.0.0", + "FactorioStdLib.Game": "^0.8.0" + } +} \ No newline at end of file