Teleport To WayPoin...
 
Notifications
Clear all

Teleport To WayPoint , Correct way , Cross Platform

Page 1 / 2

KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 10 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;
	        }
	
	
	    }
Reply
Name of the Video Game, and any other Tags
9 Replies
Cain532
Posts: 1280
(@cain532)
Noble Member
Joined: 10 years ago

You could even do that top part like

	        int Entity = PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID() ? PLAYER::PLAYER_PED_ID() : PED::GET_VEHICLE_PED_IS_USING(PLAYER::PLAYER_PED_ID());
	

That's kind of how I have it set in our RedDeadRekt project 🙂

Reply
KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 10 years ago

You could even do that top part like

	        int Entity = PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID() ? PLAYER::PLAYER_PED_ID() : PED::GET_VEHICLE_PED_IS_USING(PLAYER::PLAYER_PED_ID());
	

That's kind of how I have it set in our RedDeadRekt project 🙂

i prefer the way i did 🙂

Reply
anxify
Posts: 203
(@anxify)
Reputable 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 This is amazing!!!! 😀

Reply
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 you sir are a Genius
thank you

Reply
Page 1 / 2