fivem icon indicating copy to clipboard operation
fivem copied to clipboard

[REDM] IsPedCuffed Incorrect Retval

Open Zer0Cool0 opened this issue 3 months ago • 3 comments

What happened?

The native at first glance appears to be correct, however if a ped is hogtied, then killed it returns the value of 1 (true), even if they are not actually handcuffed.

Video: https://streamable.com/8iwfdo

For clarity; this native appears to work correctly UNTIL the ped in question is hogtied then killed, in which it will return '1' regardless of if the ped is actually handcuffed (SetEnableHandcuffs / 0xDF1AF8B5D56542FA)

Expected result

This native should return FALSE if the ped is not handcuffed. Even if hogtied and dead

Reproduction steps

  1. Create a command (or use runcode) that prints IsPedCuffed(PlayerPedId()):

RegisterCommand('p', function() print(IsPedCuffed(PlayerPedId())) end, false)

  1. Run it while alive, not hogtied, not handcuffed, it will return false, as it should.
  2. Once alive again, have a nearby npc ped hogtie your ped or have another player hogtie you.
  3. Once hogtied, run your command again and you will get a return of '1' (true)

You can also create a command to set your ped as handcuffed to test the native's retval. From my testing it works as expected UNTIL the ped in question is hogtied and dead, in which it returns '1' instead of false.

Importancy

Unknown

Area(s)

RedM, Natives

Specific version(s)

RedM 1491

Additional information

No response

Zer0Cool0 avatar May 25 '24 20:05 Zer0Cool0