Advertisement
R3QQ

No ragdoll or collision for peds GTAV

Nov 27th, 2015
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.47 KB | None | 0 0
  1. /*
  2. THIS FILE IS A MODDED VERSION OF A FILE PART OF GTA V SCRIPT HOOK SDK
  3. http://dev-c.com
  4. (C) Alexander Blade 2015
  5. */
  6.  
  7. #include "script.h"
  8. #include "keyboard.h"
  9.  
  10. void update_features()
  11. {
  12.     while (ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID()) || PLAYER::IS_PLAYER_BEING_ARRESTED(PLAYER::PLAYER_ID(), TRUE))
  13.         WAIT(0);
  14.  
  15.     Ped playerPed = PLAYER::PLAYER_PED_ID();
  16.     BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(playerPed);
  17.  
  18.     if (bPlayerExists){
  19.  
  20.         const int numElements = 20;
  21.         const int arrSize = numElements * 2 + 2;
  22.         int peds[arrSize];
  23.         //0 index is the size of the array
  24.         peds[0] = numElements;
  25.  
  26.         int count = PED::GET_PED_NEARBY_PEDS(PLAYER::PLAYER_PED_ID(), peds, 50);
  27.  
  28.         if (peds != NULL)
  29.         {
  30.             //Simple loop to go through results
  31.             for (int i = 0; i < count; i++)
  32.             {
  33.                 int offsettedID = i * 2 + 2;
  34.                 //Make sure it exists
  35.                 if (peds[offsettedID] != NULL && ENTITY::DOES_ENTITY_EXIST(peds[offsettedID]))
  36.                 {
  37.                     //Do something
  38.  
  39.                     PED::SET_PED_CAN_RAGDOLL(peds[offsettedID], FALSE);
  40.                     ENTITY::SET_ENTITY_PROOFS(peds[offsettedID], 0, 0, 0, 1/*collisionProof*/, 0, 0, 0, 0);
  41.                     /*
  42.                     void SET_ENTITY_PROOFS(Entity entity, BOOL bulletProof, BOOL fireProof,
  43.                     BOOL explosionProof, BOOL collisionProof, BOOL meleeProof,
  44.                     BOOL p6, BOOL p7, BOOL drownProof)*/
  45.                 }
  46.             }
  47.         }
  48.     }
  49. }
  50.  
  51.  
  52. void main()
  53. {
  54.  
  55.     while (true)
  56.     {
  57.         update_features();
  58.         WAIT(0);
  59.     }
  60.  
  61. }
  62.  
  63. void ScriptMain()
  64. {
  65.     srand(GetTickCount());
  66.     main();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement