Advertisement
KiLLerBoy_001

GTA 5: Correct Teleport to waypoint

Nov 20th, 2015
1,693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. TeleportToWaypoint()
  2. {
  3.    float Zheight;
  4.    if (UI::IS_WAYPOINT_ACTIVE())
  5.    {
  6.       if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID()))
  7.       {
  8.          int EntityID= PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(),0);
  9.       }
  10.       else
  11.       {
  12.           int EntityID= PLAYER::PLAYER_PED_ID();
  13.       }
  14.    CAM::DO_SCREEN_FADE_OUT(200);
  15.    Vector3 CoordBlip = UI::GET_BLIP_INFO_ID_COORD(UI::GET_FIRST_BLIP_INFO_ID(UI::_GET_BLIP_INFO_ID_ITERATOR()));
  16.    GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(CoordBlip.X,CoordBlip.Y,5000,&Zheight);
  17.    Vector3 TeleCoord = new Vector3 ( CoordBlip.X,CoordBlip.Y,Zheight )
  18.    ENTITY::SET_ENTITY_COORDS(EntityID,TeleCoord,1,0,0,1);
  19.    CAM::DO_SCREEN_FADE_IN(200);
  20.    }
  21.    else
  22.    {
  23.       // Message that no waypoint is set
  24.    }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement