Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This file was originally part of the GTA V SCRIPT HOOK SDK (c) Alexander Blade 2015, http://dev-c.com
- */
- #include <string>
- #include <math.h>
- #include "script.h"
- bool pressed = true;
- bool stop = false;
- ULONGLONG lastTick = 0;
- void ScriptMain()
- {
- while (true)
- {
- ULONGLONG tick = GetTickCount64();
- if (stop) {
- int people[1024];
- int peopleCount = worldGetAllPeds(people, 1024);
- for (int x = 0; x < peopleCount; x++)
- {
- if (people[x] != PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()))
- {
- ENTITY::FREEZE_ENTITY_POSITION(people[x], true);
- AI::TASK_PAUSE(people[x], 10);
- }
- }
- int vehicles[1024];
- int vehicleCount = worldGetAllVehicles(vehicles, 1024);
- for (int x = 0; x < vehicleCount; x++)
- {
- if (vehicles[x] != PED::GET_VEHICLE_PED_IS_USING(PLAYER::PLAYER_PED_ID()))
- {
- ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], true);
- }
- else
- {
- WAIT(3);
- ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], false);
- }
- }
- // Make world stop here.
- }
- 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.
- int people[1024];
- int count = worldGetAllPeds(people, 1024);
- for (int x = 0; x < count; x++)
- {
- if (people[x] != PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()))
- {
- ENTITY::FREEZE_ENTITY_POSITION(people[x], false);
- }
- }
- int vehicles[1024];
- int vehicleCount = worldGetAllVehicles(vehicles, 1024);
- for (int x = 0; x < vehicleCount; x++)
- {
- ENTITY::FREEZE_ENTITY_POSITION(vehicles[x], false);
- }
- // Make world restart here.
- lastTick = GetTickCount64();
- }
- if ((CONTROLS::IS_CONTROL_PRESSED(2, 51) || CONTROLS::IS_CONTROL_PRESSED(2, 54) || CONTROLS::IS_CONTROL_PRESSED(2, 74)) && (pressed)) {
- pressed = false;
- stop = (!stop);
- }
- else if (!(CONTROLS::IS_CONTROL_PRESSED(2, 51) || CONTROLS::IS_CONTROL_PRESSED(2, 54) || CONTROLS::IS_CONTROL_PRESSED(2, 74))) {
- pressed = (true);
- }
- WAIT(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement