All pastes #420290 Raw Edit

command.lua

public lua v1 · immutable
·published 2007-04-02 01:14 UTC
rendered paste body
command = {}command.Commands = {}command.ALL = 1command.MSG = 2command.PM = 3function command.Call(com, typ, ...)	if table.haskey(command.Commands, com) then		if not admin.HasAccess(arg[1], command.Commands[com].access) then sendMessage(arg[1], "You do not have access to this command!"); return end		if typ == command.Commands[com].type or command.Commands[com].type == command.ALL then			command.Commands[com].func(unpack(arg))		end	endendfunction command.Add(com, func, typ, access)	typ = typ or command.MSG	access = access or 0	command.Commands[com] = {func = func, type = typ, access = access}endfunction command.Remove(com)	table.remove(command.Commands, com)endfunction command.SetSign(sign)	command.Sign = signendfunction command.GetSign()	return command.Signendfunction command.SplitCommand(str)	local sp = explode(" ", str)	local com = string.sub(sp[1], string.len(command.Sign) + 1)	table.remove(sp, 1)	return {com = com, arg = table.concat(sp, " ")}endfunction command.IsCommand(str)	return string.sub(str, 0, string.len(command.Sign)) == command.Signend