[ESX] Multiple Backpack Items
- Forum: https://forum.cfx.re/t/release-esx-usable-backpack-item/4805469
- Discord Support: https://discord.gg/5hHSBRHvJE
- Preview 1: https://streamable.com/iog8fy
- Preview 2: https://streamable.com/61a8ur
- You can use the
bag
Item, then you getnobag
Item and a Bag will be added to your Ped. - If you use
nobag
Item then then the Bag will be removed from your Ped an you get thebag
Item. - Open own Bag with Command
- Steal Bag from closest Player with Command
- Works with Character Names not FiveM Names
Only if Config.BagInventory = 'secondary'
!
/openbag
- Open your own Bag/stealbag
- Open the Bag from Player next to you
You can use the exports clientside AND serverside
-- Returns the itemName saved in database or nil if the player don't has a Bag
local hasBag = exports.msk_backpack:hasBag(player)
Example
exports.msk_backpack:hasBag({source = playerId})
exports.msk_backpack:hasBag({identifier = playerIdentifier})
exports.msk_backpack:hasBag({player = xPlayer})
Chezza Inventory only necessary if Config.BagInventory = 'secondary'
!
This removes the Backpack after death, resets the inventory space and removes all items inside
Go to /client/main.lua
and search for function RespawnPed(ped, coords, heading)
.
Replace the function with this code:
function RespawnPed(ped, coords, heading, isDied)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
SetPlayerInvincible(ped, false)
ClearPedBloodDamage(ped)
TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned')
if isDied then
TriggerServerEvent('msk_backpack:setDeathStatus', true)
end
end
Above this you find: function RemoveItemsAfterRPDeath()
.
Search for: RespawnPed(PlayerPedId(), RespawnCoords, ClosestHospital.heading)
Replace it with this: RespawnPed(PlayerPedId(), RespawnCoords, ClosestHospital.heading, true)
- [ESX] MSK Armor | Multiple Armor Vests
- [ESX] MSK Banking with NativeUI
- [ESX] MSK Crafting with NativeUI
- [ESX] MSK Garage and Impound with NativeUI
- [ESX] MSK Garage NativeUI - Garage & Impounds
- [ESX] MSK Handcuffs | Realistic Handcuffs
- [ESX] MSK Shopsystem with NativeUI & Database Feature
- [ESX/QBCore] MSK Simcard | Change your phonenumber
- [ESX] MSK WeaponAmmo | Clips, Components & Tints