Jump to content
Roberior

Run A Script For All Players In A Certain Vehicle.

Recommended Posts

I wrote a radio script for vehicles, but only those who execute the script can listen to the music, the expected would be everyone inside the vehicle could hear.

I already researched how to use RemoteExec and other methods, but I was unable to reach my goal.

Anyone Have Any Ideas On How Can I Do This?

 

'Sorry, I used Google Translate'

Share this post


Link to post
Share on other sites

You can use playSound3D, or something else to play the sound on all units in the vehicle. For example:

{
  _x playSound "kek.ogg";
}forEach crew vehicle player; //Untested

There's some other workarounds but playsound3d should work good, unless you need JIP compatibility.

  • Haha 1

Share this post


Link to post
Share on other sites

Remote exec should work, just use the "object" approach for the targets. Specifically, your target argument is "crew _vehicle", where _vehicle is the subject vehicle object. That will execute the desired code locally on all vehicle occupants (dead and alive). 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×