fivem
fivem copied to clipboard
feat(server): support target list for trigger client event
Old PR: https://github.com/citizenfx/fivem/pull/1207
awesome! need this! 👍 👍 👍 👍 👍
awesome! need this! 👍 👍 👍 👍 👍
What even is the need for this?
What even is the need for this?
Looks like this makes TriggerClientEvent
also allow an array of player IDs to be passed and send the event to all those players, instead of just one.
What even is the need for this?
Looks like this makes
TriggerClientEvent
also allow an array of player IDs to be passed and send the event to all those players, instead of just one.
wow, it does????? i need this right now 👍👍 👍 👍 👍
Not merged yet by the way as there's a few small changes I want to do to it myself for, uh, safety reasons. They were in my comment to the last one too.
what if i set -1 to one of the array positions?
for i,target in pairs(targets) do
TriggerClientEvent("cancelTrade", target, { example = 0 })
end
This PR is in my manual edit queue, it needs to have some changes made to prevent API misuse.
Any update on this PR? Also, can you tell me what you wanted to do so I might help if you're busy
Up,
Sending a client event to a huge list of players (400+) is not viable without the implementation of this PR, the consecutive native calls leads to bad performance (like packing the same data over and over again), for example this would be useful to send to all players in a bucket, which can have a lot of players inside it.
Can confirm even with FxEvents and it's implementation would benefit from this