GetClosestPed for animals?

I have found that GetClosestPed(pos[‘x’], pos[‘y’], pos[‘z’], 20.05, 1, 0, 0, 0, 28) always returns false when trying to return the closest animal in the world Pedtype 28. (I have tested when its only me and animals around)

Works fine for humanoid peds, could anyone shed any light on this?

Many Thanks

Did you tried without ped flags?

Yes without the flags or -1 its still false, I have made sure they are not fleeing when the check is occuring but still nothing.

You can try with raycast system

The problem is that I wanted to make a hunting system, I need to return animals that aren’t always visible. Will keep looking into this.

What does it even return?

It should return an animal, if DoesEntityExist(Ped) then do;

int GET_PED_TYPE(Ped ped) // FF059E1E4C01E63C B1460D43
Ped Types: (ordered by return priority)

Michael = 0
Franklin = 1
Trevor = 2

Army = 29
Animal = 28
SWAT = 27
LSFD = 21
Paramedic = 20

Cop = 6

Male = 4
Female = 5 

Human = 26

hc_gunman : 4 // Mix male and female
hc_hacker : 4 // Mix male and female
mp_f_misty_01 : 4 // Female character
s_f_y_ranger_01 : 5 // Ranger
s_m_y_ranger_01 : 4 // Ranger
s_m_y_uscg_01 : 6 // US Coast Guard

If i am around animals it just returns false, I am trying to grab an animal ped from the world, the function works as expected for humanoid peds. I tried using the native GetPedNearbyPeds() but it seems to not be implemented yet. Thanks for your help.

I am trying to do the same thing now, have you had any luck? I tried raycast but it didnt work either…

If a Native don’t work, exec with InvokeNative 90% of times it works