-
Notifications
You must be signed in to change notification settings - Fork 128
Tp to waypoint #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enhanced
Are you sure you want to change the base?
Tp to waypoint #291
Conversation
I'm kinda confused about this cause is this improved tp to waypoint or its just normal ?? Cause we already have one from the yimmenuv2 tho |
This comment was marked as spam.
This comment was marked as spam.
yea it will be nice to have this since the existing one sometimes tp under the ground and the car gets destroyed and some missions fail. |
Some places might have a ground Z value below 1. Are you sure this doesn't cause you to get teleported in the air? |
make tp to object would be usefull fr |
I'm working on a teleportation system for objects, collectibles, and objectives |
allright |
Whats with the foreign comments in the code |
|
Neither of those options, my native language is Spanish. I simply left line 17 commented out as a reminder. |
Ah ok, it's just that a lot of people working on this project probably don't understand Spanish and won't be able to read your comments
Also, have you tested this yet? |
Hello there, I finally managed to build the DLL including this PR and the latest actual repo. Sometimes it happens sometime not. Build here and video if you wanna check up what I means when sea level TP and higher than ground |
I dont know how you can achieve this but I believe in many FiveM servers or admins menus there was a TP to Waypoint that teleports you to the lowest Z coordinate then keep raising your ped to highers Zs until you can finally stand on it. This is what I have in mind, but this is in lua which I can more understand than c++ |
try this code, its one from old legacy menu - void ResolveZCoordinate(Vector3& vec)
{
constexpr float max_ground_check = 1000.f;
constexpr int max_attempts = 20;
float ground_z = vec.z;
int current_attempts = 0;
+ bool found_ground = false;
do
{
STREAMING::REQUEST_COLLISION_AT_COORD(vec.x, vec.y, vec.z);
- float water_height;
- if (WATER::GET_WATER_HEIGHT(vec.x, vec.y, vec.z, &water_height))
- {
- vec.z = water_height;
- return;
- }
-
if (MISC::GET_GROUND_Z_FOR_3D_COORD(vec.x, vec.y, max_ground_check, &ground_z, false, false))
{
vec.z = ground_z + 1.0f;
+ found_ground = true;
+ break;
}
if (current_attempts % 3 == 0)
{
ground_z += 25.f;
}
++current_attempts;
ScriptMgr::Yield();
} while (current_attempts < max_attempts);
+ float water_height;
+ if (WATER::GET_WATER_HEIGHT(vec.x, vec.y, vec.z, &water_height))
+ {
+ vec.z = water_height;
+ return;
+ }
+ if (!found_ground)
vec.z = PATHFIND::GET_APPROX_HEIGHT_FOR_POINT(vec.x, vec.y); // fallback value
} |
This seems to fix TPing into ground / under ground. Will needs to test more to see I encounter any issue with it. |
@@ -72,7 +75,7 @@ namespace YimMenu::Features | |||
{ | |||
auto coords = HUD::GET_BLIP_COORDS(HUD::GET_CLOSEST_BLIP_INFO_ID(HUD::GET_WAYPOINT_BLIP_ENUM_ID())); | |||
FiberPool::Push([coords] { | |||
auto new_coords{coords}; | |||
auto new_coords = coords; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you should change this back to new_coords{coords}, does not do anything much but it keeps the languge style for C++ 20
This code attempts to improve the tracking of the different heights of the game map, thus avoiding ending up underneath it