R3QQ

[Script Hook V SDK] Very simple template for script.cpp

Nov 20th, 2016
1,550
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  9. Ped playerPed;
  10. BOOL playerExists;
  11.  
  12. void update_features()
  13. {
  14.         while (ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID()) || PLAYER::IS_PLAYER_BEING_ARRESTED(PLAYER::PLAYER_ID(), TRUE))
  15.                 WAIT(0);
  16.  
  17.         playerPed = PLAYER::PLAYER_PED_ID();
  18.         playerExists = ENTITY::DOES_ENTITY_EXIST(playerPed);
  19.        
  20.         if (playerExists){
  21.                 PED::SET_PED_CAN_BE_DRAGGED_OUT(playerPed, false); // Example, remove this line and add something
  22.                                                                    // you like to do.
  23.         }
  24. }
  25.  
  26. void main()
  27. {
  28.         while (true)
  29.         {
  30.                 update_features();
  31.                 WAIT(0); // Lets other scripts run before returning to this one.
  32.         }
  33. }
  34.  
  35. void ScriptMain()
  36. {
  37.         srand(GetTickCount());
  38.         main();
  39. }
RAW Paste Data