Open delduwaht opened 6 years ago
@LuaDeldu Can you tell me all the places you added in esx_extended? please
-- Add event when a player drop an item -- TriggerEvent("esx:dropitemalert",xPlayer.name,foundItem.label,total) -> ESX_extended
TriggerEvent("esx:dropitemalert",xPlayer.name,foundItem.label,total) -- HERE
For example in es_extended/server/main.lua :
RegisterServerEvent('esx:removeInventoryItem')
AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount)
local _source = source
if type == 'item_standard' then
if itemCount == nil or itemCount <= 0 then
TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_quantity'))
else
local xPlayer = ESX.GetPlayerFromId(source)
local foundItem = nil
for i=1, #xPlayer.inventory, 1 do
if xPlayer.inventory[i].name == itemName then
foundItem = xPlayer.inventory[i]
end
end
if itemCount > foundItem.count then
TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_quantity'))
else
TriggerClientEvent('esx:showNotification', _source, _U('delete_five_min', foundItem.label))
SetTimeout(Config.RemoveInventoryItemDelay, function()
local remainingCount = xPlayer.getInventoryItem(itemName).count
local total = itemCount
if remainingCount < itemCount then
total = remainingCount
end
if total > 0 then
xPlayer.removeInventoryItem(itemName, total)
ESX.CreatePickup('item_standard', itemName, total, foundItem.label .. ' [' .. itemCount .. ']', _source)
TriggerClientEvent('esx:showNotification', _source, _U('threw') .. ' ' .. foundItem.label .. ' x' .. total)
----------
TriggerEvent("esx:dropitemalert",xPlayer.name,foundItem.label,total) -- HERE
----------
end
end)
end
@LuaDeldu Thank you, but your pull request seems to be different from the current esx_extended version. If you have time to update this, it would be great. Thank you again for your help.
Just adapt it to the new es_extended script :) Of course this one is outdated, as the PR come from January 2018
@LuaDeldu I have seen it again, I probably got it.
@LuaDeldu Excuse me, can you tell me how to add it to ES_extended?
@LuaDeldu You forget to add the MySQL to the __resourece.lua for the Twitter logs
How to add this
Just add this under the client and server __resource.lua
'@mysql-async/lib/MySQL.lua'