Skip to content

Instantly share code, notes, and snippets.

@oldnapalm
Created July 1, 2021 17:20
Show Gist options
  • Select an option

  • Save oldnapalm/e284887eaf8812c285cd0e419b832482 to your computer and use it in GitHub Desktop.

Select an option

Save oldnapalm/e284887eaf8812c285cd0e419b832482 to your computer and use it in GitHub Desktop.
GTA 5 SHVDN script to load Cayo Perico island
using System;
using GTA;
using GTA.Math;
using GTA.Native;
namespace LoadCayoPerico
{
public class LoadCayoPerico : Script
{
private Blip island;
public LoadCayoPerico()
{
Function.Call((Hash)0x888C3502DBBEEF5); // load MP DLC maps
island = World.CreateBlip(new Vector3(5943.567f, -6272.114f, 2f)); // invisible blip to make the map clickable at the island
island.Sprite = BlipSprite.Invisible;
island.Scale = 0f;
island.IsShortRange = false;
Tick += OnTick;
}
private void OnTick(object sender, EventArgs e)
{
Function.Call((Hash)0xF8DEE0A5600CBB93, true); // SET_MINIMAP_REVEALED - shows the full map
if (Game.Player.Character.Position.DistanceTo2D(new Vector2(5031.428f, -5150.907f)) < 2000f)
{
Function.Call(Hash.SET_SCENARIO_GROUP_ENABLED, "Heist_Island_Peds", true);
Function.Call((Hash)0x9A9D1BA639675CF1, "HeistIsland", true); // set island hopper enabled
Function.Call((Hash)0xF74B1FFA4A15FBEA, 1); // enable path nodes so routing works on island
if (Function.Call<int>(Hash.GET_INTERIOR_FROM_ENTITY, Game.Player.Character) == 0)
{
Function.Call(Hash.SET_RADAR_AS_EXTERIOR_THIS_FRAME);
Function.Call(Hash.SET_RADAR_AS_INTERIOR_THIS_FRAME, 0xc0a90510, 4700.0f, -5145.0f, 0, 0);
}
}
else
{
Function.Call(Hash.SET_SCENARIO_GROUP_ENABLED, "Heist_Island_Peds", false);
Function.Call((Hash)0x9A9D1BA639675CF1, "HeistIsland", false);
Function.Call((Hash)0xF74B1FFA4A15FBEA, 0); // disable path nodes so routing works on main land
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment