Created
September 25, 2021 14:44
-
-
Save gideongrinberg/3d3fda5d71643819190b97f0ebcb1679 to your computer and use it in GitHub Desktop.
Enable the Cayo Perico map on FiveM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fx_version 'cerulean' | |
games { 'gta5' } | |
client_script "script.lua" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The resource works perfectly.