Advertisement
TheManatee

SteamSilenceChannel - Find Ground On Waypoint

May 10th, 2017
302
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None
  1. /*
  2. Ported from AlexanderBlade's Native Trainer
  3. by SteamSilenceChannel for the "STCE's Quick Teleport Utiliy"
  4. */
  5.  
  6.  
  7. //First of all, You have to check "Allow unsafe code" in project Properties>Build
  8.  void findGroundOnWaypoint()
  9.     {
  10.         Ped playerPed = Game.Player.Character;
  11.         Vector3 pos = World.GetWaypointPosition();
  12.  
  13.         float[] groundHeight = {100.0f, 150.0f, 50.0f, 0.0f, 200.0f, 250.0f, 300.0f, 350.0f,
  14.             400.0f, 450.0f, 500.0f, 550.0f, 600.0f, 650.0f, 700.0f, 750.0f, 800.0f};
  15.  
  16.         foreach (float height in groundHeight)
  17.         {
  18.             unsafe
  19.             {
  20.                 float z = 0;
  21.                 playerPed.Position = new Vector3(pos.X, pos.Y, height);
  22.                 Wait(100);
  23.                 if (Function.Call<bool>(Hash.GET_GROUND_Z_FOR_3D_COORD, pos.X, pos.Y, height, &z))
  24.                 {
  25.                     playerPed.Position = new Vector3(pos.X, pos.Y, z + 3);
  26.                     break;
  27.                 }
  28.             }
  29.         }
  30.  
  31.     }
Advertisement
RAW Paste Data Copied
Advertisement