[FREE] [Release] AIBackup Remastered - Enhanced Patrol Unit | New Air Unit | Bugs Fixes

******************************************
*                                        *
*   AIBACKUP REMASTERED by MajorFivePD   *
*                                        *
******************************************

Credits to: Mooreiche | Mobius1 | TorstenDittmann
(His code did not received any update since 3 years ago, so I thought that maybe someone needs this resource but with the fixes and new possibilities.)

PATROL UNIT PREVIEW

AIR UNIT (NEW) - PREVIEW

DOWNLOAD HERE (Without Police Job Check)

DOWNLOAD NEW VERSION [PoliceJob]

Thanks to Manta for helping with the police job version!

Installation: drag ā€œAIBackupRemasterā€ to your server resources folder and add to your server.cfg ā€œensure AIBackupRemasterā€

[Do not rename the folder and copy the exactly name into the server.cfg]

To call Patrol Unit Backup: /aib or ā€œ+ā€ in your NUMPAD

To cancel both backups press ā€œ-ā€ in your NUMPAD

To call Air Unit: /aib2

[You are only able to call one of them, if you called air unit, you canā€™t call patrol, and vice-versa]
[You are only able to call ONE unit, you canā€™t call more than 1 patrol or 1 air unit]
[Only able to call Air Unit via chat command]
[Controller Support in this resource disabled to avoid issues while using controller]

CHANGES | BUG FIXES | NEW FUNCTION:

  • KNOWN BUGS FIXED:

    • Fixed Relationship issue where nearby random npcs starts following you endless after you call or end the backup.

    • Fixed Relationship issue where the backup cop would try to enter your vehicle constantly, following you forever and never going away when they were cancelled.

    • Added new function so when you cancel the backup, the cop will get in their vehicle and drive away in the traffic.

    • Changed the backup so instead of going to your coords, the cop will follow you with lights/sirens on in a safe distance allowing pursuits to take place, and he will only leave the vehicle if you or him is being threatened/shot by enemies.

  • ADDED NEW BACKUP ā†’ AIR UNIT (POLMAV)

    Air Unit will follow you realistically at safe height (always will overcome and pilot safe to follow professionally) and itā€™s able to pilot between skyscrapers/tall buildings and will use spotlight at night being fully immersive

CONFIGURATION:

  • In the ā€œvariablesā€ and ā€œAddEventHandlerā€ section, you can ONLY change these values:
-- variables --
police        = GetHashKey('police3') -- You can add any vehicle here, replace or addon.
policeman     = GetHashKey("s_m_y_cop_01") -- You can add any ped here.

            local mode = -1  -- 0 for ahead, -1 = behind , 1 = left, 2 = right, 3 = back left, 4 = back right  
            local speed = 50.0 -- Modify the backup maximum speed when following you.
            local minDistance = 4.0 -- Default safe distance set by me, you can change it here.
            local p7 = 0 -- Do not touch here
            local noRoadsDistance = 0.0 -- Do not touch here

Credits to: Mooreiche | Mobius1 | TorstenDittmann
My Github: dsvipeer Ā· GitHub
My Profile: Profile - MajorFivePD - Cfx.re Community

5 Likes

Any chance to get work just for police jobs?

1 Like

I reworked this resource a time ago because my server focuses only AI - Player interaction [FivePD], so I did not have planned, but maybe in the future if I got time I try to add job check. But thanks for the suggestion.

1 Like

I agree, making this tied to police jobs would be a game changer. Would love to see this as an option for low population servers.

Great work nonetheless. Thank you for this release!

2 Likes

Thank you man! Very great resource, i hope on it. It could be a very good release for RP server.

1 Like

ESX Version with job check ā†’ Maybe coming soon.

error client.lua:62 global ā€˜ESXā€™

I canā€™t test the job part because my server does not uses jobs fully setup, anyways, the default job is UNEMPLOYED and Iā€™m in this job probably, so working.

Tested and Itā€™s now correctly blocking any normal person without a job in ESX without errors.

it work but npc not walk come me

Ok then Iā€™ll work on this later when I got more time, for now it will stay without any job checks, and sorry for the incovenience.

Added PR on github for police job

1 Like

Is there an option to change them from police to maybe gang members?

Yes, but it will be for now with only one ped (driver) I couldnā€™t figure out a good way of placing more inside the vehicle without breaking something, for now just change the models and you are good to go:

This is a improvised way of doing what you want, in the future Iā€™ll update this resource more.

-- variables --
police        = GetHashKey('virgo2') 
policeman     = GetHashKey("g_m_y_ballaeast_01")
companyName   = "Dispatch"
companyIcon   = "CHAR_CALL911"
drivingStyle  = 537133628 -- https://www.vespura.com/fivem/drivingstyle/
playerSpawned = false
active        = false
arrived       = false
vehicle       = nil
driver_ped    = nil
vehBlip       = nil

To edit the icon in the notification:

Example to add this:
image

Just replace:

Example: companyIcon = "CHAR_CALL911" with companyIcon = "CHAR_LJT"

And in the AddEventHandler('POL:Spawn', function(player)

GiveWeaponToPed(driver_ped, GetHashKey("WEAPON_MICROSMG"), math.random(20, 100), false, true)

Also you can edit the notification in the line 119 and 178 if you want:

ShowAdvancedNotification(companyIcon, companyName, "DISPATCH", "A Patrol Unit is heading to your location.")

ShowAdvancedNotification(companyIcon, companyName, "DISPATCH", "Backup Dispatch has been cancelled.")

You can find the ped hashes names here: Peds Names
You can find the gun hashes names here: Weapons Names
You can find the vehicles names here: Vehicles Names Here

1 Like

Thank you very much for sharing this info, it will definitely be useful for me and others who are looking to have a gang to follow etc.

1 Like

Youā€™re welcome, happy gaming!

1 Like

Again I was just looking over it again and am just blown away that you took the time to not only post what code to change but links to information, thats so rare these days, normally its met with ā€œgo to youtubeā€ but you took the time out and you didnt have to, thanks so much, I really appreciate this.
You enjoy your weekend!

1 Like

Thank you! Yes, nowadays people became too selfish or closed to help others even tho itā€™s a simple/quick thing for them to explain. Hope you have a great weekend too!

1 Like