qbcore-framework / qb-core

FiveM RP Framework Core :muscle:
GNU General Public License v3.0
582 stars 962 forks source link

fix shared update #988

Closed hakos47 closed 12 months ago

hakos47 commented 1 year ago

It's a temporary fix while we see how to do it better. but this in principle fixes the error that when a client entered it did not get the table of items etc updated. since shared_scripts does not serve to update information on both sides (client, server) it would fix problems with addItems, addItem, etc.

It is not the best solution. but it's a temporary fix

Description

Checklist

amantu-qbit commented 1 year ago

Great work

amantu-qbit commented 1 year ago

Also, why don't just push the whole QBshared table to client?

hakos47 commented 1 year ago

Also, why don't just push the whole QBshared table to client?

The idea is good, but I think we should review it in more detail, as it could be an excessive burden. We should consider more efficient alternatives.

hakos47 commented 1 year ago

Also, why don't just push the whole QBshared table to client?

I've changed the system and made it receive the information upon connection. I believe it works better than the previous one, at least in the tests I've conducted, and it fixes all the problems with job updates, vehicles, etc.

sirhvd commented 1 year ago

I think you forgot to add "src" when using TriggerClientEvent. TriggerClientEvent('QBCore:Client:SharedUpdate', src, QBCore.Shared)