-
Notifications
You must be signed in to change notification settings - Fork 51
/
client.lua
75 lines (64 loc) · 2.59 KB
/
client.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
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
--==================================================================================
--====== ESX_IDENTITY BY ARKSEYONET @Ark ======
--====== YOU CAN FIND ME ON MY DISCORD @Ark - https://discord.gg/cGHHxPX ======
--====== IF YOU ALTER THIS VERSION OF THE SCRIPT, PLEASE GIVE ME CREDIT ======
--====== Special Thanks To Alphakush and CMD.Telhada For Help Testing ======
--==================================================================================
--===============================================
--== VARIABLES ==
--===============================================
local guiEnabled = false
local myIdentity = {}
--===============================================
--== VARIABLES ==
--===============================================
function EnableGui(enable)
SetNuiFocus(enable)
guiEnabled = enable
SendNUIMessage({
type = "enableui",
enable = enable
})
end
--===============================================
--== Show Registration ==
--===============================================
RegisterNetEvent("esx_identity:showRegisterIdentity")
AddEventHandler("esx_identity:showRegisterIdentity", function()
EnableGui(true)
end)
--===============================================
--== Close GUI ==
--===============================================
RegisterNUICallback('escape', function(data, cb)
EnableGui(false)
end)
--===============================================
--== Register Callback ==
--===============================================
RegisterNUICallback('register', function(data, cb)
myIdentity = data
TriggerServerEvent('esx_identity:setIdentity', data)
EnableGui(false)
Wait (500)
TriggerEvent('esx_skin:openSaveableMenu')
end)
--===============================================
--== THREADING ==
--===============================================
Citizen.CreateThread(function()
while true do
if guiEnabled then
DisableControlAction(0, 1, guiEnabled) -- LookLeftRight
DisableControlAction(0, 2, guiEnabled) -- LookUpDown
DisableControlAction(0, 142, guiEnabled) -- MeleeAttackAlternate
DisableControlAction(0, 106, guiEnabled) -- VehicleMouseControlOverride
if IsDisabledControlJustReleased(0, 142) then -- MeleeAttackAlternate
SendNUIMessage({
type = "click"
})
end
end
Citizen.Wait(0)
end
end)