fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(server): support target list for trigger client event

Open PichotM opened this issue 3 years ago • 14 comments

Old PR: https://github.com/citizenfx/fivem/pull/1207

PichotM avatar Jan 01 '22 14:01 PichotM

awesome! need this! 👍 👍 👍 👍 👍

marciogalvao89 avatar Jan 03 '22 23:01 marciogalvao89

awesome! need this! 👍 👍 👍 👍 👍

What even is the need for this?

RockySouthpaw avatar Jan 07 '22 03:01 RockySouthpaw

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.

Fortahr avatar Jan 07 '22 18:01 Fortahr

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.

blattersturm avatar Jan 07 '22 18:01 blattersturm

what if i set -1 to one of the array positions?

manups4e avatar Jan 07 '22 20:01 manups4e

for i,target in pairs(targets) do
	TriggerClientEvent("cancelTrade", target, { example = 0 })
end

khaby

Xinerki avatar Jan 07 '22 20:01 Xinerki

This PR is in my manual edit queue, it needs to have some changes made to prevent API misuse.

blattersturm avatar Jan 13 '22 11:01 blattersturm

Any update on this PR? Also, can you tell me what you wanted to do so I might help if you're busy

PichotM avatar Nov 11 '22 18:11 PichotM

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.

Korioz avatar Aug 02 '24 07:08 Korioz

Can confirm even with FxEvents and it's implementation would benefit from this

manups4e avatar Aug 02 '24 08:08 manups4e