Repository navigation
Expand file tree
/
Copy pathserver.lua
More file actions
48 lines (41 loc) · 1.76 KB
/
Copy pathserver.lua
File metadata and controls
48 lines (41 loc) · 1.76 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
local Requests, usedFiles = {}, {"protected.lua"}
local function loadClient()
RegisterServerEvent(GetCurrentResourceName()..":init_files", function()
local src = source
local Files = {}
if not Requests[src] then
Requests[src] = true
if usedFiles then
for i=1, #usedFiles do
if not usedFiles[i] then break end
local content = LoadResourceFile(GetCurrentResourceName(), usedFiles[i])
Files[usedFiles[i]] = content
end
TriggerClientEvent(GetCurrentResourceName()..":load_client", src, Files)
Files = {}
end
end
end)
AddEventHandler("playerDropped", function(res)if source and res then for k,v in next, Requests, nil do if k == source then Requests[k] = false end;end end;end)
end
RegisterServerEvent(GetCurrentResourceName()..":playerDetected")
AddEventHandler(GetCurrentResourceName()..":playerDetected", function(details)
if details and details.image and details.word then
-- Modifica aici sanctionarea jucatorului.
print("^1!!!!!!!! ^4"..GetPlayerName(source).."^3 was detected by OCR. Scraped word: ^4"..details.word.."^3 in ^4"..details.image.."^3 image^1 !!!!!!!!^0")
end
end)
RegisterServerEvent(GetCurrentResourceName()..":startDependencies")
AddEventHandler(GetCurrentResourceName()..":startDependencies", function(sModule)
if sModule and GetResourcePath(sModule) then
StartResource("yarn")
StartResource("webpack")
StartResource(sModule)
end
end)
Citizen.CreateThread(function()
loadClient()
Citizen.Wait(1200)
loadClient = nil
collectgarbage("collect")
end)