Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AddItem work with non-intitalised vehicle inventories #591

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Luke20201
Copy link

Description

I had an issue where I couldn't add items to the trunk of my delivery van for my postal job because the trunk didn't exist, so I wrote an extension to AddItem for this case. The only change a developer needs to make is the vehicleClass to the end of the export[there's no server side native for it :( ].

Usage examples:
exports['qb-inventory']:AddItem(identifier, itemName, amount, slot, info, reason, vehicleClass)
exports['qb-inventory']:AddItem("trunk-" .. plate, "package", 1, false, info, "postaljob", 12)

Checklist

  • [ Yes] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [ Yes ] My code fits the style guidelines.
  • [ Yes] My PR fits the contribution guidelines.

@GhzGarage GhzGarage self-assigned this Nov 13, 2024
@GhzGarage GhzGarage added enhancement New feature or request help wanted Extra attention is needed labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants