peq-quests/lua_modules/command.lua

33 lines
985 B
Lua
Raw Permalink Normal View History

--copy or symbolic link this file to /server/lua_modules/, it will not work in /server/quests/lua_modules/
local commands_path = "commands/";
local commands = { };
2015-03-14 16:18:39 -04:00
commands["don"] = { 80, require(commands_path .. "don") };
commands["endurance"] = { 50, require(commands_path .. "endurance") };
commands["lockouts"] = { 0, require(commands_path .. "lockouts") };
commands["timeleft"] = { 0, require(commands_path .. "time_left") };
commands["hotzone"] = { 0, require(commands_path .. "hotzone") };
commands["hotzones"] = { 0, require(commands_path .. "hotzone") };
2015-03-14 16:18:39 -04:00
function eq.DispatchCommands(e)
local command = commands[e.command];
for k,v in pairs(e.args) do
2023-07-23 01:44:22 -05:00
eq.debug("[command.lua] key " .. k .. ' value ' .. v, 3);
end
2015-03-14 16:18:39 -04:00
if(command) then
local access = command[1];
if(access > e.self:Admin()) then
2023-08-13 17:16:42 -04:00
e.self:Message(MT.Red, "Access level not high enough.");
2015-03-14 16:18:39 -04:00
return 1;
end
2019-08-15 22:20:00 -05:00
2015-03-14 16:18:39 -04:00
local func = command[2];
func(e);
return 1;
2019-08-15 22:20:00 -05:00
end
2015-03-14 16:18:39 -04:00
return 0;
end