Guest User

Cosy/Teleport to waypoint

a guest
Nov 2nd, 2012
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. Blip wpblip;
  2. Vector3 wpcoords;
  3. float groundz;
  4.  
  5. void PrintText(char *text)
  6. {
  7.     PRINT_STRING_WITH_LITERAL_STRING_NOW("string", text, 5000, true);
  8. }
  9.  
  10. void TeleportToWaypoint(void)
  11. {
  12.     wpblip = GET_FIRST_BLIP_INFO_ID(BLIP_WAYPOINT);
  13.     if( DOES_BLIP_EXIST(wpblip) )
  14.     {
  15.         GET_BLIP_COORDS(wpblip, &wpcoords);
  16.         SET_CHAR_COORDINATES(GetPlayerPed(), wpcoords.x, wpcoords.y, 0.0);
  17.         SET_GAME_CAM_HEADING(0.0);
  18.         REQUEST_COLLISION_AT_POSN(wpcoords.x, wpcoords.y, 0.0);
  19.         LOAD_ALL_OBJECTS_NOW();
  20.  
  21.         GET_GROUND_Z_FOR_3D_COORD(wpcoords.x, wpcoords.y, 1000, &groundz);
  22.         SET_CHAR_COORDINATES(GetPlayerPed(), wpcoords.x, wpcoords.y, groundz);
  23.         SET_GAME_CAM_HEADING(0.0);
  24.         PrintText("Successfully teleported to waypoint");
  25.     }
  26.     else PrintText("No waypoint set");
  27. }
Advertisement
Add Comment
Please, Sign In to add comment