Skip to content

Commit 2f2a9b5

Browse files
committed
Update v1.7
* Fixed serious error
1 parent 475a0d1 commit 2f2a9b5

File tree

4 files changed

+29
-31
lines changed

4 files changed

+29
-31
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6
1+
1.7

client.lua

+14-24
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,23 @@ MSK.TriggerCallback = function(name, ...)
9696
return table.unpack(response)
9797
end
9898

99+
local Timeout = 0
99100
MSK.AddTimeout = function(ms, cb)
100-
table.insert(Timeouts, {time = GetGameTimer() + ms, cb = cb})
101-
return #Timeouts
101+
local requestId = Timeout + 1
102+
103+
SetTimeout(ms, function()
104+
logging('debug', 'Timeouts[requestId]', Timeouts[requestId])
105+
if Timeouts[requestId] then Timeouts[requestId] = nil return end
106+
cb()
107+
end)
108+
109+
Timeout = requestId
110+
return requestId
102111
end
103112

104-
MSK.DelTimeout = function(i)
105-
Timeouts[i] = nil
113+
MSK.DelTimeout = function(requestId)
114+
if not requestId then return end
115+
Timeouts[requestId] = true
106116
end
107117

108118
MSK.HasItem = function(item)
@@ -190,26 +200,6 @@ AddEventHandler('msk_core:advancedNotification', function(text, title, subtitle,
190200
MSK.AdvancedNotification(text, title, subtitle, icon, flash, icontype)
191201
end)
192202

193-
CreateThread(function()
194-
while true do
195-
local sleep = 200
196-
197-
if #Timeouts > 0 then
198-
local currTime = GetGameTimer()
199-
sleep = 0
200-
201-
for i = 1, #Timeouts, 1 do
202-
if currTime >= Timeouts[i].time then
203-
Timeouts[i].cb()
204-
Timeouts[i] = nil
205-
end
206-
end
207-
end
208-
209-
Wait(sleep)
210-
end
211-
end)
212-
213203
exports('getCoreObject', function()
214204
return MSK
215205
end)

config.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ Config.VersionChecker = true
44
----------------------------------------------------------------
55
-- Only Required for MSK.RegisterCommand // View Wiki for more Information about that!
66
Config.Framework = 'esx' -- Set to 'standalone', 'esx' or 'qbcore'
7-
----------------------------------------------------------------
7+
----------------------------------------------------------------
8+
Config.showCoords = {
9+
enable = true,
10+
command = 'coords',
11+
groups = {'superadmin', 'admin'}
12+
}

fxmanifest.lua

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_core'
66
description 'Core functions for MSK Scripts'
7-
version '1.6'
7+
version '1.7'
88

99
lua54 'yes'
1010

11-
shared_script {
12-
'config.lua'
11+
shared_scripts {
12+
'config.lua',
13+
'config_*.lua'
1314
}
1415

1516
client_scripts {
16-
'client.lua'
17+
'client.lua',
18+
'client_*.lua'
1719
}
1820

1921
server_scripts {
2022
'@oxmysql/lib/MySQL.lua',
21-
'server.lua'
23+
'server.lua',
24+
'server_*.lua'
2225
}
2326

2427
files {

0 commit comments

Comments
 (0)