This is the DataCrack mini-game from GTA5 that you can use in your own scripts.
Usage
To start the mini-game:
exports["datacrack"]:Start(difficulty)
To catch the outcome:
AddEventHandler("datacrack", function(output)
-- your code here, for example:
if output then
ESX.ShowHelpNotification('Hack complete!', false, true, 5000)
else
ESX.ShowHelpNotification('Hack failed!', false, true, 5000)
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
local plyPos = GetEntityCoords(GetPlayerPed(-1))
local place = vector3(-936.3391, -375.8193, 108.0377)
if isNear(plyPos, place, 2.0) then
if IsControlJustPressed(0, 38) then
exports["datacrack"]:Start(4)
end
end
end
end)
AddEventHandler("datacrack", function()
exports['mythic_notify']:DoHudText('inform', "You did it, good job")
end)