-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport.lua
More file actions
86 lines (70 loc) · 2.34 KB
/
import.lua
File metadata and controls
86 lines (70 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
TS_LIB_RESOURCE_NAME = 'ts-lib'
LoadFile = function(path)
local file = LoadResourceFile(TS_LIB_RESOURCE_NAME, path)
if file then
assert(load(file, "@"..path))()
return true
end
return false
end
local files = {
'config.lua',
'shared/utils/load.lua',
'shared/utils/others.lua',
'shared/utils/print.lua',
'shared/utils/ressourceStates.lua',
'shared/utils/intervals.lua',
'shared/utils/table.lua',
'shared/main_init.lua',
'modules/command/server.lua',
}
for _, file in ipairs(files) do
LoadFile(file)
end
TS_LIB_CONFIG = TS_LIB_CONFIG or Config
if not IsDuplicityVersion() then
TS = TS or {}
TS.Lib = TS.Lib or {}
TS.Lib.Subtitle = TS.Lib.Subtitle or {}
TS.Lib.TextUI = TS.Lib.TextUI or {}
TS.Lib.Command = TS.Lib.Command or {}
TS.Lib.Subtitle.Show = function(text)
exports['ts-lib']:SendSubtitle(text)
end
TS.Lib.Subtitle.Hide = function()
exports['ts-lib']:HideSubtitle()
end
TS.Lib.TextUI.Show = function(text, position)
exports['ts-lib']:SendTextUI(text, position)
end
TS.Lib.TextUI.Hide = function()
exports['ts-lib']:HideTextUI()
end
TS.Lib.TextInput = function(data)
return exports['ts-lib']:TextInput(data)
end
end
if IsDuplicityVersion() then
TS = TS or {}
TS.Lib = TS.Lib or {}
TS.Lib.Command = TS.Lib.Command or {}
TS.Bridge = TS.Bridge or {}
TS.CheckUpdate = function(versionUrl, changelogUrl)
exports['ts-lib']:CheckUpdate(versionUrl, changelogUrl)
end
TS.Bridge.GetPlayers = function()
if Bridge and Bridge.Framework and Bridge.Framework.Server and Bridge.Framework.Server.Functions and Bridge.Framework.Server.Functions.GetPlayers then
local success, players = Bridge.Framework.Server.Functions.GetPlayers()
if success then
return players
end
end
return {}
end
TS.Bridge.HasPermission = function(source, permission)
if Bridge and Bridge.Framework and Bridge.Framework.Server and Bridge.Framework.Server.Functions and Bridge.Framework.Server.Functions.HasPermission then
return Bridge.Framework.Server.Functions.HasPermission(source, permission)
end
return IsPlayerAceAllowed(source, ('group.%s'):format(permission or 'admin'))
end
end