Added ExpGamingCommands.tags

This commit is contained in:
Cooldude2606
2018-06-24 20:06:28 +01:00
parent be78abfefe
commit 56762fcf19
2 changed files with 52 additions and 0 deletions

View File

@@ -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)

View File

@@ -0,0 +1,21 @@
{
"name": "tags",
"version": "4.0.0",
"type": "Module",
"description": "Allows tags to be used by users.",
"location": "<blank>",
"keywords": [
"Tags",
"Custom Tags",
"Commands",
"ExpGaming"
],
"author": "<blank>",
"contact": "<blank>",
"license": "<blank>",
"dependencies": {
"ExpGamingCore.Ranking": "^4.0.0",
"ExpGamingCore.Commands": "^4.0.0",
"FactorioStdLib.Game": "^0.8.0"
}
}