Enabling the island on build 2189

HELLO SERVER OWNERS,

Cayo Perico Heist DLC Now Available!

NEW CLIENT BUILD AND SERVER VERSIONS ALLOWING USE OF NEWER DLC HAVE BEEN RELEASED!

Here’s a guide to switching the island (which will disable LS if used) until native definitions are added to codegen:

  1. Make sure you’re on server build 3324 or higher. To check this, run version in your server console.
  2. Add set sv_enforceGameBuild 2189 to your server.cfg or +set sv_enforceGameBuild 2189 to your launch parameters.
  3. Run the following script, or similar, somehow:
-- set island hopper config
SetIslandEnabled('HeistIsland', true) -- or use false to disable it
-- instead of using island hopper you can *also* just load the IPLs mentioned in islandhopper.meta yourself somewhat
  
-- switch radar interior
SetUseIslandMap(true)

-- misc natives
SetAiGlobalPathNodesType(1)
LoadGlobalWaterType(1)
SetScenarioGroupEnabled('Heist_Island_Peds', true)

-- audio stuff
SetAudioFlag('PlayerOnDLCHeist4Island', true)
SetAmbientZoneListStatePersistent('AZL_DLC_Hei4_Island_Zones', true, true)
SetAmbientZoneListStatePersistent('AZL_DLC_Hei4_Island_Disabled_Zones', false, true)
  1. Go to the right place on the map, and you should see the island instead of the default gta5 level.
29 Likes

using this island will disable gta v map ?

2 Likes

Yes it will.

1 Like

this might be good for survival servers like mine but useless for rp servers because its a small island

1 Like

I would say its a perfect size also for Roleplay Servers, then people are more together and aren’t spreading over the hole map, creates more roleplay.

(Haven’t tested the full map yet) but it seems to have a low amount of houses, so that would make a problem for some servers…

3 Likes

yeah might be for 32-128 players servers no more
it will create a lot of roleplay scenes but with some developement and adding stuff and maps
it can be a really good thing

3 Likes

… you know you can enable/disable depending on player coordinates or some travel scene, right? It’s not global, it’s per player.

3 Likes

it’s complicated
downloading the map release is better “FOR NOW”

1 Like

Complicated? Literally checking for a distance. If island is closer than lossantos then load_island otherwise unload_island if it was loaded. Like 5-lines of code. You really think that forcing people to download 1.8GB of assets is somehow better than making a 5-lines script?!

16 Likes

Agreed, and also performance is worse when using the streamable assets instead of just loading the island using native functions.

4 Likes
Citizen.CreateThread(function()
    while true do
		local pCoords = GetEntityCoords(GetPlayerPed(-1))		
			local distance1 = GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, 4840.571, -5174.425, 2.0, false)
			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)

That’s it

8 Likes

nasty.

#(vec3 - vec3) > *

and unloading the map regardless of whether it is loaded or not :confused:

5 Likes

Feel free to share your correct code :smiley: I made that during this night when this thread wasn’t even posted :smiley: i’m also missing the audio and peds stuff that i wasn’t aware of :smiley:

5 Likes

The reason he said it’s “wrong” is because it uses GetDistanceBetweenCoords, which, as a native, is inherently slower than using math functions. In Lua you can do #(pos1 -pos2) to get the distance as well.

Corrected it would be:

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)

Personally I would go a step further and check if they were already inside or not so you don’t call the natives if they have already been enabled/disabled.

5 Likes

Thanks for the answer, btw it was only to test the new natives and the distance to use, i will add the checks you mentioned and also the peds/audio natives.

2 Likes

The island loaded fine for me but Los santos textures is very strange:

Read this again carefully

Good to know :open_mouth:

Hello there I have a problem is it normal that its crash all the timeScreenshot_21

3 Likes

A rather weird bug is happening when I’m setting the game build to 2189: GetVehiclePedIsIn always returns 0 on the server side. Onesync infinity is enabled and working (CreateVehicle works fine serverside), however for some reason GetVehiclePedIsIn doesn’t seem to work. I tried the same code without the +set sv_enforceGameBuild 2189 and it was retrieving the vehicle successfully, but just in case could someone else confirm if this is happening only to me?