peq-quests/lua_modules/command.lua

31 lines
859 B
Lua
Raw 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 = "lua_modules/commands/";
local commands = { };
2015-03-14 16:18:39 -04:00
2022-07-04 19:50:50 -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") };
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
e.self:Message(13, "Access level not high enough.");
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