[PAID] [MEGA UPDATE] MFPD-PoliceCompanion - EUP Support and SQUAD FORMATION!

A script by MajorFivePD

No reviews yet.
[PAID] [MEGA UPDATE] MFPD-PoliceCompanion - EUP Support and SQUAD FORMATION! main image

Price

Unknown

Full Description

MFPD-PoliceCompanion


HOW IT WORKS:

The MFPD Police Companion resource is designed to enhance your in-game experience by providing responsive, realistic police companions;

**These companions get your EUP/Clothing, use your current equipped weapon upon spawning, and are fully visible to nearby players, making sure that they only will be hostile to other enemies, avoiding any unexpected shootout or fight!

Buy your Police Companion here! :heart:

Preview:

Formation preview:

Your police companion will NOT attack any cop/security guard:

Companions Entering and Leaving your vehicle, They will look for free seats, if there are none anymore, they will follow on foot! (Remember: You can spawn up to 9!)

NEW FEATURES & IMPROVEMENTS:

  • Organized Squad Formation:
    Companions now follow you in a structured V-shaped formation rather than clustering behind you. Up to 9 companions can line up in an organized squad, enhancing immersion and tactical appeal.

  • Dynamic Movement Speed:
    Your companions adjust their running speed to match yours. If you sprint, they run alongside you at a similar pace, ensuring they keep up seamlessly regardless of your movement.
  • Enhanced /stay Command Behavior:
    The /stay command has been improved to check your configuration for animation preferences:
    • If Config.UseAnim is set to true, companions will play a specified animation when standing still.
    • If Config.UseAnim is set to false, they will remain stationary without playing the animation, respecting your configuration choice.
    • This allows you to customize whether companions use animations during a stay command.
  • Framework Compatibility & Configuration:
    • ESX/QBCore Integration:
      Specify allowed jobs (e.g., police, sheriff) within config.lua to control who can spawn companions.
    • Standalone Mode:
      Operates independently, offering full companion functionality without a framework.

KEY FEATURES:

:small_blue_diamond: Companion Spawning and Management:

  • Spawn Command:
Config.SpawnCommand = 'mfpd' -- Change to whatever you desire

Config.StopCompanion = 'stay' -- Change to whatever you desire

Config.DismissCommand = 'bye' -- Change to whatever you desire

If your ped dies, it will AUTOMATICALLY delete all of your companions, to avoid strange behaviors!

  • Stop Companion Command:

Use stay to toggle between stopping in formation and resuming follow behavior.

  • Max Companions:
    Supports up to 10 companions per player, organized and they will walk/run in formation.

:small_blue_diamond: Enhanced Companion Behavior:

  • Organized Formation:

Companions follow you in organized squad formation for tactical realism. Configurable in config.lua

------------------------------------------------------
--          FORMATION OFFSETS EXPLANATION           --
--                                                  --
-- 1)  x coordinate:                                --
--     • Negative (-) moves companions to the LEFT  --
--     • Positive (+) moves companions to the RIGHT --
--                                                  --
-- 2)  y coordinate:                                --
--     • Negative (-) moves companions BEHIND you   --
--     • Positive (+) moves companions IN FRONT     --
--                                                  --
-- 3)  z coordinate:                                --
--     • Negative (-) places them BELOW your level  --
--     • Positive (+) places them ABOVE your level  --
--                                                  --
-- Adjust these values to position your companions  --
-- however you prefer. Below are just examples.     --
------------------------------------------------------

Config.FormationOffsets = {
    -- Companion #1: Slightly to the left of player
    { x = -2.0,  y =  0.0,  z = 0.0 },
    
    -- Companion #2: Further left & behind
    { x = -3.0,  y = -1.5,  z = 0.0 },
    
    -- Companion #3: Further left & in front
    { x = -3.0,  y =  1.5,  z = 0.0 },
    
    -- Companion #4: Even more left & behind
    { x = -4.0,  y = -3.0,  z = 0.0 },
    
    -- Companion #5: Even more left & in front
    { x = -4.0,  y =  3.0,  z = 0.0 },
    
    -- Companion #6: Farther left & behind
    { x = -5.0,  y = -4.5,  z = 0.0 },
    
    -- Companion #7: Farther left & in front
    { x = -5.0,  y =  4.5,  z = 0.0 },
    
    -- Companion #8: Very far left & behind
    { x = -6.0,  y = -6.0,  z = 0.0 },
    
    -- Companion #9: Very far left & in front
    { x = -6.0,  y =  6.0,  z = 0.0 },
    
    -- Companion #10: Behind the player’s left
    { x = -2.5,  y = -3.0,  z = 0.0 }
}
  • Dynamic Movement:
    They adjust their speed based on your movement, running when you run.

  • Combat Attributes:
    Improved combat ensuring that companions will be able to communicate with each other and move together, taking cover or doing the appropriate action and engagement logic, including intelligent threat detection.

Config = {}

-- Choose the framework or Standalone mode
Config.Framework = 'Standalone' -- Options: 'ESX', 'QBCore', 'Standalone'

-- Resource Commands --  -- 
Config.SpawnCommand = 'mfpd' -- Change to whatever you desire

Config.StopCompanion = 'stay' -- Change to whatever you desire

Config.DismissCommand = 'bye' -- Change to whatever you desire

Config.ReactArea = 150.0  -- Set desired HOSTILE detection radius (in meters)
--  --  --  --  --  --  --  -- 

Config.UseAnim = false  -- or false if you DO NOT want the animation below to play after /stay.

Config.Animation = { -- Default animations used to set both companions to Stay in place.
    Dict = "amb@world_human_cop_idles@male@idle_b",  -- Change animation dictionary here.
    Name = "idle_e"  -- Change animation name here.
}
 
-- Job/Role configuration for ESX.
Config.ESX = {
    AllowedJobs = { -- You need to setup your job/roles here.
        'police', 
        'sheriff'
    }
}

-- Job/Role configuration for QBCore.
Config.QBCore = {
    AllowedJobs = { -- You need to setup your job/roles here.
        'police',
        'sheriff'
    }
}
  • Animation Control:
    The stay command respects that you set in the config.lua respects the Config.UseAnim:

    • When enabled, companions play a defined idle animation.
    • When disabled, they simply stop without animation.
  • Vehicle Interactions:
    Companions intelligently enter and exit vehicles with you based on your actions. No need to type any additional commmands.

Companions will get out with their weapons equipped back if they had one.

:small_blue_diamond: Aiming/Flashlight Functionality:

  • Aiming Command:
    Press H to toggle companion aim on the entity you target (including props, vehicles, or peds).
    You can change the keybind in the IN-GAME PAUSE MENU > Configs > Keyboard > FiveM > MFPD-PoliceCompanion > Toggle Companion Aim.

Companions will use flashlight if the weapon you gave to them had flashlights!

Buy your Police Companion here! :heart:


HOW TO INSTALL:

  1. Download and extract the “MFPD-PoliceCompanion” resource.

  2. Place the resource folder into your server’s resources directory.

  3. Add the following line to your server.cfg:

  4. ensure MFPD-PoliceCompanion

Any support related questions, bugs/errors found, contact me via DM here on the Forum.

Code is accessible No - Only Config.lua
Subscription-based No
------------------------------------- ----------------------------
Lines (approximately) 587+
------------------------------------- ----------------------------
Requirements N/A
------------------------------------- ----------------------------
Support Yes
------------------------------------- ----------------------------