Added ExpGamingCommands.cheatMode

This commit is contained in:
Cooldude2606
2018-06-24 21:18:41 +01:00
parent 3eed4b1d8d
commit 4becf6a414
3 changed files with 35 additions and 15 deletions

View File

@@ -0,0 +1,14 @@
--- A full ranking system for factorio.
-- @module ExpGamingCommands.kill
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
--- Toogles cheat mode for a player
-- @command cheat-mode
-- @param[opt] player the player to toggle if nil then the player using the command
commands.add_command('cheat-mode', 'Toggles cheat mode for a player', {
['player']={false,'player'}
}, function(event,args)
local player = args.player or game.player
if player.cheat_mode == true then player.cheat_mode = false else player.cheat_mode = true end
end)

View File

@@ -0,0 +1,21 @@
{
"name": "cheatMode",
"version": "4.0.0",
"type": "Module",
"description": "Adds a command which allow you to toggle cheatmode",
"location": "<blank>",
"keywords": [
"Cheat",
"Commands",
"Admin",
"ExpGaming",
"Cheat Mode",
"Hacks"
],
"author": "<blank>",
"contact": "<blank>",
"license": "<blank>",
"dependencies": {
"ExpGamingCore.Commands": "^4.0.0"
}
}

View File

@@ -1,15 +0,0 @@
--[[
Explosive Gaming
This file can be used with permission but this and the credit below must remain in the file.
Contact a member of management on our discord to seek permission to use our code.
Any changes that you may make to the code are yours but that does not make the script yours.
Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
commands.add_command('cheat-mode', 'Toggles cheat mode for a player', {'player'}, function(event,args)
local player = Game.get_player(args.player)
if not player then player_return({'commands.invalid-player',args.player}) return commands.error end
if player.cheat_mode == true then player.cheat_mode = false else player.cheat_mode = true end
end)