I decided to make a short script to imitate the Merryweather crate drops in GTA Online.
Features
The crate is dropped by a plane that flies overhead.
The crate contains whatever weapon the player called through the command.
A parachute is attached to the crate while it’s falling down.
The crate has a beeping sound, just like in GTAO.
A flare gets deployed wherever the crate lands.
Usage
For example /cratedrop minigun 100 true 400.0
will drop a crate containing a minigun with 100 rounds with roofCheck being done beforehand and plane will be spawned 400 metres away, if no ammo count is specified then the script will default to 250 rounds. If roofCheck is false or not entered, then it will be skipped. If planeSpawnDistance is not specified, it’ll be 400 metres.
Notes
Thanks to everyone in Discord, especially Throwarray who helped me make this and understand Rockstar’s code.
Let me know about the bugs you encounter.
Download
The resource can be downloaded at my Github as a zip file.
Changelog
v2.0
Command has changed to /cratedrop, only the weapon is required as an argument, but accepts /cratedrop minigun 50 true 1000 where 50 is ammo, true is for roofCheck and 1000 is planeSpawnDistance.
Got rid of weaponTable entirely for interpreting commands, for example, pistol gets converted to pickup_weapon_pistol automatically along with weapon_pistol. This means all weapons are supported
Plane spawn location is now RNG at the given distance (400 metres by default).
CrateDrop is now an exported function (no error correction, so use it right) for developers with parameters such as weapon (must use exact name of pickup), ammo, planeSpawnDistance (how far away to spawn plane), dropCoords(expects a dictionary table with x, y, z values).
“crateDrop” is an event (does error checking and correction) with parameters such as weapon (expects for example smg or weapon_smg or pickup_weapon_smg, but only works with weapons, doesn’t accept other pickups, use the function to bypass this), ammo, roofCheck (bool, if true then checks if plane is capable of dropping a crate to specified coordinates), planeSpawnDistance, dropCoords.
When the resource gets stopped, the resource cleans up after itself, removing objects, pickups, planes
If the crate is dropped and picked up early enough by a player so the flare isn’t deployed yet, the flare gets deleted. I was unable to find a way to get rid of it after it deployed.
v1.2
Added support for Scammer’s Universal Menu and the event “Cratedrop:Execute” now accepts parameters in a more logical manner.
v1.1
Slight code optimization, actually commented the code, removed unnecessary stuff and added a lot more weapons to the drop list.
just tried all seems fine on cmds, just when plane comes it crashes, no flare and the box/crate or what ever it is, is invisible and cant to anything with it
Drugs like an RP thing? Sure, just make it give the player coke/weed once the pickup disappears (aka is picked up by a player). However I’m not sure how to do CreateAmbientPickup() without actually giving the player a weapon, as one of the parameters requires a weapon.
I love this script!!! Question is it possible to include own items? that will be fantastic! Like a Rescuepack (flare, flargun and bread with water) or ony one of such things
Flare, falregun are optiions but not all pickups are all what you want, look up “GTA 5 Pickup Hash List” or use this for help on which you can use. Items with “PICKUP_” are the ones you want to use then just add them to the weaponList table.
At least you tried, but CreateAmbientPickup() will only accept a single pickup hash. You can’t give it a table. I’m not quite sure how it would have to be done, but I’ll let you know when I think of something. Because I don’t think you can receive 2 items from a single pickup even in GTAO, correct me if I am wrong.
Perhaps use a smaller model for the pickup and fit the three pickups in a single crate all right next to eachother. Or… drop one pickup and check when that pickup is picked up by a player, give them the other stuff as well at the same time, creating the illusion of getting 3 items from a single pickup. Only problem would be that I don’t know how to check who actually picked up the pickup, it might not always be the one who called down the pickup. Also I think I’ll push an update to cratedrop as well.
Edit:
New version out!
v1.1
Added slight code optimization, actually commented code, removed unnecessary stuff and added a lot more weapons to the drop list.
I’m not quite sure what you’re asking, if you want to start the resource, then make sure it’s in your resources folder and enter start cratedrop or whatever else name you gave to the resource.