Looking for help with a problem im having

NotEmoji

Well-Known Member
Messages
6
Reaction score
2
Points
203
Hello i have been working on a gta menu on the bigbase i have ran into a small problem with a native that i cant get or understand why its doing this

when making a function with the native
GET_PED_LAST_WEAPON_IMPACT_COORD
when calling it in for like teleport gun the cords always end up as 0, 0 ,0 i have looked around and cant seem to find a fix
but it happens with all impact cord options
this is the code im using for teleport gun
bool teleportGunBool = false;
void teleportGun(){
Ped Player = PLAYER::tonguewink:LAYER_PED_ID();
if (PED::IS_PED_SHOOTING(Player))
{
Vector3 Coords;
if (WEAPON::GET_PED_LAST_WEAPON_IMPACT_COORD(Player, &Coords))
ENTITY::SET_ENTITY_COORDS(Player, Coords.x, Coords.y, Coords.z, 0, 0, 0, 0);
}
}

this is what the vector3 looks like
struct Vector3
{
float x{};
float y{};
float z{};
}
and
struct Vector3
{
float x;
DWORD _paddingx;
float y;
DWORD _paddingy;
float z;
DWORD _paddingz;
} this one didnt work but i wasnt expecting it to
 

Rezhified

Veteran
Messages
69
Reaction score
43
Points
803
thank me l8r

Func
C++:
bool GET_PED_LAST_WEAPON_IMPACT_COORD(Ped ped, Vector3* coord) {
    opd_s native = { 0x468F40, 0x1C85330 };
    bool(*GET_PED_LAST_WEAPON_IMPACT_COORD)(Ped ped, Vector3* coords) = (bool(*)(Ped, Vector3*))&native;
    GET_PED_LAST_WEAPON_IMPACT_COORD(ped, coord);
}

Call like this
C++:
#define CurrentPed PLAYER::PLAYER_PED_ID()
Vector3 ImpactCoords;
if (PED::IS_PED_SHOOTING(CurrentPed)) {
    GET_PED_LAST_WEAPON_IMPACT_COORD(CurrentPed, &ImpactCoords);
    //add code to be executed where your bullet lands
}
 
Top