Server crash when using GetPlayerWeaponDefenseModifier

Hello, i’m currently using GetPlayerWeaponDefenseModifier server-side for anticheat purposes.

But it seems like using GetPlayerWeaponDefenseModifier with invalid server id is causing the entire server to crash.

It doesn’t seems like other methods using “MakePlayerEntityFunction” are having this problem, but I can’t understand where the problem can be in a simple native like this one.

Full server crash dump : https://we.tl/t-fURNUoefZN
(Server using 3586 artifact)

Example :

Citizen.CreateThread(function()
    GetPlayerWeaponDefenseModifier(123456789123456789)
end)

Am I missing something about this native or the code related to it ?

Native decl seems to mention Player which is not a valid type on server here.

1 Like

Solved with tweak(gamestate): Player-typed entity RPC, loading more model types · citizenfx/fivem@00d1136 · GitHub

My example code doesn’t cause any crash anymore :slight_smile:
Good job !