I have an idea for a script, but i lack the knowledge of lua scripting.
I wish for a script that gives you an option to get weapons as an inventory item, for example the Mafia, it would be alot easier for them or any other faction to sell weapons or bring in large quantities into the city.
Could be, maybe… If you have say, a pistol in your inventory you could press “enter” on it and then “use” to “assemble” that weapon and give the player who uses the item a pistol.
Now, the trunk system isn’t enough or the system in place today that you carry one firearm and store one in the trunk.
Yeah… except vRP is worse in a multitude of other ways unfortunately. I really wanted to make vRP work but … it just doesn’t have the support ESX does.
Hey just create a script where is an item usable, and it gives you the weapon
ESX.RegisterUsableItem('advancedrifle', function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('advancedrifle', 1)
local weaponName = 'weapon_advancedrifle'
if ESX.GetWeapon(weaponName) then
weaponName = string.upper(weaponName)
end
if xPlayer.hasWeapon(weaponName) then
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player already has that weapon.' } })
else
xPlayer.addWeapon(weaponName, 0)
end
end)
Make an item like ‘Pistol Weapon Case’ and register it as a usable item. When used, ‘Pistol Weapon Case’ can give you a WEAPON_Pistol, etc. I think this is the easier way to implement something like that.