[OneSync Infinity] Item dropped error

Hi everyone, since I switched to the 128 slot OneSync Infinity I have noticed that the thrown items are found behind other players. Can anyone tell me if he managed to fix it? i am using esx_inventoryhud. Thanks =)

Ask the resource author or use the resource GitHub/forum post to ask questions like this.

i know but before i put onesync this problem was not there

goto es_extended - client - main.lua search for esx:pickup
and replace the event with
RegisterNetEvent(‘esx:pickup’)

AddEventHandler('esx:pickup', function(id, label, player, pedCoords)

    local playerPed = GetPlayerPed(GetPlayerFromServerId(playerId))

    local entityCoords, forward, obj = pedCoords, GetEntityForwardVector(playerPed)

    local objectCoords = (entityCoords + forward * 1.0)

    ESX.Game.SpawnLocalObject('prop_money_bag_01', objectCoords, function(obj)

        SetEntityAsMissionEntity(obj, true, false)

        PlaceObjectOnGroundProperly(obj)

        FreezeEntityPosition(obj, true)

        pickups[id] = {

            id = id,

            obj = obj,

            label = label,

            inRange = false,

            coords = objectCoords

        }

    end)

end)

will this work with onesync i have the same issue and /me shows to all too been trying to find a fix for ages

Thank you very much, now I have inserted it and we will see over time if it is resolved. Would you also know the solution of es_admin2 not finding the players?

it brakes the shops this method try and buy a bat or something it wont put it in ya inv

No to me the shops go quietly but when I try to throw something I get this error

1 Like

yes,
in es_admin2 replace this in client

function getPlayers()

    local players = {}

    local maxplayers = GetConvarInt('sv_maxclients', 128)

    for i = 0, maxplayers do

        if NetworkIsPlayerActive(i) then

            table.insert(players, {id = GetPlayerServerId(i), name = GetPlayerName(i)})

        end

    end

    return players

end

with this

local PlayerData = {}

RegisterNetEvent("SendPlayerData")

AddEventHandler("SendPlayerData", function(playerData, data)

    PlayerData = playerData

end)

function getPlayers()

    local players = {}

    players = PlayerData

    return players

end

and on server side place this

local function SendPlayerData() 

    Citizen.SetTimeout(10000, SendPlayerData)

    local data = {}

     for _, player in ipairs(GetPlayers()) do

        table.insert(data, {id = player, name = GetPlayerName(player)})

     end 

      TriggerLatentClientEvent("SendPlayerData", -1, #data, data)

  end

  

  SendPlayerData()

its just for the basic droping method in es_extended.

perfect thanks, for the error that always gives me instead for esx_extended do you know the reason?

yeah i tried to add it but once added people when they go into weapon shop and attempt to buy it buys it and doesn’t add to there inv
ive had issues with /me command too it shows people that are far away what they say its weird its like onesync dont like me been trying to fix for about 2-3 weeks now no result

for the shop I know it’s just your problem, they all work without problems for me. Even him / me does not give problems. The only problem is the error above

then its problem with the gun store script. then with the 3dme its just essiest to just turn of the chat massage and dont do anything about it. i dont hava a soulotion for it right now.

and for my mistake can you tell me something?

in es_extended - server - functions.lua search for " ESX.CreatePickup and replace the function with

ESX.CreatePickup = function(type, name, count, label, playerId)

    local pickupId = (ESX.PickupId == 65635 and 0 or ESX.PickupId + 1)

    local xPlayer = ESX.GetPlayerFromId(playerId)

    local pedCoords = GetEntityCoords(GetPlayerPed(playerId))

    ESX.Pickups[pickupId] = {

        type  = type,

        name  = name,

        count = count,

        label = label,

        coords = xPlayer.getCoords(),

    }

    TriggerClientEvent('esx:pickup', -1, pickupId, label, playerId, pedCoords)

    ESX.PickupId = pickupId

end

RegisterNetEvent(‘esx:pickup’)
AddEventHandler(‘esx:pickup’, function(pickupId, label, playerId, type, name, components)
local playerPed = GetPlayerPed(GetPlayerFromServerId(playerId))
local entityCoords, forward, pickupObject = GetEntityCoords(playerPed), GetEntityForwardVector(playerPed)
local objectCoords = (entityCoords + forward * 1.0)

if type == 'item_weapon' then
	ESX.Streaming.RequestWeaponAsset(GetHashKey(name))
	pickupObject = CreateWeaponObject(GetHashKey(name), 50, objectCoords, true, 1.0, 0)

	for k,v in ipairs(components) do
		local component = ESX.GetWeaponComponent(name, v)
		GiveWeaponComponentToWeaponObject(pickupObject, component.hash)
	end
else
	ESX.Game.SpawnLocalObject('ng_proc_binbag_02a', objectCoords, function(obj)
		pickupObject = obj
	end)

	while not pickupObject do
		Citizen.Wait(10)
	end
end

SetEntityAsMissionEntity(pickupObject, true, false)
PlaceObjectOnGroundProperly(pickupObject)
FreezeEntityPosition(pickupObject, true)
SetEntityCollision(pickupObject, false, true)

Pickups[pickupId] = {
	id = pickupId,
	obj = pickupObject,
	label = label,
	inRange = false,
	coords = objectCoords
}

end)

so can i change that with the code above ?

instal this veirsion of esx insted, and try agan.

sorry if I keep bothering you but now I have another mistake

No ok solved, pickups [id] the p must be capitalized Pickups [id]. But now it shows nothing on the ground and no errors

[31m[ERROR] [MySQL] [es_extended] An error happens on MySQL for query “INSERT INTO users (accounts, identifier) VALUES (’{“bank”:50000}’, ‘d80369b3f043e09886e7f3a1ed1273b088f262aa’)”: ER_BAD_FIELD_ERROR: Unknown column ‘accounts’ in 'field list’e[0m
e[31m[ERROR] [MySQL] [es_extended] An error happens on MySQL for query “SELECT accounts, job, job_grade, group, loadout, position, inventory FROM users WHERE identifier = ‘d80369b3f043e09886e7f3a1ed1273b088f262aa’”: ER_BAD_FIELD_ERROR: Unknown column ‘accounts’ in 'field list’e[0m
SCRIPT ERROR: @es_extended/server/main.lua:93: attempt to index a nil value (local ‘result’)

ref (@es_extended/server/main.lua:93)
(@mysql-async/mysql-async.js:14959)
SCRIPT ERROR: @esx_deliveries/server/main.lua:81: attempt to index a nil value (local ‘xPlayer’)
SCRIPT ERROR: @esx_wanted/server/main.lua:169: attempt to index a nil value (local ‘xPlayer’)