Hello, I search in forum but I don’t find so I ask you here : I don’t understand how to get the closest player. I want to perform some actions only on a player only if he is near to me but I don’t find how. If you can help me
Maybe GET_NEAREST_PLAYER_TO_ENTITY will help.
Maybe but I try GetNearestPlayerToEntity(GetPlayerPed(-1)) and it doesn’t work
I have seen scripts who just check the distance between your position and the player next to you.
(But it only works with /dostuff id commands I guess)
Try with GetClosestPed native function
I tried but without any documentation is very difficult
function GetClosestPed(x, y, z, radius, p4, p5, p7, p8, pedType)
Because I’m not sure you can use GetNearestPlayerToEntity for players