mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Initial commit
Initial commit
This commit is contained in:
+76
@@ -0,0 +1,76 @@
|
||||
--==================================================================================
|
||||
--====== 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 COSHAREK FOR THE UI Design ======
|
||||
--====== 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:createIdentity', 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)
|
||||
Reference in New Issue
Block a user