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:
Make sure you’re on server build 3324 or higher. To check this, run version in your server console.
Add set sv_enforceGameBuild 2189 to your server.cfg or +set sv_enforceGameBuild 2189 to your launch parameters.
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)
Go to the right place on the map, and you should see the island instead of the default gta5 level.
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
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?!
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)
Feel free to share your correct code I made that during this night when this thread wasn’t even posted i’m also missing the audio and peds stuff that i wasn’t aware of
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.
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.
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?