Jump to content

Recommended Posts

  • 3 weeks later...
  • 6 months later...
  • Scripting Moderators
On 21/02/2019 at 20:25, IIYAMA said:

I added some information about the source variable. Feel free to ask questions about this subject.

 

 

Does attachedTo works for table?

local vehicles_table = {
	[vehicle],
	[vehicle],
}

And if so, then it will trigger for all vehicles which are in table?

  • Like 1
Link to comment
  • Moderators
7 hours ago, majqq said:

Does attachedTo works for table?


local vehicles_table = {
	[vehicle],
	[vehicle],
}

And if so, then it will trigger for all vehicles which are in table?

Nope it doesn't unfortunately.

 

But that doesn't mean you can't fake it. And save some network data.

local elementList = {vehicle, vehicle}

triggerClientEvent(root, "triggerEventForElementList", resourceRoot, elementList, "theEvent", "argument1")
addEvent("triggerEventForElementList", true)
addEventHandler("triggerEventForElementList", resourceRoot, function (elementList, theEvent, ...) 
 for i = 1, #elementList do
  triggerEvent(theEvent, elementList[i], ...)
 end
end, false)

 

Edited by IIYAMA
  • Like 1
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...