altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 17 forks source link

Native getPedLastDamageBone Not working #1518

Open dexslab opened 2 years ago

dexslab commented 2 years ago

Description of the problem

So running every tick to check for any damage done to a ped it always returns false and no bone.

Reproduction steps

import * as alt from 'alt-client';
import * as native from 'natives';

trackBoneHits() {
        let result = native.getPedLastDamageBone(alt.Player.local);
        if (result[0]) {
            alt.log("got a hit");
            hits.push(result[0]);
        }
    }

alt.everyTick(trackBoneHits);

Injure yourself by falling or getting thrown from vehicle. Even better get shot if you have a friend able to shoot you.

Expected behaviour

Should get whenever a player takes any damage

Additional context

Maybe instead of it being client sided we can get it added to the playerDamage event as seen in issue #1194

Operating system

Windows 10

Version

release/10.10

WhishN commented 2 years ago

I've gotten it to work with a small empty script just checking for it. But very inconsistent See This message for reference. It looks like falling doesnt trigger this at all

deluvas1911 commented 2 years ago

Confirmed, but also able to reproduce it with ScriptHook, so it could be issued by the RAGE engine

dexslab commented 2 years ago

Confirmed, but also able to reproduce it with ScriptHook, so it could be issued by the RAGE engine

Well that is not good i wonder if there is a solution that you guys can do with player damaged and bone hit

FabianTerhorst commented 2 years ago

I found the value and can expose it serverside and clientside as a altv player getter and setter. But i can't guarantee that it will work better then the native.

dexslab commented 2 years ago

I found the value and can expose it serverside and clientside as a altv player getter and setter. But i can't guarantee that it will work better then the native.

That should be just fine as long as it's close and I can grab it on the player damaged event server side

FabianTerhorst commented 2 years ago

Our internal getter behaves exactly the same as the native. So i guess this is for sure a bug inside gta.