Fivem Crackdown gamemode and mission generator/creator [BETA]
NEW THREAD HERE: [Release] 'Crackdown' Missions System v3 & GitHub for your own missions
With the latest builds on github.
This resource is primarily a competitive co-operative game mode where players take on missions together against enemy NPCs for $ (uses native money by default). It is standalone, but will also support ESX money system. You can also use this bare bones as a (side-)mission/quest system for an RP server, it is almost entirely configurable. There are (and you can configure/create) regular missions, which can be very specific, and randomly generated ones, as well as a hybrid of both. There are different types of missions:
- Capture the Objective(s), where capture points need to be secured to complete the mission.
- Assassinate, where all enemy NPCs needs to be eliminated to complete the mission
- Defend, where players need to defend a zone against invading enemy NPCs or lose the mission. The defend zone will show up as red area blip on the map.
- Defend Target, where players need to defend, escort, transport or rescue a friendly NPC target from being eliminated or lose the mission. The NPC will be a yellow blip.
- Hostage Rescue, where friendly NPCs need to be rescued to complete the mission. If any die, the mission fails
- Boss Rush, where all enemy “Boss” NPCs need to be eliminated to complete the mission
- Bounty Hunt, target NPCs or hostages can be spawned all across the map in foot and in vehicles each having a squad of bodyguards protecting them. The target NPCs need to be eliminated to complete the mission. Adding this attribute to a mission will also allow NPC squads to spawn on roofs, (and in the countryside better) rather than being forced onto roads or onto the ground level. Can be used with any mission type.
There are also friendly hostages (green blips) where players walk up to and they will get $ when rescued. Money is given for eliminating enemies, capturing objectives and rescuing the any friendly NPCs targets as well. It can be configured as well so players can opt-in or opt-out of missions.
New Features (in latest gitub version in first link above):
Capture the Objective mission from the random mission generator:
Elimination mission from the random mission generator, also shows hostage rescue:
(In both videos above I have the ‘SafeHouseCrackDownMode’ turned on for extra health and abilities)
RC Bandito remote detonation added as well in missions:
Ambient Peds can be made hostile for more challenge:
Test of the new objective/rescue/target marker system:
Players can toggle Night Vision and Thermal Vision easily if enabled for the mission:
Battles on Land, Air and Sea:
Safe House, for health, armor, upgrade and supplies
Mission Map for random generated mission shows all $ rewards/costs
Combat during random generated mission (I’m in invuln mode )
More Mission Combat. Add turret vehicles to missions, turrets get auto-populated
Capturing an objective randomly generated mission.
Mission6 ‘Escape from Los Santos’, custom props can be added to missions
Scoreboard (use button/key for phone)
RC Bandito entry notification:
RC Bandito remote detonation just before the player rejoins their player pawn:
Stats notification at the end of each mission:
Intro notification at the start of the mission:
pounder2 upgraded and weaponized:
default loadout at safehouses/crate drops and on mission completion now use more powerful ammo types to combat more powerful enemies. Safe houses/crate drops now cost more, $2000 each. Safehouse vehicles are free:
Default ‘Crackdown’ mode upgrade notification at a safe house.
Harder ‘Bosses’ that give more reward to take on like the Juggernaut:
Ambient Peds can be made hostile for more challenge:
Play in DLC Areas:
Testing the new markers:
Here is an example of the EnableSafehouseOptIn turned on, players will need to go to the safehouse marker and press a button/key to participate. They will remain in the marker to receive supplies/upgrades if they so wish. This is more suited to public and RP servers where players can opt-in/opt-out of participating in missions:
The default game mode has ‘safe houses’, where all players travel/teleport to when they spawn/respawn and also at the start of every new mission. This is where they will receive equipment, upgrades and vehicles to optionally use for the mission, at a $ cost. The players will get super run, super jump, super swim and 5000 health when upgrade at a safe house, which is why I decided to call it Crackdown. A player can claim (buy for $) up to 2 vehicles per mission at a ‘safe house’ as well, and cannot drive another player’s claimed vehicle, but can ride as passenger in other players claimed vehicles.There are 20 missions in total of various kinds. I have not thoroughly play-tested balance, but everything is configurable (see below).
NOTE: Primary Gamemode now uses Safe House crate drops as as well as safe houses, with teleportation/travel being disabled on new mission start (it can be turned back on via missions.lua), but players will spawn/respawn at the safe house if they are enabled. Players can press (DPAD LEFT & RB) of their gamepad or Q key & SCROLLWHEEL UP together, to call in an air drop of weapons and upgrades for a $ cost. Crate drops perform the same function as Safe Houses, but may cost more (or less). (All credit to Vechro whose crate drop script I used and adapted, see credits below)
Players will be rewarded weapons/ammo and health/armor at mission completion if they did something during the mission, like kill an enemy, capture an objective, rescue a hostage.
There is also a basic scoreboard showing all players total $ earned for the missions, as well as $ earned per mission, which you bring up with the phone button (DPAD UP on gamepad)… The concept is that $ represents the score and players will need to strategically weigh what they buy vs what they earn. Players who survive and participate in missions will not need the safe house either.
Players can toggle night vision and thermal vision if enabled. Player will press and hold both Left stick down + right stick down ( C + Left Ctrl by default) (CROUCH/STEALTH + BEHIND VIEW) to toggle
There is a working RC Bandito remote detonation vehicle as well to use on missions. Use LB on the gamepad, or E key to detonate it.
Players can spawn/deploy rcbandito remote detonate vehicles on the fly using RB+DPAD-Right or A + D keys
Everything is pretty much changeable either globally or per mission in missions.lua, so you can remove/change safe houses, change money rewards, change NPC types/weapons, change/remove the Crackdown-esque super buffs, etc… etc… as well as make the gameplay more Arma-esque. It can be made to work as a side mission resource for an RP server say, rather than a game mode in and of itself.
Random Mission Generator and Mission Creation
The missions.lua file is where virtually everything is configured. I have a well commented guide here
detailing how to use the missions.lua to change game mode settings, change random mission generator settings and create your own missions. https://pastebin.com/QaRP4W9J
See also Config_Guide.lua.txt which is a copy of the guide inside the resource
Looking at the resource’s missions.lua file will help when looking at that the comments in that guide.
Also see here for a review of the features of list of default example missions to create your own: [RELEASE] FiveM Crackdown game mode and mission generator/creation [BETA]
Mission12,Mission17, Mission18, Mission19 and Mission20 all use the resource’s random mission generator where you provide parameters to and it will generate random missions anywhere on the map, or at defined locations you provide it. See paste link above.
There are ‘regular’ missions as well where you can define exactly where each NPC/vehicle goes, where each prop goes, what each NPC’s behavior is etc… for more defined missions, See paste link above. All the other Missions in the resource are of this type.
There is a lot of potential I think in creating your own unique missions, using the random mission generator or not. random mission generator missions where you change parameters
mrp-missions-3.1.2.zip (326.2 KB)
Like any other resource, put the mrp-missions-v3 folder in the server’s resources folder (you can name the resource to something a lot shorter too). In server.cfg add a line: start mrp-missions-v3 and it should auto-start a mission where the players get taken to the safehouse to start the mission.
Optionally do the same for the mrp-missions_spawn resource, which will give you the blackops/swat skins which the main resource will use. This is not required though.
‘missions.lua’ has 20 example missions of various types.
‘missions_random.lua’ has 3 randomly generated missions that can be used as is. Re-name to missions.lua to use.
‘shadowstate-missionpack.zip’ has everything needed to play a properly developed campaign of 12 missions. Its a mission pack called ‘Shadow State’ and uses various DLC content (included in the zip file).
In the chat you can use “/stop” to stop missions running. “/list” to list all available mission names. Then “/mission ‘MissionName’” to start the mission. NOTE: These commands can be run by any player, so you need to provide your own security/permissions. Again, you can configure the resource to not teleport players to the safe house on mission start, turn crate drops on/off etc… (see paste link above)
Players can create a ballot to cancel the the current mission using “/votefinish”. Players can then vote using /voteyes and /voteno See the bottom of server.lua to configure voting settings, if you run a public server you will need to configure it. (All credit to FAXES for his Vote-to-Kick voting system which I used and adapted, see credits below.)
You can also create a vote to cancel a mission to start a new one.
If you are on mission 12 and want to create a ballot for Mission9, you can type in chat:
‘/votefinish Mission9’ or just use ‘/votefinish’ to create a ballot to cancel the mission.
By default, the server will wait 10 seconds before starting a new mission if the vote passes.
For ESX money support, in client.lua and server.lua set UseESX=true
There is a missions_random.lua in the zip. Swap that in for missions.lua and the resource will play only random mission generator missions if the old regular missions get boring. Which I prefer the most at the moment, since replaying regular missions over and over can get boring.
Additionally, To increase difficulty for missions (for more players or more challenge) consider increasing SetPedMinAccuracy/SetPedMaxAccuracy first in missions.lua from 60 (default) to around 100 max
To help with mission creation, the archive contains a resource called plotcoords. It will allow you to use the phone button to save the current player’s location to a file called positions.txt in the ‘plotcoods’ folder. Also, it will record the heading that the camera has as well, which I found easier than the player’s heading. These can be used to create NPC positions, and other positions etc… for the missions.lua file
mrp-utils.zip (3.7 KB)
This was built primarily for my local lan and server, where there is coordination between players and low player count. sixsens has been testing it for side missions on his online 24/7 server and has found it to be stable with larger player numbers. For him there is an issue where NPC blips only will get seen by non-host clients when they are within 300m - 500m of the mission/ NPCs, which is around collision range for the game. For my testing with 2 clients on my LAN, both can see all NPC blips from across the map. The host player (client who spawned the mission), is important. If they disconnect, according to sixsens, migration may not be handled properly all the time, so NPCs can disappear etc…, sometimes NPCs will stop during their assign tasks etc… The resource on the server side endeavors to find the current host and uses them to spawn the missions.
Making the code support migration when a host leaves may help with host disconnects better. There is a voting system in the resource to allow missions to be bypasses and started with a a new host.
Normal pickups can be generated on the ground besides NPC ped weapon drops (which can be disabled) and there can be some sync issues there, and is disabled by default. Use safe houses or turn on the option to give players weapons directly.
There is a mission ‘space time’ between missions, default is 30 seconds, where the server will wait that long before contacting the host player machine to spawn the next mission. Using /stop command etc… during then can cause some errors sometimes, and the resource may need to be restarted for clients, so wait until a mission has started before stopping the mission system, do not do it in the space time. There is probably a lot more jankiness as well, but seems stable enough to share as alpha early/beta.
It may not act nice with other resources not sure, not tested with others so you may need to edit this resource in certain ways, but the missions.lua is very configurable and should help.
vMenu for instance will do a ped replace by default which will cause the player ped to lose its scores and mission stats, so if you are playing for scores, disable vMenu. Saying that, there is a bug for the host when certain NPCs will ‘die’, the host player will be/can be sourced as the cause, due to some script/code running outside of my resource. I have not determed the cause, it seems to be something in the core FiveM code that it doing it
[The below issue has a workaround where the resource now shares mission money with all players or mission participants by default, which can be turned off, if so, follow this:]
If you are seriously giving money via ESX with this mission system, 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. So a player can be penalized or rewarded, who spawned the ped. So turn off kill penalties too in missions.lua. Here are the details:
Any help would be appreciated. I may need to take another look at the cause. The final problem worth mentioning, is for randomly generated missions, sometimes all the spawn checking will not work, like 1 in a 1000 it will not, so a ped may spawn somewhere inaccessible. So Assassinate missions may not be completeable once a great while for instance, so a vote or otherwise will be need to bypass the mission. I may revisit this to see if it is fixable, as it is possible it is due to “holes” in the map, in which case it may not be.
Here are some tips on changing the resource so that enemy mission NPCs will only attack players involved in the missions, not all players they see:
Here are some tips on changing the resource so that only players playing as policemen can take missions:
Use ‘/votefinish missionname’ or wait for the server to start the next mission, rather than ‘/mission missioname’ if you are not sure who the host is. The most powerful PC should join the server first, to make usre they are the host, in that case using ‘/mission missioname’ is more recommended for the host machine.
I do not plan to support this resource, since I will not have the time, but I will try and help others when I can. Use at your own risk. You are welcome to edit/change and develop the resource for your own purposes. The code is scruffy and needs some tidy up. If you do change it or use it for something else, give credit to LanceGood, like I did, its his own idea which I branched from and developed while I had the time, as well as to myself.
This is a branch of LanceGood’s Arma III missions resource, and retains his core concepts and code, so full credit to him. [Release] [ALPHA] "Arma III" Styled Missions He influenced me to work on this.
sixsens for extensive playtesting and feedback to get it more stable. He is using it for side missions on his RP server. Many others on this forum and GTA V modding community in general, which I learned from and took code they shared.
Loque for his help and guidance in allowing me to get some of the most important features in.
Vespura for sharing code on how to clean up vehicle generators
FAXES for his resource: [Release] Vote-to-Kick - Vote Players Out! [Fax-Vote2Kick] [1.0] which I used for my voting system.
Vechro for this Crate Drop resource [Release] Crate Drop which I used for my safe house crate drops.
VenomXL For his SMS wrapper: https://github.com/VenomXNL/XNL-FiveM-Trains-U3/blob/master/XNL-FiveM-Trains-U3/client.lua
illusivee for this Scaleform Wrapper: Scaleform Wrapper - Use scaleforms neater and simpler!