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
… you know you can enable/disable depending on player coordinates or some travel scene, right? It’s not global, it’s per player.
it’s complicated
downloading the map release is better “FOR NOW”
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?!
Agreed, and also performance is worse when using the streamable assets instead of just loading the island using native functions.
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
nasty.
#(vec3 - vec3)
> *
and unloading the map regardless of whether it is loaded or not
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.
Read this again carefully
Good to know
Hello there I have a problem is it normal that its crash all the time
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?
local distance1 = #(pCoords - islandVec)
Very nasty. Onesync Infinity!
NPC aren’t working anymore - OneSync Infinity
Oops you’re right
Work fine here. Anything specific you’re doing?