Log in to reply
 

[C++] GetEntityCoords Vector3 to GetDistanceBetweenCoords float How?



  • Hi. How can i convert the get_entity_coords return vector3 to get_distance_between_coords float?

    The Code:

    void func_7() {

    Vector3 X,Y,Z = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), false);
    if (GAMEPLAY::GET_DISTANCE_BETWEEN_COORDS(X,Y,Z, 96, -1291, 29, true) < 15) {

    }
    

    }



  • @Tarack I don't programme in C++ but I am pretty sure you should be doing

    Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), false);

    and then using coords.X, coords.Y and coords.Z in the GetDistance calc.



  • @LeeC2202 Thank you! It's working!


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.