Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site 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.

Share this post

Link to post
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 LeeC2202

Share this post

Link to post
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 LeeC2202

Share this post

Link to post
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

Share this post

Link to post
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.

Share this post

Link to post
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 LeeC2202

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

  • Create New...

Important Information

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