PED

GET_PED_NEARBY_VEHICLES

0xCFF869CBFA210D82 Jenkins: 0xCB716F68

Signature

// PED
int GET_PED_NEARBY_VEHICLES(Ped ped, Any* sizeAndVehs)

Parameters

Type Name
Ped ped
Any* sizeAndVehs

Return type int

Build 323

Documentation

Returns size of array, passed into the second variable. See below for usage information. This function actually requires a struct, where the first value is the maximum number of elements to return. Here is a sample of how I was able to get it to work correctly, without yet knowing the struct format. //Setup the array const int numElements = 10; const int arrSize = numElements * 2 + 2; Any veh[arrSize]; //0 index is the size of the array veh[0] = numElements; int count = PED::GET_PED_NEARBY_VEHICLES(PLAYER::PLAYER_PED_ID(), veh); if (veh != NULL) { //Simple loop to go through results for (int i = 0; i < count; i++) { int offsettedID = i * 2 + 2; //Make sure it exists if (veh[offsettedID] != NULL && ENTITY::DOES_ENTITY_EXIST(veh[offsettedID])) { //Do something } } }

APPI RP

Join us on FiveM

Semi-Serious GTA V roleplay on APPI RolePlay — hop into Discord for rules and onboarding, then follow the guide when you're ready to connect.