Advertisement
Guest User

Untitled

a guest
Apr 4th, 2017
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.59 KB | None | 0 0
  1. /*
  2. This file was originally part of the GTA V SCRIPT HOOK SDK (c) Alexander Blade 2015, http://dev-c.com
  3. */
  4.  
  5. #include <string>
  6. #include <math.h>
  7. #include "script.h"
  8.  
  9. bool pressed = true;
  10. bool stop = false;
  11. ULONGLONG lastTick = 0;
  12.  
  13. void ScriptMain()
  14. {
  15.     while (true)
  16.     {
  17.         ULONGLONG tick = GetTickCount64();
  18.         if (stop) {
  19.             int people[1024];
  20.             int peopleCount = worldGetAllPeds(people, 1024);
  21.             for (int x = 0; x < peopleCount; x++)
  22.             {
  23.                 if (people[x] != PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()))
  24.                 {
  25.                     ENTITY::FREEZE_ENTITY_POSITION(people[x], true);
  26.                     AI::TASK_PAUSE(people[x], 10);
  27.                 }
  28.             }
  29.  
  30.             int vehicles[1024];
  31.             int vehicleCount = worldGetAllVehicles(vehicles, 1024);
  32.             for (int x = 0; x < vehicleCount; x++)
  33.             {
  34.                 if (vehicles[x] != PED::GET_VEHICLE_PED_IS_USING(PLAYER::PLAYER_PED_ID()))
  35.                 {
  36.                     ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], true);
  37.                 }
  38.                 else
  39.                 {
  40.                     WAIT(3);
  41.                     ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], false);
  42.                 }
  43.             }
  44.             // Make world stop here.
  45.         }
  46.         else if ((tick - lastTick) > 0) { //Apparently I didn't end up needing this so I set it to 0 instead of removing it, just in case I need it in the future.
  47.             int people[1024];
  48.             int count = worldGetAllPeds(people, 1024);
  49.             for (int x = 0; x < count; x++)
  50.             {
  51.                 if (people[x] != PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()))
  52.                 {
  53.                     ENTITY::FREEZE_ENTITY_POSITION(people[x], false);
  54.                 }
  55.             }
  56.  
  57.             int vehicles[1024];
  58.             int vehicleCount = worldGetAllVehicles(vehicles, 1024);
  59.             for (int x = 0; x < vehicleCount; x++)
  60.             {
  61.                 ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], false);
  62.             }
  63.             // Make world restart here.
  64.             lastTick = GetTickCount64();
  65.         }
  66.         if ((CONTROLS::IS_CONTROL_PRESSED(2, 51) || CONTROLS::IS_CONTROL_PRESSED(2, 54) || CONTROLS::IS_CONTROL_PRESSED(2, 74)) && (pressed)) {
  67.             pressed = false;
  68.             stop = (!stop);
  69.         }
  70.         else if (!(CONTROLS::IS_CONTROL_PRESSED(2, 51) || CONTROLS::IS_CONTROL_PRESSED(2, 54) || CONTROLS::IS_CONTROL_PRESSED(2, 74))) {
  71.             pressed = (true);
  72.         }
  73.         WAIT(0);
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement