Updated to v. 2.8.7 alpha
–Fix added for pickup funkiness. Pickups should get cleaned up properly now. Thanks to scanner and his RottenV mod which helped me understand pickups a little better. Mission Pickups will be checked every 5 seconds if collected and cleaned up on the client if so. Better cleanup code for reward pickups and mission pickups at mission end.
–Enemy Peds will now stay in vehicles, they will also attack with a melee weapon. New ‘wanderinarea’ attribute that makes an NPC wander within the area. ‘wander’ makes the NPC wander to wherever. New ''drivingtocoord" attribute that makes NPC in vehicle drive there (see missions.lua). ‘drive’ makes the driver wander. If you specify a zombie model for the ped, it will take on zombie like attributes (thanks again to scanner). You can override this with ‘notzed=true’
–Turrets. If you add a vehicle with a turret, the turret seats will be auto-filled by NPCs. See missions.lua for the config.
–New setting: Config.HostageRescue: If you set this true, in Assassinate missions if a player kills a friendly/hostage, the mission will fail and the offending player will get the money penalty for killing a friendly.
–Cleanup of markers and props so they now are at ground level (thanks to sixsens)
–Other code fixes and tweaks, like cowering hostages/friendlies, mission ending messages are more descriptive
–Removed the old buggy Mission10 and and added a new one, along with a new mission Mission11
–Random Mission Generator
Mission12 is a random mission in missions.lua. You could take out all the missions in missions.lua and make it Mission1, the only mission, and you would have random Objective and Assassinate missions all over the map. You make a mission random, by giving it IsRandom flag.
There are a host of Config.RandomMission<***> settings to generate random missions. Like most other settings in missions.lua, you can override the global setting, by defining the setting per Mission. So you can have different types of random missions.
The current selection of default random locations and the default settings of the generator are still in testing. I am forcing vehicles and sometimes many NPCs into tight areas and varying landscapes to see what happens. Spent some time trying to get this work, I ended up having to use raytracing (StartShapeTestRay and GetShapeTestResult), to worldprobe the area to not have NPCs spawn hidden inside buildings (Kudos to Vechro and his Crates Drop script). It works well. Thing is when I updated my resource manifest to be able to use the functions, my props via CreateObject stopped spawning. Its so odd. I get 0 back from it. Tried different arguments, looked at Fivem_Cops way and havent figured it out yet. So I ended up backing down my resource manifest and using a NativeInvoke for StartShapeTestRay but for GetShapeTestResult, they had a GetRaytraceResult alias which was usable. It must be a timing problem with CreateObject, may have to put in a wait or something.