Clear Inventory
If you are a qbcore user, ignore this step since your framework will do it automatically. This step is exclusive to esx, but if you want to apply this to other external qbcore assets you can do so.
Quasar Inventory has very useful events when emptying a certain player's inventory. This system will apply, for example, to your esx_ambulancejob but can be used in other assets.
Explanation and way of use
Below we will give a brief summary of the use of the ClearInventory export, which allows us to save some items in the event that it is executed. For example, we can execute it when it dies and it loses all the items, except its id_card or its phone, as in the following example:
Integration in esx_ambulancejob
To clean up inventories after death, we need to make a series of changes to our esx_ambulancejob or use that reference in your ambulancejob resource.
We will apply the changes in the following event RegisterServerCallback esx_ambulancejob:removeItemsAfterRPDeath as follows:
File with the integration applied
For this change we also bring the most recent version of esx_ambulancejob with these changes applied, to make your day easier and avoid random errors. Keep in mind that if you are going to use this esx_ambulancejob you must have the latest versions of esx-legacy.
Last updated