For anyone using C#, I've had a couple headaches figuring it out, so here's my code: Get ped nearby peds unsafe List<Ped> GetNearbyPeds(Ped p, int maxPeds = 50) { int[] buffer = new int[maxPeds * 2 + 2]; buffer[0] = maxPeds; List<Ped> foundPeds = new List<Ped>(); fixed (int* pBuffer = buffer) { int foundCount = Function.Call<int>(Hash.GET_PED_NEARBY_PEDS, p, pBuffer, -1, 0); for (int i = 0; i < foundCount; i++) { int pedHandle = buffer[i * 2 + 2]; Ped nearbyPed = new Ped(pedHandle); foundPeds.Add(nearbyPed); } } return foundPeds; } The function deals with a ton of memory, so it needs to be unsafe. For some reason, the first index for the buffer, where the list of handles will go, needs to have the amount of peds, and the second is garbage data, so it'll be empty. It starts at the 2 index, and every other index will be full of garbage. Using fixed (int* pBuffer = buffer) is required so that the garbage collector doesn't change the address of the buffer, which is why it's also used to create the pointer. The return of the function will contain the amount of peds found, which will usually, though not always, be the same amount as the amount of peds that you wanted. The function requires p, which will be the ped that we will search around, and the pointer to the buffer, though not the buffer itself, because it will change the data of the address that you give it. If you give it an object, it will crash. The -1 refers to the type of peds that will be filtered, and while I don't know what the other numbers do, -1 returns all peds. No one knows what the third argument does. Whenever you want to access a handle, you need to first skip the first two, which contain the amount of peds and garbage data respectively, and then multiply your index by two, because every other index has garbage data that will not hesitate to crash the game.