Notifications
Clear all

Ground_z ??


Posts: 0
 Wamm
Topic starter
(@Wamm)
New Member
Joined: 9 years ago

Hello all, sorry my english is not good, i'm french.

I use 2much4u base sprx and i have some probleme with "teleporte to waypoint".

void TeleportToWaypoint()
{

uint handle = PLAYER::PLAYER_PED_ID();
if (PED::IS_PED_IN_ANY_VEHICLE(handle, 0))
handle = PED::GET_VEHICLE_PED_IS_IN(handle, 0);
if (UI::IS_WAYPOINT_ACTIVE())
{
Vector3 pos;
float z;
CAM::DO_SCREEN_FADE_OUT(200);
pos = UI::GET_BLIP_INFO_ID_COORD(UI::GET_FIRST_BLIP_INFO_ID(UI::_GET_BLIP_INFO_ID_ITERATOR()));
GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(pos.x,pos.y,pos.z,&z);
SYSTEM::WAIT(3000);
ENTITY::SET_ENTITY_COORDS(handle,pos.x,pos.y,z,1,0,0,1);
CAM::DO_SCREEN_FADE_IN(200);
}

else
{
drawNotification("Mets 1 point !!!!");
}
}

But ground_z in never good, someone for help ?
Thanks.

Reply
Name of the Video Game, and any other Tags
1 Reply
KranK
Posts: 336
(@KranK)
Reputable Member
Joined: 9 years ago

My code in c# works perfect . for c# I still not ported it to sprx but you welcome have a look

https://rivalgamer.com/threads/updated-rpc-teleport-to-waypoint-with-correct-ground-z-elevation.4621/

Reply