Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[C#] Teleport to waypoint in a GTA V


vizzminzi
 Share

Recommended Posts

[C++] Sorry not C#.. had a brain fart lol.

 

This code is from Native Trainer.

void teleport() {    Entity e = PLAYER::PLAYER_PED_ID();    if (PED::IS_PED_IN_ANY_VEHICLE(e, 0)){       e = PED::GET_VEHICLE_PED_IS_USING(e);    }    Vector3 coords;    bool blipFound = false;    // search for marker blip    int blipIterator = UI::_GET_BLIP_INFO_ID_ITERATOR();    for (Blip i = UI::GET_FIRST_BLIP_INFO_ID(blipIterator); UI::DOES_BLIP_EXIST(i) != 0; i = UI::GET_NEXT_BLIP_INFO_ID(blipIterator))    {        if (UI::GET_BLIP_INFO_ID_TYPE(i) == 4)        {            coords = UI::GET_BLIP_INFO_ID_COORD(i);            blipFound = true;            break;        }    }    if (blipFound)    {        // load needed map region and check height levels for ground existence        bool groundFound = false;        static float groundCheckHeight[] = {            100.0, 150.0, 50.0, 0.0, 200.0, 250.0, 300.0, 350.0, 400.0,            450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0        };        for (int i = 0; i < sizeof(groundCheckHeight) / sizeof(float); i++)        {            ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, groundCheckHeight[i], 0, 0, 1);            WAIT(100);            if (GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coords.x, coords.y, groundCheckHeight[i], &coords.z))            {                groundFound = true;                coords.z += 3.0;                break;            }        }        // if ground not found then set Z in air and give player a parachute        if (!groundFound)        {            coords.z = 1000.0;            WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), 0xFBAB5776, 1, 0);        }            }   }  

Errors i am getting :

Error (active) no suitable constructor exists to convert from "int" to "Blip"
Error (active) no suitable constructor exists to convert from "int" to "Blip"
Error (active) no suitable conversion function from "Blip" to "Any" exists

 

 

Here is my natives :

static Any _GET_BLIP_INFO_ID_ITERATOR() { return NativeInvoke::Invoke<Any>(0xE1ABDD92C442B1EE); } // 186E5D252FA50E7D B9827942    static Any GET_NUMBER_OF_ACTIVE_BLIPS() { return NativeInvoke::Invoke<Any>(0x6CB12F4217A1FBB0); } // 9A3FF3DE163034E8 144020FA        static Blip GET_NEXT_BLIP_INFO_ID(Blip blip) { return NativeInvoke::Invoke<Blip, Blip>(0xF463A6696AC4A56A, blip); } // 14F96AA50D6FBEA7 9356E92F    static Blip GET_FIRST_BLIP_INFO_ID(Blip blip) { return NativeInvoke::Invoke<Blip, Blip>(0xDBD23357E970F51D, blip); } // 1BEDE233E6CD2A1F 64C0273D        static Vector3 GET_BLIP_INFO_ID_COORD(Any p0) { return NativeInvoke::Invoke<Vector3, Any>(0x879645A55120C7E1, p0); } // FA7C7F0AADF25D09 B7374A66    static Any GET_BLIP_INFO_ID_DISPLAY(Blip blip) { return NativeInvoke::Invoke<Any, Blip>(0x80CEFC0107878BAF, blip); } // 1E314167F701DC3B D0FC19F4    static Any GET_BLIP_INFO_ID_TYPE(Blip blip) { return NativeInvoke::Invoke<Any, Blip>(0x2D9487AE5C210B17, blip); } // BE9B0959FFD0779B 501D7B4E    static Any GET_BLIP_INFO_ID_ENTITY_INDEX(Any p0) { return NativeInvoke::Invoke<Any, Any>(0x3E7783C7C149750F, p0); } // 4BA4E2553AFEDC2C A068C40B    static Any GET_BLIP_INFO_ID_PICKUP_INDEX(Any p0) { return NativeInvoke::Invoke<Any, Any>(0x12FB5A90E6E3D0AF, p0); } // 9B6786E4C03DD382 86913D37    static Blip GET_BLIP_FROM_ENTITY(Entity p0) { return NativeInvoke::Invoke<Blip, Entity>(0x4770B4BC52820FF1, p0); } // BC8DBDCA2436F7E8 005A2A47

What can i do to bypass this error...

i tried to casting but that didnt work either...

 

Please Help! Thanks!

 

Edited by vizzminzi
Link to comment
Share on other sites

 

 

Game.Player.Character.Position = World.GetWaypointPosition();
Done.

 

can you elaborate please?

Lol

 

The code give you the game coordinates based on the position ...

Link to comment
Share on other sites

 

Game.Player.Character.Position = World.GetWaypointPosition();

Done.

 

 

can you elaborate please?

 

 

simply

 

your new player position (game.player.position)

 

will equal the waypoint that is fetched. (world.getwaypointposition)

 

i beilive you just need to convert Jedi's c# code to C++

Link to comment
Share on other sites

  • 1 year later...
ShadowCoderKing
Game.Player.Character.Position = World.GetWaypointPosition();

Done.

 

how do i get the player to stop teleporting under the map, i use this code it works but it spawns you under the map and you have to wait to fall back to the world

Link to comment
Share on other sites

how do i get the player to stop teleporting under the map, i use this code it works but it spawns you under the map and you have to wait to fall back to the world

 

 

 

Raycast to ground above the player waypoint.

  • Like 1
Link to comment
Share on other sites

 

how do i get the player to stop teleporting under the map, i use this code it works but it spawns you under the map and you have to wait to fall back to the world

 

 

 

The approach in the SimpleTrainer is to use GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD

if (trustZValue == false) {	// load needed map region and check height levels for ground existence	bool groundFound = false;	static float groundCheckHeight[] = {		100.0, 150.0, 50.0, 0.0, 200.0, 250.0, 300.0, 350.0, 400.0,		450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0	};	for (int i = 0; i < sizeof(groundCheckHeight) / sizeof(float); i++)	{		ENTITY::SET_ENTITY_COORDS_NO_OFFSET(entityToTeleport, location.x, location.y, groundCheckHeight[i], 0, 0, 1);		WAIT(100);		if (GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(location.x, location.y, groundCheckHeight[i], &location.z, 0))		{			groundFound = true;			location.z += 3.0;			break;		}	}	// if ground not found then set Z in air and give player a parachute	if (!groundFound)	{		location.z = 1000.0;		WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), 0xFBAB5776, 1, 0);	}}
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.