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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Red Dead Redemption 2 Native Database by www.mod-rdr.com, includes contributions by gudmunduro and alloc8or.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...