Xovos / esx_illegal

I changed ESX_Drugs and added a lot of features like more drugs and licenses for the money was and the money wash itself.
GNU General Public License v3.0
16 stars 16 forks source link

chemicals #32

Closed fransdg closed 3 years ago

fransdg commented 4 years ago

I can harvest all drugs except chemicals. Is there a solution for that? I'm using now https://github.com/Xovos/esx_illegal/tree/pre-limit-update.

thx

DRIFTKINGEVO commented 3 years ago

@Xovos I'm having the same issue, any suggestions?

DonzoBundestag commented 3 years ago

Same here

lucasrhurst commented 3 years ago

Replace lines 3-13 in server/chemicals.lua with this..

RegisterServerEvent('esx_illegal:pickedUpChemicals')
AddEventHandler('esx_illegal:pickedUpChemicals', function()
    local xPlayer = ESX.GetPlayerFromId(source)
    local xItem = xPlayer.getInventoryItem('chemicals')

    if xItem.limit ~= -1 and (xItem.count + 1) > xItem.limit then
        xPlayer.showNotification(_U('Chemicals_inventoryfull'))
    else
        xPlayer.addInventoryItem(xItem.name, 1)
    end
end)
Xovos commented 3 years ago

Thanks Hurstzy for the fix