Teleport To WayPoin...
 
Notifications
Clear all

Teleport To WayPoint , Correct way , Cross Platform

Page 2 / 2

Posts: 0
(@lambo)
New Member
Joined: 9 years ago

Hello RG members as the title say but to addition to it this code works low and high ground low-to-high-to low.

//Teleport to Way point loop
	
	    if (TeleportWPLoop)
	    {
	        Blip WaypointID = UI::GET_FIRST_BLIP_INFO_ID(8);
	        Vector3 WaypointCoords = UI::GET_BLIP_COORDS(WaypointID);
	        Vector3 coordos;
	        int Entity;
	        if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), false))
	        {
	            Entity = PED::GET_VEHICLE_PED_IS_USING(PLAYER::PLAYER_PED_ID());
	        }
	        else
	        {
	            Entity = PLAYER::PLAYER_PED_ID();
	        }
	        float ZAxis;
	
	
	        if (WaypointCoords.x != 0 && WaypointCoords.y != 0)
	        {
	            ENTITY::SET_ENTITY_COORDS(Entity, WaypointCoords.x, WaypointCoords.y, WaypointCoords.z, true, true, true, true);
	            ContinueWP = true;
	        }
	        if (ContinueWP)
	        {
	            coordos = ENTITY::GET_ENTITY_COORDS(Entity, true);
	            ENTITY::SET_ENTITY_COORDS(Entity, coordos.x, coordos.y, coordos.z + 10.0f, true, true, true, true);
	        }
	
	        if (GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coordos.x, coordos.y, coordos.z, &ZAxis))
	        {
	            ENTITY::SET_ENTITY_COORDS(Entity, coordos.x, coordos.y, ZAxis + 1.0f, true, true, true, true);
	            ZAxis = 0;
	            TeleportWPLoop = false;
	            ContinueWP = false;
	        }
	
	
	    }

KranK a little addition well you might have a better way
if the waypoint is over the ocean you get stuck in the sky untill you set another waypoint over land, this stops the loop and gives you a parachute

	if (coordos.z >= 799.0000f)
	       {
	       WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), 0xFBAB5776, 1, 1);
	       TeleportWPLoop = false;
	       ContinueWP = false;
	       PRINT("Set Waypoint on Ground", 4000);
	       }
	
Reply
KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

KranK a little addition well you might have a better way
if the waypoint is over the ocean you get stuck in the sky untill you set another waypoint over land, this stops the loop and gives you a parachute

	if (coordos.z >= 799.0000f)
	       {
	       WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), 0xFBAB5776, 1, 1);
	       TeleportWPLoop = false;
	       ContinueWP = false;
	       PRINT("Set Waypoint on Ground", 4000);
	       }
	

there is also bug with helicopters btw ,, it wont fix ground position if you are in the helicopter

Reply
Posts: 0
(@lambo)
New Member
Joined: 9 years ago

there is also bug with helicopters btw ,, it wont fix ground position if you are in the helicopter

sometimes it just wont find ground z i think sometimes the map doesnt load quick enough for ContinueWP, and i think you have to be close to ground for GET_GROUND_Z_FOR_3D_COORD, but its still the best Teleport to waypoint 🙂

for the heli IS_PED_IN_FLYING_VEHICLE will kill the loop but you will spawn underground

	if (PED::IS_PED_IN_FLYING_VEHICLE(PLAYER::PLAYER_PED_ID()))
	   {
	   ENTITY::SET_ENTITY_COORDS(Entity, WaypointCoords.x, WaypointCoords.y, WaypointCoords.z, true, true, true, true);
	   TeleportWPLoop = false;
	   ContinueWP = false;
	   PRINT("Ground_Z Not Found", 3000);
	   }
	
Reply
KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

sometimes it just wont find ground z i think sometimes the map doesnt load quick enough for ContinueWP, and i think you have to be close to ground for GET_GROUND_Z_FOR_3D_COORD, but its still the best Teleport to waypoint 🙂

for the heli IS_PED_IN_FLYING_VEHICLE will kill the loop but you will spawn underground

	if (PED::IS_PED_IN_FLYING_VEHICLE(PLAYER::PLAYER_PED_ID()))
	   {
	   ENTITY::SET_ENTITY_COORDS(Entity, WaypointCoords.x, WaypointCoords.y, WaypointCoords.z, true, true, true, true);
	   TeleportWPLoop = false;
	   ContinueWP = false;
	   PRINT("Ground_Z Not Found", 3000);
	   }
	

it always Find the Ground no meter what for me it looks like your ps3 being weird cause this code works flawless exept Helicopters and i dont care much cause i quit GTA modding

Reply
Posts: 0
(@lambo)
New Member
Joined: 9 years ago

it always Find the Ground no meter what for me it looks like your ps3 being weird cause this code works flawless exept Helicopters and i dont care much cause i quit GTA modding

You could be right there its a old fat model

Reply
Page 2 / 2