if (!RADAR::IS_WAYPOINT_ACTIVE())
{
SetStatusText(message2);
return;
}
Vector3 coords = RADAR::GET_WAYPOINT_COORDS_3D();
Entity e = PLAYER::PLAYER_PED_ID();
if (PED::IS_PED_ON_MOUNT(e))
e = PED::GET_MOUNT(e);
else
if (PED::IS_PED_IN_ANY_VEHICLE(e, FALSE))
e = PED::GET_VEHICLE_PED_IS_USING(e);
if (!GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coords.x, coords.y, 100.0, &coords.z, FALSE))
{
static const 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 each (float height in groundCheckHeight)
{
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, height, 0, 0, 1);
WaitAndDraw(100);
if (GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coords.x, coords.y, height, &coords.z, FALSE))
{
coords.z += 3.0;
break;
}
}
}
ENTITY::SET_ENTITY_COORDS(e, coords.x, coords.y, coords.z, 0, 0, 1, FALSE);