- Katılım
 - 5 yıl 17 gün
 
- Mesajlar
 - 230
 
Merhaba, disc inventoryhud için yere atılan eşyanın direkt olarak silinmesini istiyorum.
es_extended/server/main.lua içinde ESX.CreatePickup satırlarını yorum satırı yaptım ama işlevi olmadı.
	
	
	
	
	
		
	
		
			
		
		
	
				
			es_extended/server/main.lua içinde ESX.CreatePickup satırlarını yorum satırı yaptım ama işlevi olmadı.
		Kod:
	
	RegisterServerEvent('esx:removeInventoryItem')
AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount)
    local playerId = source
    local xPlayer = ESX.GetPlayerFromId(source)
    if type == 'item_standard' then
        if itemCount == nil or itemCount < 1 then
            xPlayer.showNotification(_U('imp_invalid_quantity'))
        else
            local xItem = xPlayer.getInventoryItem(itemName)
            if (itemCount > xItem.count or xItem.count < 1) then
                xPlayer.showNotification(_U('imp_invalid_quantity'))
            else
                xPlayer.removeInventoryItem(itemName, itemCount)
                local pickupLabel = ('~y~%s~s~ [~b~%s~s~]'):format(xItem.label, itemCount)
                --ESX.CreatePickup('item_standard', itemName, itemCount, pickupLabel, playerId)
                xPlayer.showNotification(_U('threw_standard', itemCount, xItem.label))
            end
        end
    elseif type == 'item_money' then
        if itemCount == nil or itemCount < 1 then
            xPlayer.showNotification(_U('imp_invalid_amount'))
        else
            local playerCash = xPlayer.getMoney()
            if (itemCount > playerCash or playerCash < 1) then
                xPlayer.showNotification(_U('imp_invalid_amount'))
            else
                xPlayer.removeMoney(itemCount)
                local pickupLabel = ('~y~%s~s~ [~g~%s~s~]'):format(_U('cash'), _U('locale_currency', ESX.Math.GroupDigits(itemCount)))
                --ESX.CreatePickup('item_money', 'money', itemCount, pickupLabel, playerId)
                xPlayer.showNotification(_U('threw_money', ESX.Math.GroupDigits(itemCount)))
            end
        end
    elseif type == 'item_account' then
        if itemCount == nil or itemCount < 1 then
            xPlayer.showNotification(_U('imp_invalid_amount'))
        else
            local account = xPlayer.getAccount(itemName)
            if (itemCount > account.money or account.money < 1) then
                xPlayer.showNotification(_U('imp_invalid_amount'))
            else
                xPlayer.removeAccountMoney(itemName, itemCount)
                local pickupLabel = ('~y~%s~s~ [~g~%s~s~]'):format(account.label, _U('locale_currency', ESX.Math.GroupDigits(itemCount)))
                --ESX.CreatePickup('item_account', itemName, itemCount, pickupLabel, playerId)
                xPlayer.showNotification(_U('threw_account', ESX.Math.GroupDigits(itemCount), string.lower(account.label)))
            end
        end
	
	
				



