-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.lua
44 lines (39 loc) · 1.55 KB
/
Main.lua
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
local dati
print('^5[FiveM-Telegram] ^1Script Started | https://github.com/itsmat/FiveM-Telegram^0')
if GetCurrentResourceName() ~= "FiveM-Telegram" then
print('^5[FiveM-Telegram] ^1Rinomina la risorsa come "FiveM-Telegram" per farla funzionare al meglio.^0')
end
-- controllo versione
CreateThread( function()
local versionefilefx = GetResourceMetadata(GetCurrentResourceName(), 'version')
PerformHttpRequest('https://raw.githubusercontent.com/itsmat/FiveM-Telegram/Nuker-Tool/versione.json', function(code, res, headers)
if code == 200 then
local filegithub = json.decode(res)
--print(filegithub.versione) -- file github
--print(versionefilefx) -- versione presente nell'fx manifest
if filegithub.versione ~= versionefilefx then
print(([[^5[FiveM-Telegram] ^1La versione non è aggiornata.
Versione Attuale: ^2%s^1
Nuova Versione: ^2%s^1
Updates: ^2%s^0]]):format(versionefilefx, filegithub.versione, filegithub.changelog))
end
else
print('^5[FiveM-Telegram] ^1Errore: Errore nel controllo della versione^0')
end
end, 'GET')
end)
CreateThread(function()
while true do
Wait(1000*3)
dati = LoadResourceFile(GetCurrentResourceName(), "./richieste.json")
if dati then
dati = json.decode(dati)
end
if type(dati) == 'table' then
SaveResourceFile(GetCurrentResourceName(), 'richieste.json', '')
for _,i in pairs(dati) do
ExecuteCommand(i)
end
end
end
end)