Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

[,NET] Disable police


Recommended Posts



I am working on a bus mod lately but there's a problem with random police chases,

After shootout passengers get to panic mode and don't respond anymore.

Is there any native function to disable police chases and patrol cars ?

Thanks, Mordecki.

Link to comment
Share on other sites

On one of my many excursions through the scripts, I found a function that they use to clear the map of activity for when you go into Director mode. One of the natives used in there was ENABLE_DISPATCH_SERVICE and in this function, they set 3 and 5 to false. Those (according to nativedb) are Ambulance and Fire Department. Here's the full list of enums.

enum eDispatchType : UINT16
DT_PoliceAutomobile = 1,
DT_PoliceHelicopter = 2,
DT_FireDepartment = 3,
DT_SwatAutomobile = 4,
DT_AmbulanceDepartment = 5,
DT_PoliceRiders = 6,
DT_PoliceVehicleRequest = 7,
DT_PoliceRoadBlock = 8,
DT_PoliceAutomobileWaitPulledOver = 9,
DT_PoliceAutomobileWaitCruising = 10,
DT_Gangs = 11,
DT_SwatHelicopter = 12,
DT_PoliceBoat = 13,
DT_ArmyVehicle = 14,
DT_BikerBackup = 15

It might be worth disabling the dispatch services 1 & 2, just to see if that has any effect. It might just be for things the player does but then again, you might get lucky and it does what you need.


There's also the brute-force option. Using this native IS_VEHICLE_SIREN_ON, you could collect the local vehicles and if you found any police vehicles with that native returning a true, delete the vehcle.


The final option would be to check through the scripts to see if any of the "controller" scrpts have anything to do with it. If so, you could add some code that disables that script from running. Digging through the scrips can be time consuming though, so it's worth trying the dispatch service option first.


Nice script btw, I gave it a go yesterday and it works really well... if I might make a small request, a "voice off" option in the ini would be great. I tried it with Trevor and after 5 stops, I wanted to drag him out of the bus and kill him myself, for being nice and welcoming to everyne at every stop. :)


Edit: Have a look at traffick_ground.c in the decompiled scripts. I am seeing things like:




So there might be something in there. It's an almost 24,000 line script though but it might be worth a closer look.


Double-Edit: Just had my script watcher monitoring that traffick_ground script and when a police chase started, it remained inactive, so that doesn't seem to be connected.

Edited by Guest
Link to comment
Share on other sites

I have just been looking through the natives and there are two natives for blocking events, are you using any of them, or even both of trhem? They're TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS and SET_BLOCKING_OF_NON_TEMPORARY_EVENTS.


The comment under the 2nd one on NativeDB says " works with AI::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS to make a ped completely oblivious to all events going on around him "

Edited by Guest
Link to comment
Share on other sites

Thanks for research !


I tried:

ped.BlockPermanentEvents = true;

but will also add:



maybe it's gonna work better, also added a timer as one of the solutions,

when someone won't leave the bus within 15 seconds he will be force removed from the bus.


ps: yeah i will remove that voice in the next update, it's too iritating ;)

Edited by Mordecki
Link to comment
Share on other sites

Yeah, forcing them off the bus is a good option. The other way, which is a bit of an overkill way, would be to store the configurations of any peds on the bus and then respawn them with that configuration. But if the extra blocking works, then that's even better.

Link to comment
Share on other sites

After noticing a comment on your mod about Native Trainer being able to disable police, I looked in the source of that trainer. That led me to a section in the NativeDB that had these natives.

	void SET_CREATE_RANDOM_COPS(BOOL toggle) // 102E68B2024D536D 23441648

Some of them look like they might be promising.


The ones used in Native Trainer are the bottom one to check the state of random cops, and the top one being used to set the state.

Edited by Guest
Link to comment
Share on other sites

@MordeckiI tried the new version tonight and noticed something  that requires a bit of attention.


I always start my games as Trevor and you have a route start point right near his trailer in Sandy Shores. If I hit insert, it spawns another bus at the same location. If I hit insert again, it adds another bus etc...because I write script mods, hitting insert is something I do a lot, so buses were coming over the fence into the street. :D


It just needs a check in the spawning process to see if a bus already exists at the spawn location and to then either use that existing bus, or to delete it and spawn a new one. Even if your script is 100% stable, another mod could cause the user to hit Insert, so it's something to be aware of.


You have the same problem with Blips, they are something else that need to be cleaned up when scripts are reset. If you add a handler for the Script.Aborted event, you can use that to handle things like that. If you don't, Blips will keep stacking up in the map and it won't take long before the game starts to suffer from them. Blips seem capable of doing surprising damage to the game's stability... as I discovered when I dumped 1200 of them into the map by mistake. :blush: If you hit insert and go to one of your bus blips, it will say 2/2 or 1/2, if you hit insert again, it will say 3/3.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.