Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
4,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. To make this work in most menu bases at least in C++ do it like so,
  2.  
  3. Put these variables as global variables wherever you store yours.
  4.  
  5. bool getNearbyPeds = false //just an example if variable.
  6. const int numElements = 10;
  7. const int arrSize = numElements * 2 + 2;
  8. int nearbyPed[arrSize];
  9.  
  10. Example use,
  11.  
  12. if(getNearbyPeds){
  13.         nearbyPed[0] = numElements2;
  14.         int count = PED::GET_PED_NEARBY_PEDS(PLAYER::PLAYER_PED_ID(), nearbyPed, -1);
  15.  
  16.         if (nearbyPed != NULL)
  17.         {
  18.             for (int i = 0; i < count; i++)
  19.             {
  20.                 int offsettedID = i * 2 + 2;
  21.  
  22.                 if (nearbyPed[offsettedID] != NULL && ENTITY::DOES_ENTITY_EXIST(nearbyPed[offsettedID]))
  23.                 {
  24.                     NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(nearbyPed[i]);
  25.                     if(NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(nearbyPed[i])){
  26.                         if(!FIRE::IS_ENTITY_ON_FIRE(nearbyPed[i])){
  27.                             FIRE::START_ENTITY_FIRE(nearbyPed[i]);
  28.                             printf("Peds Grabbed: %i \n", count);
  29.                             getNearbyPed = false;
  30.                         }
  31.                     }
  32.                 }
  33.             }
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement