Jump to content

GET_PED_NEARBY_PEDS


Native Details

  • NameGET_PED_NEARBY_PEDS
  • NamespacePED
  • Native Hash0x23F8F5FC7E8C4A6B
  • Typeint
  • First seen version1207

Native Parameters

  • Parameter 0Ped Ped
  • Parameter 1int* Peds
    Pointer to an array that will hold the found peds
  • Parameter 2int ignoredPedType
  • Parameter 3int p3

DESCRIPTION

Return is the number of peds found.

 


CODE EXAMPLE

// Original code from GTAForums modified for rdr2
int* pedArr = new int[8];
PED::GET_PED_NEARBY_PEDS(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), pedArr, -1,0);
	for (int i = 0; i < 10; i++) 
	{
		if (ENTITY::DOES_ENTITY_EXIST(pedArr[i]) && (pedArr[i] != PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID())))
		{
			// Do something fun with your found peds here
		}	
	}
                           
delete[] pedArr;

User Feedback

Recommended Comments

There are no comments to display.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

Recently Browsing 0

  • No registered users viewing this page.