[RELEASE] FiveM Crackdown game mode and mission generator/creation [BETA]

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.

Description
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.

Gameplay videos/footage:

New Features (in latest gitub version in first link above):

New features:

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:

Enemy Paradrops:

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:

Screenshots:

Screenshots

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 :slight_smile: )

Hostage rescue


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:

bruiser upgraded:

dominator upgraded:

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:

Primary Gamemode
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. :slight_smile: 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

Completely Configurable
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

Installation/Usage
Download:
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

Other resources
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)

Known Issues
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

Also:
[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:

Tips
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.

Support
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.

Credits
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!

39 Likes

Nice release, a lot of work and good ideas
Thanks :wink:

3 Likes

First of all wow you did a good job to add a lot of useful info to the OP This is going to be so fun to play and me and my friends is installing it now on a dev server to test out thanks a lot m8

1 Like

Thanks guys. Hope you enjoy and it is not too buggy for you. :slight_smile:

3 Likes

congratz my dude.

Your baby seem to walk is way…
5 stars Release.

1 Like

Thanks man for all the testing and feedback. :slight_smile:

1 Like

Aren’t the downloads suppose to be direct or GitHub? I would also prefer them to be direct, considering it’s size after all. Other than that, love it <3

2 Likes

Updated to 2.9.6g.

mrp-missions-2.9.6g.zip (142.1 KB)

Bug fixes and tweaks:
–Player retains $ and mission stats properly on respawn now (disconnect/reconnect persistence is not supported atm).
–Hopefully stops most of the spammy chat messages on mission end
–Defend type missions now will timeout properly.
–tweaks to missions.lua for some missions, also nerfing enemies in Mission13 & Mission15 a bit to give them more chance of completion.
.

You are right RageYT, its easier to just drap and drop here.

Thank you <3

the fuck?

you do know spawnmanager has an API and you don’t have to edit away the existing map resources but can make your own right?

other than that, cool! been a while since someone released decent AI bits.

Im relatively new to fivem, so no, but I figured there was probably a much easier way.

fivem.net’s reference wiki is not fully up https://docs.fivem.net/resources/spawnmanager/

I guess there was an old wiki but webarchive does not have those pages saved either.

1 Like

seem ok with last built.
cheers

But when mission end… only bottom message appear… no more message end in chat.

1 Like

thats a trade off right now with the current build.

1 Like

Fantastic release, thanks so much! As stated above, fun coop / PvE resources using AI are hard to pull off and hard to come by around here. There’s also so much potential for expansion if others add and share missions. Great work.

2 Likes

Cheers Loque. I just remembered to add you to the credits as well.
Thank you for all the information and guidance.
Yeah, it would be great to have people share missions.

1 Like

updated to 2.9.6k

mrp-missions-2.9.6k.zip (144.3 KB)

Fixes:
–When random progression through the missions is enabled… (Config.RandomMissions = true), the mission just played will not have a chance of being respawned again.
–Mission14 was changed to have the safehouse spawn right at where the mission starts now, should be more intense.

Adds:
–optionally use blackops/swat skins that the main resource uses by adding mrp-missions_spawn resource as well in the archive.
–Support for red dead desert map: fivem version:


Uncomment Mission21 in missions.lua and random missions and safe house will spawn on that island map for Mission21

island location:

EDIT: Updated to 2.9.6j.
Made some tweaks to Mission21

EDIT2: Updated to 2.9.6k,

made it ~ 100 NPC spawns and 12 npc vehicle spawns. for Mission19. Also increased Mission21 NPC population.

1 Like

updated to 2.9.6m:
mrp-missions-2.9.6m.zip (144.5 KB)

Re-added NPCs use cover combat attribute which somehow got removed.

Does any know how to make an NPC Ped shoot out of a passenger seat at players? I cannot seem to find a way to get them to do it. Tried tasks, combat attributes etc… also I dont want to use the driveby task functions… it needs to be more generic… as a behavior rather than specifying a target ped.

Updated to 2.9.6n
’
mrp-missions-2.9.6n.zip (144.6 KB)

–Big improvement with random mission generator spawns, the random mission generator will try harder to make sure as many vehicles and NPCs get spawned as possible based on the settings. So you should see an increase in vehicles now, like for Mission19. Aircraft should spawn somewhat better now too. Together with the NPCs using cover again, Mission19 etc… should provide even more challenge. I am iterating up to 250 times per spawn if needed to search for a good location to have vehicles and npcs spawn. Let me know if this causes any weird behavior, I can lower it.
–When using a safe house the maximum amount of claimable vehicles for the mission information is given as well.

finally worked out what was going on with npcs not shooting out of vehicles. Had to give them the proper weapon (along with the proper combat attributes).
Updated to 2.9.6p
mrp-missions-2.9.6p.zip (144.8 KB)

–added for random mission generator: Config.RandomMissionVehicleWeapons where you can add specific driver and passenger ped weapons like micro-smgs they can use in-vehicle. Drivebys can now be added to missions. NOTE: Use Config.VehicleTurretSeatIds to define which vehicles get passengers (does not need to be a turret seatid). These passengers also get the driver’s weapon and can use the weapon. Works for regular missions as well, or use ExtraPeds attribute for the vehicle for regular missions.
–Misson10, Mission14, Mission15 changed to support the new feature.
–Mission5,Mission4 I use the conqueror=true attribute on the driver now rather than flee=true, which makes the driver basically neutral and they will just drive away (same effect). flee=true may not act how you want it to.

updated the config settings link as well to reflect this.

2 Likes

uggh… had to make another update to make sure passengers were getting the proper weapon in random missions, fixed now:
Updated to 2.9.6q
mrp-missions-2.9.6q.zip (144.8 KB)

This version also has the proper update for the random mission generator enhancement mentioned above. :stuck_out_tongue:

weapons to add to Config.RandomMissionVehicleWeapons would be any single handed weapons like a micro smg etc…that can be used by peds in drive bys

2 Likes