Guest User

GTAC - Police Chase (Client)

a guest
Jul 15th, 2019
164
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let policeVehicles = [[116],[156],[596,597,598,599,523]];
  2. let policeSkins = [[1],[1],[280,281,282,283,284,288]];
  3. let pursueSpeeds = [0,15,25,35,45,55];
  4.  
  5. addEventHandler("OnElementStreamIn", function(event, element) {
  6.     if(element.isType(ELEMENT_VEHICLE)) {
  7.         if(localPlayer.wantedLevel > 0) {
  8.             if((policeVehicles[gta.game].indexOf(element.modelIndex) != -1)) {
  9.                 if(element.getOccupant(0).isType(ELEMENT_CIVILIAN)
  10.                     if(policeSkins[gta.game].indexOf(element.getOccupant(0).skin)) {
  11.                         if(isConnected && !element.isSyncer) {
  12.                             triggerNetworkEvent("pursueme", element);
  13.                         } else {
  14.                             startPolicePursuit(element);
  15.                         }                  
  16.                     }
  17.                 }
  18.             }
  19.         }
  20.     }
  21. });
  22.  
  23. function startPolicePursuit(vehicle) {
  24.     vehicle.setCarCruiseSpeed(pursueSpeeds[localPlayer.wantedLevel]);
  25.     vehicle.setCarMission(5);
  26. }
  27. addNetworkHandler("pursueme", startPolicePursuit);
RAW Paste Data