command = {} command.Commands = {} command.ALL = 1 command.MSG = 2 command.PM = 3 function 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 end end function command.Add(com, func, typ, access) typ = typ or command.MSG access = access or 0 command.Commands[com] = {func = func, type = typ, access = access} end function command.Remove(com) table.remove(command.Commands, com) end function command.SetSign(sign) command.Sign = sign end function command.GetSign() return command.Sign end function 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, " ")} end function command.IsCommand(str) return string.sub(str, 0, string.len(command.Sign)) == command.Sign end