vizzminzi Posted November 22, 2015 Share Posted November 22, 2015 (edited) [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 November 22, 2015 by vizzminzi Link to comment Share on other sites More sharing options...
jedijosh920 Posted November 23, 2015 Share Posted November 23, 2015 Game.Player.Character.Position = World.GetWaypointPosition(); Done. Link to comment Share on other sites More sharing options...
vizzminzi Posted November 23, 2015 Author Share Posted November 23, 2015 Game.Player.Character.Position = World.GetWaypointPosition(); Done. can you elaborate please? Link to comment Share on other sites More sharing options...
Mr.Arrow Posted November 23, 2015 Share Posted November 23, 2015 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 More sharing options...
Colata Posted November 23, 2015 Share Posted November 23, 2015 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 More sharing options...
ShadowCoderKing Posted August 9, 2017 Share Posted August 9, 2017 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 More sharing options...
THEAETIK Posted August 10, 2017 Share Posted August 10, 2017 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. ShadowCoderKing 1 Link to comment Share on other sites More sharing options...
elsewhat Posted August 10, 2017 Share Posted August 10, 2017 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); }} ShadowCoderKing 1 Link to comment Share on other sites More sharing options...
ShadowCoderKing Posted August 11, 2017 Share Posted August 11, 2017 thanks guys Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now