Skip to content

Instantly share code, notes, and snippets.

@gideongrinberg
Created September 25, 2021 14:44
Show Gist options
  • Save gideongrinberg/3d3fda5d71643819190b97f0ebcb1679 to your computer and use it in GitHub Desktop.
Save gideongrinberg/3d3fda5d71643819190b97f0ebcb1679 to your computer and use it in GitHub Desktop.
Enable the Cayo Perico map on FiveM
fx_version 'cerulean'
games { 'gta5' }
client_script "script.lua"
local islandVec = vector3(4840.571, -5174.425, 2.0)
Citizen.CreateThread(function()
while true do
local pCoords = GetEntityCoords(GetPlayerPed(-1))
local distance1 = #(pCoords - islandVec)
if distance1 < 2000.0 then
Citizen.InvokeNative("0x9A9D1BA639675CF1", "HeistIsland", true) -- load the map and removes the city
Citizen.InvokeNative("0x5E1460624D194A38", true) -- load the minimap/pause map and removes the city minimap/pause map
else
Citizen.InvokeNative("0x9A9D1BA639675CF1", "HeistIsland", false)
Citizen.InvokeNative("0x5E1460624D194A38", false)
end
Citizen.Wait(5000)
end
end)
@rayzenoam
Copy link

The resource works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment