[Release] 'Crackdown' Missions System v3 & GitHub for your own missions

What is the resource about?

Overview of what this resource is

A mission system with a default game mode, but everything is configurable, so it can be tailored to your own server, be it RP or any other. Create/edit your own missions as well. Missions can be standard (same everytime you play), random (different every time, like location and enemies), and hybrid/quasi-random, which is a mix of standard and random.

Default Game Mode Description

Basically, players cooperate and/or compete in missions to earn as much money as possible. $ penalties accrue for a player when a player uses a resource from the mission safehouse or dies (rejuvenation fee). Scoreboard shows total money for player and money per mission stats as well. There are 55 missions in total.
Safehouses exist for missions where players get weapons/ammo and super jump, fast run, fast swim and super health which regenerates (hence the name Crackdown), as well as vehicles. This is tailored for the enemies they will need to fight.
When a mission starts a help message in the upper LHS will give you a tutorial on controls etc… for the mission.

Mission types are basically:

Assassinate (kill all enemy targets)
Capture the Objective (self explanatory)
Secure the Objectives (multiple objectives)
Hostage Rescue (secure all hostages)
Defend (stop enemies reaching a zone)
Defend The Target (make sure enemies dont kill a ped target you are defending, they can be on foot or in a vehicle)
Escort the Target (Make sure the target in a vehicle makes it to the objective without being killed. The target may be driving/flying themselves, or a player will drive them)
Rescue the Target (Defend the target and rescue them like you would a hostage)
Race (Players race through checkpoints to the finish line, but enemies spawn at checkpoints and elsewhere on the map to stop players)

Note: hostages can show up in any mission type for extra $

Everytime you use a safehouse or a safehouse resource (see below), there is typically a 2 to 3 minute delay until you can use the safehouse or a safehouse resource again. Exceptions are safehouse vehicles, mission AI backups, Rejuvenation, Jump to Target Vehicle and Mission Resource Drops.

Safehouse Resources which can cost money:

Safehouse (get all the weapons ammo and upgrades)
Safehouse Vehicles (claim a vehicle which only you can drive, but other players can be passengers. The amount of vehicles you can claim is limited per mission)
Mission Resource Drops (MRDs) (Probably the most important resource, drop an MRD during a mission, so that when you die/get killed and respawn back at the safehouse, you can quickly spawn at the MRD location, on foot or in a vehicle, to quickly get back into the action)

Call Mission Backup. Call in an AI comrade to help fight aside you, like taking a turret etc… One backup per player, no need for safehouse to be open… Backup can be dismissed, and you can select different types of backups to chose from with different weapons, at different safehouse costs. BACKUPS ARE TURNED OFF BY DEFAULT, set Config.MissionDoBackup=true in Missions.lua to enable.
Call in Air Drop (Drops a crate where you get everything a safehoue gives)
RC Bandito Remote Detonate (Call in an RC Bandito rigged with a bomb, which you can drive to enemies, and explode multiple times for around 3-5 seconds. This will cost a safehouse vehicle claim)
Repair Vehicle (Fix a vehicle you are driving or a passenger of or are near, which can be helpful especially in escort missions)
Heal Target (Heal a ped target you are near when defending them)
Jump to Target Vehicle (When in range, the player can jump to the vehicle the ped target they are defending is in [as a driver or passenger]. If driver seat is empty, player will go to that seat, else it will be the first empty turret seat, else it will be another seat. There is no $ cost for this.)
Rejuvenation (The cost it takes to respawn at the safehouse)
Switch seats with Backup AI no cost for this. Controls allows for the player to swap seats with their AI Backup, for instance you may want the backup to swap to a turret seat you are in. Np need for safehouse to be open obviously.

Hi,
The ‘Crackdown’ missions system recently had some major improvements in version 3, which includes:

  • much better AI, especially for defend, escort and transport missions, including randomized missions of these types that are different for each play.
  • more native feeling mission delivery and mission pass/fail events
  • many more options to create your own missions with complexity with simply editing a lua config file. Including linking missions together into multi-stage campaigns/missions
  • Very configurable to change it for servers of any type, RP, etc…, with simply editing a lua config file.
  • Now comes with 44 fleshed out missions of all different types, including 12 from the beta mission pack that take place in DLC areas. These are tailored to be played with the default settings/game mode. Worth playing them that way first to get a feel of what you can do, if you want to create/edit them and the settings for your own server/style.
  • ESX $ support as usual (Look for:
    local UseESX=false
    in client.lua and server.lua
    and set it to true.)

Development has basically finished, for the scope of what I wanted to achieve, so wanted to share with others who would like to use or adapt it for a mission system on their own servers…or to just play the default game mode etc…

To download Grab the latest build from GitHub. The latest there will be stable.

Source is on github now: GitHub - ddraigcymraeg/mrp-missions: Crackdown Mission Resource for FiveM
Please read the README.md to get started. It also has advice on how to extend the resource in various ways that was out of scope for what I wanted.

ONESYNC SUPPORT:
experimental ONESYNC support version below. Download the code from github and copy this server.lua over the old server.lua if you are on onesync, let me know if you have any issues with onesync with this file…

server.lua (37.4 KB)

The orginal thread for the resource when it was in beta is here: https://forum.cfx.re/t/release-fivem-crackdown-game-mode-and-mission-generator-creation-beta/
The first post has a ton of information, photos and videos, and the thread has basically all the archived builds uploaded and a lot of other info. All pertinent info is on Github as well.

You are welcome to use this resource as a reference for your own resource, just give credit to me and also to the people I credit in the fivem forum link above. As usual, I do not ‘officially’ support this, and it comes ‘as is’, its been well tested for bugs, but if any more are found I would consider creating patches.

Here is a short video of some new features that were recently added:

EDIT: Updated Missions.lua in the zip and on github to have Config.MissionShareMoney = true which is advised if you are giving out money for all enemy deaths for missions (rather than just a few targets in the mission), which the resource does by default.
If you are seriously giving money via ESX with this mission system, or taking the game mode $ seriously, and not having mission players share money, only consider giving money rewards for hostage rescues, objectives and limited targets in assassinate missions for now. There is a bug which I am not 100% sure yet is fixable, where code running somewhere on the client (looks to be outside my resource) can cause mission peds to “die” and the cause can be attributed to the player whose machine spawned the ped. So a player can be penalized or rewarded, who spawned the ped. So turn off kill penalties too in missions.lua.
When you share money, all players participating in the mission will share whatever was made. Any penalties will be due to safe house equipment costs from losing weapons/upgrades on respawn and any penalty or death the player will get on the server.

EDIT3: 1/12/2020 12:05PM EST More bug fixes and and added a cool new feature for transport, escort and similar missions, also proper help text now.

Mission Reinforcement Drops how to use and what they are:

EDIT4: Added 2 new missions, Mission43 and Mission44 which are helicopter versions of Mission25 and Mission28, which have planes.

EDIT5: Safe house mission peds will have anims and will occasionally talk, all configurable and can be turned on/off.

EDIT6: A few more tweaks and bug fixes, also a new video showing one of the new helicopter missions, Mission43 and showing how to get into the mission vehicle as a turret gunner or regular passenger in escort/transport/defend/rescue missions.

EDIT7: You can now summon and dismiss AI teamates/allies for the mission, as well as select any number of AI types to spawn (default is 4), with various button/key combos (in-game help when a mission is active has the controls info).
Very configurable as well. AI will fight with player and follow them, including getting in vehicles, and picking most useful available seat based on vehicle (configurable). They will not earn money for players though. This is turned off by default. See EDIT11 below.

EDIT8:
New checkpoint racing missions where players race against the clock and against themselves for $ while enemies try to stop them. Also much more improved random mission spawns, enemies down spawn under or over the map and end up mainly on roads anymore.

EDIT9
There can now be 1 to N randomly generated events for any mission, which will add to events already added to the mission.See ExtraRandomEventsType and GenerateExtraRandomEventsNum config vars in missions.lua

EDIT10
upgraded the rcbandito to make it actually worthwhile to use and pay for.
Instead of the one off vehicle explosion pressing LB or E key (default), Pressing and holding or repeatedly pressing the button/key will allow continuous explosions for 5 seconds while the player controls the rcbandito, until it blows up after 5 seconds. Cost to use is 3 times that of a regular vehicle by default, and counts as a safehouse vehicle. Cannot deploy while safehouse is closed as well.

EDIT11
Vehicle repairs are now possible when near a vehicle or inside it at a $ cost when the safehouse is open. This can be very helpful in escort missions whereby the target vehicle can be repaired on the fly, even if the player is not the driver.

EDIT12
Added support for creating your own missions like this

EDIT13
Scoreboard now sorts players by Money per mission or Total Money.

see top of scoreboard.lua

--1 = By Total Money, 2 = Money per Mission
local sortType=2

Some things as well to point out.

  1. The resource supports friendly AI backups (See EDIT 7 above) 1 per player. Unfortunately I was not able to find a good way through relational groups to stop enemy AI from occasionally accidently killing themselves when friendly AI backup is turned on globally or per mission for that mission (MissionDoBackup=true)
    For the best experience its best to play with MissionDoBackup=false (which is now the default), so enemy A.I. are much more challenging and fun to play against. Saying that the friendly backup AI can be fun and great to player with, especially with lower player count.

  2. Also MissionShareMoney = true by default, where players share the mission $ rewards . This was added because the peer that spawned a ped or vehicle will get a kill reward even when the peds kill themselves via crashing or whatever, not making it fair to other players. Causes of death provided by the natives will not cover all cases either, sometimes the ped seems to vanish, which is scored as a kill for the host. Setting this to false will bring up the old $ scoring, where players score for themselves.
    For both, $ losses come from player deaths, or buying vehicles/weapons/upgrades or killing hostages/protect targets etc…

EDIT 14:

For IsDefendTarget missions players can now heal the ped they are defending when within 2m away. This costs $ and can only be done when the safehouse is open, and costs a safehouse turn, whereby they have to wait till it is open again before using this ability again. Similar to vehicle repair.

EDIT 15
Feature for the backup AI. You can swap seats with them now using LB + RB or Q+E key (default). This is great for swapping back and forth with a turret seat, as well as letting the AI drive during combat.

31 Likes

Thank you

1 Like

Havent looked yet, but script looks promicing ! thank you

it is amazing!

1 Like

What is the difference: [RELEASE] FiveM Crackdown game mode and mission generator/creation [BETA]

Glad you like it. :slight_smile:

3.1.2 link on this thread is the most recent, and is what is in GitHub. Decided to announce it is out of beta as well as on github now. The info in the OP on the beta thread still (mostly) applies to this version, since I had maintained that post till this announcement was created.

1 Like

can this be used in normal fx servers?

It should be fine, did you read the readme.md on github?
Im not sure what you mean by “normal fx server”.

Sixsens who helped me QA this has ran it fine on his public RP server. There were some issues, (that he was able to resolve), when he went to OneSync. I mention this in the readme.md. I have tried to develop it, and QA it with public server in mind as well (at least the core functionality), with his help.
readme.md talks about how to extend the resource if the config changes are not enough, but you would need to be comfortable with editing in lua.

EDIT: There are settings in Missions.lua: EnableOptIn and EnableSafeHouseOptIn that will help demarcate mission players who want to play the missions from other players. Readme.md talks more about it too, as well as the other docs.

EDIT2: Merged a couple more changes into github from my local game mode dev branch, that I decided last minute to add. This adds a mission rejuvenation fee that acts as a $ penalty for when a mission player dies during a mission. Its turned on when MissionRejuvenationFee config var is > 0 , turned off by default. Im my game mode players compete for $ earned vs lost due to mission equipment costs and rejuvenation (respawn) costs.

Also a % chance per mission player death, that the mission contact will encourage/harrass the mission player when they respawn, when MissionRejuvenationSMS=true (turned off by default). There is SMS_RejuvenationSubjects and SMS_RejuvenationMessages that will randomly be selected.

Mission Blips have improved icons and titles as well.

virtually all config vars are in Missions.lua

What it looks like:

What the encouragement/harassment sms looks like:

Added some bug fixes and also added a cool new feature for transport, escort and similar missions, also proper help text now.

1 Like

Very good work, a great contribution to the community. I hope to see your work continues…

1 Like

Some more updates that were not too bothersome to add, (one which I wanted to add for some time)

  • Much improved Help Text.
  • Mission Reinforcement Drops (MRDs). This is something the player can drop/toggle anywhere on map where they are. This creates a marker as well as a blip on the map. After the player respawns, they can optionally fast travel to that location (with an optional $ fee). This will allow players get back into the mission quicker. This will support players in vehicles too.

EDIT: bug fixes & enhancements
GitHub updated.

Mission Reinforcement Drops how to use and what they are:

1 Like

Made an update to the readme.md on GitHub re: public servers (vs ‘local’/private servers), which is worth checking out if you want to run this on a public server.

For public servers, You will probably want to spawn mission entities near to the player triggering the mission, so having/setting MissionTriggerRadius < 300. Probably Mission20 & Mission21 (which spawns entities all across the map) and other missions with very large amounts of entities, or spawning entities well away from players, may not be ideal for a public server. I would tone those down if they are causing problems. You can also set IndoorsMission=true for a mission, even if it is outside, which will spawn entities dynamically near players (within IndoorsMissionSpawnRadius, which you can change in Missions.lua)

EDIT: Added 2 new missions, Mission43 and Mission44 which are helicopter versions of Mission25 and Mission28, which have planes.

EDIT2: Safe house mission peds will have anims and will occasionally talk, all configurable and can be turned on/off.

EDIT3: A few more tweaks and bug fixes, also a new video showing one of the new helicopter missions, Mission43 and showing how to get into the mission vehicle as a turret gunner or regular passenger in escort/transport/defend/rescue missions.

1 Like

You can now summon and dismiss AI teamates/allies for the mission, as well as select any number of AI types to spawn (default is 4), with various button/key combos (in-game help when a mission is active has the controls info).
Very configurable as well. AI will fight with player and follow them, including getting in vehicles, and picking most useful available seat based on vehicle (configurable). They will not earn money for players though.

I may release the AI allies as a separate resource to use or build from.

This is the last major feature I wanted to add to this resource , so besides patches for any game breaking bugs, this will be the last update planned. (famous last words :yum:)

2 Likes

I haven’t had time to check out recent updates but the AI backup looks just amazing!

This is such a phenomenal project you’ve built up. Thanks again!

1 Like

how to activate ESX money ?

Look for:
local UseESX=false
in client.lua and server.lua
and set it to true.

1 Like

its work fine very nice work

1 Like

its possible to reactivate de PED police and the wanted level ?

Thanks.

Yes, its possible, remove/comment out this code:

--remove wanted level
Citizen.CreateThread(function()

   for i = 1, 32 do
        Citizen.InvokeNative(0xDC0F817884CDD856, i, false)
    end
    while true do
        Citizen.Wait(0)
        if GetPlayerWantedLevel(PlayerId()) ~= 0 then
            ClearPlayerWantedLevel(PlayerId())
        end
    end
	
end)
1 Like

thank you very much for the quick response
this is very appreciated

I really like your script I am trying to implement it on my server
but I face a problem I explain to you

I use the ESX base so the player position save
when the player this connect your script tries to freeze it
and put it in a safehouse.
but the ESX base use leaves disconnection location of player but
however it is freeze well

so I deactivate this option
Config.TeleportToSafeHouseOnSpawn = false

which fixed my problem but
when the player is on a mission and dies he does not return anymore
in the safehouse he dies and respawn on the battlefield and looses a lot of money xD

do you have a solution or tip to help me with this problem?