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

You will need to add that manually. Look for the RegisterCommand lines in client.lua, you can add any code to restrict to admins there.

Updated to 2.9.9f.
mrp-missions-2.9.9f.zip (334.6 KB)
–Fixed various bugs,
–made target NPC blips to be purple
–included any “boss” bonus $ to the blip info.
–Also added something I wanted to add for a while. Its a new random mission type that is called “Bounty Hunt” that will span across the whole map. Mission21 in missions.lua and Mission4 in missions_random.lua are both Bounty Hunt missions.

The Bounty Hunt missions are the largest in scope and can have 150+ enemy NPCs across the map to fight. Various NPC target peds will spawn randomly across the map on foot or in a vehicle (including on water in boats, which can be turned off) and will have a squad of guards spawned in around them as well. The objective is to take out all the targets to end the mission. Players will often need to utilize air land and sea vehicles from the mission safehouse to complete.
Example mission map:

I noticed that fivem/gtao does not like it when NPC count reaches around 100 within collision range. So this should allow bigger numbers since the NPCs are spread across the map. If you have problems, you can adjust the the squad sizes and the amount of targets peds as well (that will each spawn a squad).

The codebase needed to be tidied up a long time ago, and this included some hacky-ish code, but it should work fine.

There are a few new config settings that are in the txt file in the resource, as well as all the missions*.lua files, just seach on “IsBountyHunt”.

2 Likes

Another update.
mrp-missions-2.9.9g.zip (337.9 KB)

Fixed finally the capture the objective object spawning anywhere on the map properly for random missions, which is Mission23). Other bug fixes and enhancements as well. Toned down the bounty hunt mission numbers… clients will desync if ped number starts approaching 100.

Allowed IsBountyHunt=true to be used by any random mission type (primarily for how it spawns peds different from the default method used by the resource).
See the new missions: Missions 21 -> 24 in missions.lua. (they are also in missions_random.lua , missions 4->7)

Mission21 is default bounty hunt, locate targets around the map. Mission22 has hostages around the map to be located that have guards. Mission 23 is a huge capture the objective mission, and Mission24 is a large warfare mission where targets need to be taken out for the mission to complete. They all random missions that can spawn across the map.

By default, in fully random missions, peds will try and spawn at the lowest flat surface rather than roofs, so typically only on roads or real ground level around a building/hi rise.
The squads with IsBountyHunt=true will spawn at the first flat surface (GroundZ)… so roofs as well. I found it was hard to get peds to spawn properly always around Mt Chiliad and other similar areas, by the default method,
and they would spawn under the map frequently, showing up at the nearest road.
Spawning with squads this way may be better suited for more natural areas. Also, if water is detected, a boat or amphibian vehicle will spawn with a squad of npcs in it as part of the mission,

So there a lot more options now.

Updated the resource’s config txt guide as well.

NOTE: These missions are designed to be used in the Buffed/upgraded mode provided by the resource. Playing them as normal GTA 5 player will be way too hard. You can create your own missions, or tone down the default missions considerably by editing the settings in missions*.lua files to fit normal GTA play.

1 Like

another update:
–Tweaked Bounty Hunt missions.
–New setting in missions.lua: MissionShareMoney = true/false

When true, all players that are in the mission will share the money earned (and any money lost through penalties) equally, rather than each player earning for themselves. Meant to be used with either EnableOptIn/EnableSafeHouseOptIn = true, else proceeds will be divided amongst all players on the server.

mrp-missions-2.9.9h.zip (338.9 KB)

Note: This mod is not compatible with vmenu, if you want to more accurately keep track of money earned by players in this mod, due to how respawning works with vmemu, which clashes.

1 Like

updated to 2.9.9i
–Fix and enhancement:
Hostages that are rescued will have their green markers disappear for non-hosts as well.
Hostages that are rescued will no longer have green blips show up on the map, so no longer confusing who needs to be rescued.

The random mission bounty hunt tweak in 2.9.9h works like Hostage Rescue and Boss Rush in that a mission important NPC is placed at the mission “epicenter” blip. Going to the epicenter will trigger a random event, aircraft, squad, paradrop or vehicle spawning nearby.

mrp-missions-2.9.9i.zip (338.9 KB)

2 Likes

and another update…
mrp-missions-2.9.9j.zip (340.2 KB)
Added night vision and thermal vision options for missions. Enabled by default in missions.lua
–Player will press and hold both Left stick down + right stick down ( C + Left Ctrl by default) (CROUCH/STEALTH + BEHIND VIEW) to toggle
In missions.lua:
Config.EnableNightVision=true
Config.EnableThermalVision=true
Also tweaked the IsDefendTarget peds and nerfed the old UFO mission, no more railguns.

1 Like

Very Cool!

Is it Possible to get that on an RP Server but only let the Police make those Missions?

Hi. Yeah its extremely configurable and can be tailored for an RP server.

As far as limiting it to cops can only take missions, that would require you to change some of the code. You can check out the “…Optin” settings in the missions.lua where you can have it that only players that opt-in to the mission can take it, and then from there in the client.lua look for where those values are used as well as mrpoptin/mrpoptout decor values. Basically when an …Optin value is used, the decor values determine who is in the mission or not. I would imagine that you would need to check for player police skins as well in your case.

I actually have a massive update coming out in the next few days, which I would wait for, it has a load more improvements.

OK thank you very much. I will wait for zhe Update
:grin: :+1:

Hi there, Is there anyway to set it up so mission has to be start by player rather and so there isn’t annoying random tank driving around or people being randomly attack that aren’t apart of the mission? thanks

In my next update, missions will only start when a player comes near to where the mission should be triggered, which will help. My reply to Timon will partly help you as well, use the optin/optout options, then I would look at the events/functions ‘SpawnPed’, ‘SpawnRandomPed’, ‘SpawnAPed’ and ‘PutPedsIntoTurrets’, I would also check other parts of the script too to be sure.
I would add a new relationship group for players who are opted in. And in the above functions have the NPCs hate that group rather than players default group. When player opt out of missions, remove the relationship group from them.

1 Like

Thanks beside that 10/10 for script :slight_smile:

1 Like

HUGE update to version v3.

mrp-missions-3.0.0.zip (363.0 KB)

–Features:

-Many enhancements including, greatly improved AI
-IsDefend/IsDefendTarget missions greatly enhanced. Proper escort and transport missions now. Including randomized missions of this type as well.
-Missions now are able to be triggered only when mission players are near to the mission start location.
–33 missions in total, including Shadow State Mission Pack missions added that do not require DLC. New missions as well as older missions have enhancements.
–Much more variety and scope to create your own more complex missions, like settings to strip players of weapons at mission start so they obtain mission weapons etc…

Recommend playing this in it’s default settings locally or whatever first, to a get a grasp of the features, which every one of the 33 missions will highlight, since all the missions are tailored for those settings. The resource is highly configurable to play to on RP or other types of servers. Mission building for balance is an art in itself and can take time, so some of the missions may be better suited as examples of what can be achieved.

By default, now mission players will share mission money, penalties get incurred when they need to re-buy mission equipment/upgrades, or whatever penalties the server incurs on death.

credits to:
@IceHax, for sharing code on the forums which got me to see how important spawning on path nodes are to get NPC vehicles to work when spawned long distance away.
@TheIndra for sharing code on the forums re: Task Sequences. Sequences are so cool.
@Lyrad for sharing code on the forums re: keeping peds in the passenger seat

Enjoy! Merry Christmas :santa:

4 Likes

tidyup update for v3.0.0
mrp-missions-3.0.1.zip (364.8 KB)
Mission14 improved (target to defend does not move at max speed anymore), so enemies now have a chance to catch up with them. Mission24 and Mission27 improved as well. Added new config variable in client.lua for this that I forgot to add. New mission 34.
Updated config guide as well.

and another tidyup update, this should be the last one.
big bug fix for IsDefendTarget escort/defend/transport missions for enemy AI in ground vehicles and boats. Driver peds were not attacking correctly.
Other minor enhancements that I missed with some missions.
mrp-missions-3.0.2.zip (365.5 KB)

NOTE: To complete the ‘Killing Floor’ mission at Humane Labs, you will need to have a teleport resource enabled to allow players to go up and down between the 2 levels (or add submergibles or water breathers to come through the tunnel.) . The “doombunkers” resource included in the Shadow State Mission Pack archive in the zip file will do that.

EDIT: For Mission25, make IsDefendTargetGoalDistance=100.0, instead of 50.0, for the plane to have more chance of arriving at the goal. Saying that, eliminating all the enemies will complete the mission as well (but w.o. the goal bonus), which can be more challenge if the plane is circling around the goal.
Mission23 especially and Mission20 & Mission21 use a lot of new skins, some which can ocassionally be invisible in-game, they can be removed in missions.lua, not sure which new skins though.
v3.03 includes the Misison25 change:
mrp-missions-3.0.3.zip (365.6 KB)

1 Like

update to 3.0.4:
mrp-missions-3.0.4.zip (365.6 KB)

Fixes a bug introduced that caused rescued hostages to receive red enemy blips.

update to 3.0.5, another bug fix:
mrp-missions-3.0.5.zip (365.7 KB)

Hostage count updates properly now for Mission21. Also Mission25 updated to spawn enemy planes again which were taken out due to debugging that was left in.

another post-v3 release update. Some code for Mission4 was commented out during debugging, this puts it back in to highlight a new feature in v3, where you can have vehicles follow other vehicles or peds easily via a simple config setting for the mission config… Mission4 is proper now
mrp-missions-3.0.6.zip (365.7 KB)

1 Like

Ack, found another newly added mission, Mission15 had some commented out code for debugging I forgot to put back in. Thats fixed now.

Just reviewed everything, that should be it. Also improved the README.txt. It now details each of the 34 mission features, to help build your own missions.

mrp-missions-3.0.7.zip (374.0 KB)

EDIT: updated to 3.0.8, small update to client.lua:
mrp-missions-3.0.8.zip (374.0 KB)

EDIT2: updated to 3.0.9. Changed controls for deploying air drop supply, since this interfered with other in-game controls.
mrp-missions-3.0.9.zip (375.2 KB)

CONTROLS (which can be turned on/off depending on mission config settings):

Players can press (DPAD LEFT & RB) of their gamepad or Q key & SCROLLWHEEL UP together, to call in an air drop of mission weapons and upgrades for a $ cost. If they dont want to make it to the safe house.
The safe house has to be open for this work.

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. This will use one of their safe house vehicles for the mission though, will cost same $ amount
as a safehouse vehicle, and players will need to wait until the safehouse is open to be able to deploy.

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) to cycle through.

If EnableOptIn or EnableSafeHouseOptIn is turned on:
Players press ‘Q’ and ‘]’ keys or RB + DPAD UP together to join an active mission. (with EnableSafeHouseOptIn player has to be
at the safehouse marker.)
Players Press RB + DPAD DOWN or ‘Q’ and ‘[’ keys together to stop particpating in missions, only after a mission is over and
another has not started.

Mission comments for building your own missions:
Mission1 is a standard 1 Objective mission, that also has events added.
Mission2 is a HostageRescue mission that also has an event with a custom notify message
Mission3 is an Assassinate mission that has a vehicle following/chasing another vehicle,
this one stationary.
Mission4 is an Assassinate mission that has a vehicle following/chasing another vehicle
that is moving.
Mission5 is an Assassinate mission that also has a friendly to rescue
Mission6 is a multi-objective mission that has 3 objectives to capture and 1 hostage to
(optionally) rescue. It also has custom props added, and events, one which will spawn a
random enemy vehicle, another random enemy peds.
Mission7 is a standard 1 Objective mission, that also has an event with a custom notify message
and custom props.
Mission8 is a standard 1 Objective mission, that also has events, custom props and a vehicle
chasing/following another vehicle, this one stationary.
Mission9 is a standard 1 Objective mission, that also has events and custom props, and a vehicle
chasing/following another vehicle, this one stationary.
Mission10 is an Assassinate + IsDefend mission where players have to stop enemies making it to a zone they must
defend. It has a custom mission start point, and a few custom safehouse options which alter the
default safe house behaviour.
Mission11 is a standard 1 Objective mission, that has custom reward pickups defined for mission completion.
Mission12 is a randomly generated mission (IsRandom) that is a standard 1 objective mission that uses RandomMissionPositions array to spawn a mission.

Mission13 is an Assassinate + IsDefend + IsDefendTarget mission that has players defending a target on foot. It has SetBlockingOfNonTemporaryEvents attribute set to true for 1/2 the enemies. All enemies will chase the
target due to IsDefendTargetChase=true, and the ones with SetBlockingOfNonTemporaryEvents=true, will attack
the target when within 10m of them, due to IsDefendTargetAttackDistance = 10.0. Also other settings as well,
like removing all weapons from mission players at mission start, and a custom mission start point, etc…
Also, custom movespeed attribute is set 1.0 for walking, 2.0 for running for NPCs
IsDefendTargetEntity defined the target ped. Blip2 and Blip are at the same, since target ped is stationary,
and has IsDefendTargetSetBlockingOfNonTemporaryEvents=true set to true, so they dont run off.

Mission14 is an Assassinate + IsDefend + IsDefendTarget mission, similar to Mission13, but for vehicles. The target ped to defend is in
a vehicle. Of note: IsVehicleDefendTargetChase=true makes enemy NPCs in vehicles chase the target. IsDefendTargetEntity defines the target NPC and vehicle, and they have movetocoord set to make them drive at a movespeed rate.
Blip2 is where the target spawns, but you can also use SpawnAt={x=…,y=…,z=…} inside IsDefendTargetEntity to
have the target + vehicle spawn at a custom position. Blip is the destination, where their movetocoord points to, and since IsDefendTargetRewardBlip = true, a marker with IsDefendTargetGoalDistance radius, and money reward of
GoalReachedReward = 1000 if the target makes it there, to complete the mission.
The mission can also be completed if all enemies are eliminated, like any other IsDefend/IsDefendTarget mission.
IsDefendTargetDoPlaneMission=true, makes planes AI slightly different than if it is false, worth experimenting with,
may not make a difference.
It also has custom safe house mission vehicles spawn in the mission’s Vehicles array. These must come after any enemy
NPC vehicles, and not have id2 attribute defined.

Mission15 is basically the same as Mission14, except there is no destination (So Blip and Blip2 are the same), the
target to defend (IsDefendTargetEntity) has driving=true which basically makes them wander, or drive from the enemy NPCs.
IsDefendTargetRescue = true in this case so the target can be rescued to complete the mission without killing all the enemy NPCs.
It also has npcs with conqueror=true, which is basically the same as having SetBlockingOfNonTemporaryEvents=true

Mission16 Assassinate + IsDefend mission, where players have to defend a zone from enemy incursion. This highlights how you
can define each specific vehicle driver to follow/escort/defend another vehicle, with via attributes like:
VehicleGotoMissionTarget=true,VehicleGotoMissionTargetVehicle=2
where the 2 is the vehicle index of a vehicle that is defined BEFORE the vehicle with the attributes.
It also has a mission defined VehicleGotoMissionTargetVehicle=9, which is the default mission vehicle id to follow.
See the bombushka, which just has VehicleGotoMissionTarget=true set. If no VehicleGotoMissionTarget attribute is set,
the vehicle will do default behavior.
This mission also has a event, with the attributes, that spawns a vehicle:
DoIsDefendBehavior=true, <-- Tells the vehicle driver spawned to act like other AI driver in an IsDefend/IsDefendTarget mission.
IsDefendTargetTriggersEvent = true, <-- this event can be triggered by an IsDefendTarget ped (none in Mission16)
There is also DoBlockingOfNonTemporaryEvents=true, which is the same as setting SetBlockingOfNonTemporaryEvents=true for the ped

Mission17 is a HostageRescue IsRandom + IsRandomSpawnAnywhere randomly generated mission. See RandomMissionTypes attribute.
It means that it will spawn a mission anywhere within IsRandomSpawnAnywhereCoordRange. Since RandomMissionDoLandBattle is true,
it will only spawn ped/vehicles on land. IsRandomEvent=true, means that a single random event will spawn when players get close
enough. RandomMissionGuardAircraft=true, means that a random, aircraft will spawn that will guard the mission object blip area.
There are a lot of other random mission settings as well. See missions.lua and Config_Guide.lua.txt for more information.

Mission18 is basically the same as Mission17, except RandomMissionTypes ={“BossRush”}, where Boss peds that are tougher are made
the targets to eliminate to complete the mission.

Mission19, is the same as Mission13, except randomly generated: IsRandom=true and RandomMissionTypes ={“Assassinate”}.
RandomMissionPositions is defined on Mission19 at a specific location.
IsDefendTargetOnlyPlayersDamagePeds=false, overrides the default whereby enemy NPCs are only damage by peds, since the
target to defend will be fighting back this time. There are a lot more mission specific overrides set as well.

Mission20 is similar in many ways to random missions 17 and 18, except IsBountyHunt=true. Since RandomMissionTypes ={“Assassinate”},
it will spawn targets to eliminate via RandomMissionMinPedSpawns… etc…, but since IsBountyHunt=true, it will spawn squads or
protectors and at least one other target to eliminate with each main ped/vehicle. See the other Bounty attributes
which define squad size and range etc… also missions.lua and Config_Guide.lua.txt for more information.
NOTE, RandomMissionSpawnRadius = 6000.0, So it will spawn groups of peds/vehicles around the map.
Also, IsBountyHuntDoBoats=true, which means if water is found when spawn a vehicle, spawn a boat.

NOTE: Missions 17 + 18 spawn in a way not to spawn on rooftops, via ray tracing, but doesnt always work great around mountains, where
you can get peds in the air sometimes or under the map, until they become aware of the players.
Mission20 spawning with squads, I find works great around mountains, and if you want to spawn on rooftops more, use that in cities
as well.

Mission21 is pretty much the same as Mission20, except rescuing hostages, RandomMissionTypes ={“HostageRescue”}, where squads are defending the hostages.

Mission22 is in some ways the same as Mission12, a randomly generated 1 Objective mission, RandomMissionTypes ={“Objective”},
except, IsRandomSpawnAnywhere=true, so spawns anywhere on the map and IsBountyHunt=true, so squads of peds will spawn around default
defined peds in a way, similar to Mission20 and Mission21, except the RandomMissionSpawnRadius = 250.0, is much smaller and localized.

Mission23 is the same as Mission22, except RandomMissionTypes ={“Assassinate”}, where targets peds to eliminate are spawned, with
regular squads of body guards.

Mission24 is a random mission version of Mission14. Since IsRandom=true, we use
IsDefendTargetSetBlockingOfNonTemporaryEvents=true, to make the target ped driver to stick to the task. It uses similar attributes as Mission14, except IsVehicleDefendTargetGotoGoal=true, is set as well.
IsVehicleDefendTargetGotoGoal=true, makes the target ped drive/fly to one of the
RandomMissionDestinations randomly chosen.
Blip2 gets set to RandomMissionPositions[N].Postion, the start, where the target ped starts.
Enemies spawn around RandomMissionDestinations[M].x etc… by default.

Also, RandomMissionPositions also has
DefendTargetInVehicle = true,
DefendTargetVehicleMoveSpeedRatio = 0.5, --have vehicle move at 1/2 top speed

telling the mission system to set the target ped to drive a land vehicle, defined in
IsDefendTargetRandomVehicles array, at 1/2 top speed.

Mission25 is the same as Mission24, except for aircraft, where in
RandomMissionPositions:
DefendTargetInVehicle = true,
DefendTargetVehicleIsAircraft=true,

and an aircraft is randomly chosen from IsDefendTargetRandomAircraft array

Mission26 is the same as Mission26, exept we have in
RandomMissionPositions:
DefendTargetInVehicle = true,
DefendTargetVehicleIsBoat=true,

and a boat is randomly chosen fromIsDefendTargetRandomBoat array

Mission27 is the same as Mission24, except IsDefendTargetPassenger=true. So the target ped to defend
is a passenger that the player must drive to the destination. Default seatid is 0 for target passenger.
This can be overidden by using IsDefendTargetPassengerSeatId to define what seat id to go in.

Mission28 is the same as Mission25, except the player ped must fly the target to the destination, since
IsDefendTargetPassenger=true

Mission29 is the same as Mission26, except the player ped must drive/sail the target to the destination, since
IsDefendTargetPassenger=true

NOTE: RandomMissionDestinations in this case has a SpawnAt={x=…,y=…,z=…} attribute which will force the
random enemies to spawn around a different location instead of at the destination location (default)

Mission30 is a multi-objective mission, but with IndoorsMission = true, This means that ped and vehicles will
only spawn when a player is nearby. This was needed to be added for places like Humane Labs and DLC indoor areas,
where NPC skins would be invisble otherwise for some reason(?). SafeHouseSniperExplosiveRoundsGiven is set to 0,
which is a way to nerf exposive round amounts= given at the safe house, for the heavy sniper rifle, this case 0.
Events are used as well.

Mission31 is a Multi-objective mission that has a lot of events.

Mission32 is a Multi-objective mission with 1 objective, with a lot of events. Also a lot of custom safe house settings,
to teleport mission players into the bank vault, so they can fight their way out. A large custom prop as objective too.

Mission33 is a standard 1 objective mission with a lot of events, and custom props.

Mission34 is a version of Mission24, except similar to Mission15, in that there is no destination, the target to defend
drives and wanders, or evades enemies, which you must eliminate to save the target.

Mission39 is an example of a mission that uses Blips array to have multi objective mission blips

Mission42 is an example of the use of NextMission and NextMissionIfFailed mission attributes to combine missions into
stages, where if a mission is passed the next is loaded right away, else if failed, you need to restart the mission.
This can be done to create campaigns/multi stage missions that join together.

2 Likes

Another big update, which will most likely be the final one.
I will probably throw this up on github and announce in separate thread, with some guidance for people to incorporate into their own server with whatever changes.
mrp-missions-3.1.2.zip (326.2 KB)
Some of the new features:

Credits to VenomXNL and illusivee which I credited and link to their work in the OP as well.

Improved GUI:
-Mission Stats only show now when pressing DPAD DOWN or ‘[’ key
-Missions get received via notifications, credits to VenomXNL for his SMS_Message wrapper. Up to 3 SMS messages from a mission contact can be used to start missions. Different SMS messages can be sent on mission fail/pass from the mission contact.
-Mission fail/pass (and wasted) use native scaleform and improved. credits to illusivee for his Scaleform Wrapper.

Improved Features:
-Missions can now be easily configured to create campaigns/mission stages where passing a mission will automatically lead to another, failing will cause the current mission to be repeated etc… See Mission42. NextMission, NextMissionIfFailed and ProgressToNextMissionIfFail new attributes added to support this.

-When randomized mission selection is on, the server will remove the mission played until all the missions are played before re-adding all missions as a selection, to stop repetition. Players/admins can still pick missions per voting or commands.

-Stromberg will be modded when used in missions, added to certain missions.

New config options (can be turned on/off per mission):
-DoHelpScreens to enable key/button bindings notifications at mission start which is turned off now
-MissionVehicleRandomizeLiveries which is on, and this randomizes the livery (look and feel) of any mission vehicle to give more variety.
-ShowMissionIntroText which is off, which removes the old mission intro text, which is replaced by SMS now.
-Many SMS config options now too, like having random contacts/messages/subjects everytime a mission is played etc… See Missions.lua or Config_Guide.lua.txt file

1 Like