Jump to content
S3LMON

I want to get all players in a vehicle.(moveInCargo, moveOut)

Recommended Posts

Hello 🙂

 

I want to get all players in a vehicle.

So I did execVm in initServer to run the following code, but in editor it worked for me. (Assume that it is in the A.sqf file.)

I tried a total of three codes.

[[],{
	[str("MISSION END") ,str(date select 0) + "." + str(date select 1) + "." + str(date select 2), str(date select 3) + ":" + str(date select 4), 	str("RTB Complete!")] spawn BIS_fnc_infoText;
	{_x moveInCargo BASE;_x allowDamage false;} forEach allPlayers;
	sleep(1);
	[1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
	{_x moveOut BASE;} forEach allPlayers;
}] RemoteExec ["bis_fnc_spawn", 0, true];
[[],{
	[str("MISSION END") ,str(date select 0) + "." + str(date select 1) + "." + str(date select 2), str(date select 3) + ":" + str(date select 4), str("RTB Complete!")] spawn BIS_fnc_infoText;
	HC = entities "HeadlessClient_F"; HP = allPlayers - HC;
	{_x moveInCargo BASE;_x allowDamage false;} forEach HP;
	sleep(1);
	[1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
	{_x moveOut BASE;} forEach HP;
}] RemoteExec ["Spawn", 0, true];
[[],{
	[str("MISSION END") ,str(date select 0) + "." + str(date select 1) + "." + str(date select 2), str(date select 3) + ":" + str(date select 4), str("RTB Complete!")] spawn BIS_fnc_infoText;
	player moveInCargo BASE;player allowDamage false;
	sleep(1);
	[1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
	player moveOut BASE;
}] RemoteExec ["Spawn", 0, true];


It also worked inside dedicated servers, but only worked for one person when there were more than one.

After reviewing the code

waituntil{{(alive _x) && ((getPosATL _x) select 2 < 60) && (_x distance2D BASE > 200)} count allPlayers > 0};

If there is a player that satisfies the conditions in the code above, A.sqf is executed.

And in the code of A.sqf, only those who satisfy the condition are executed normally.

 

Are these possible? Or am I missing something?

I've been working on this for almost a month, but I haven't found a definitive answer yet.

 

Advice please!

 

Thanks!! 🙂

 

+ +

Even people who do not run normally
 [1, "BLACK", 5, 1] spawn BIS_fnc_fadeEffect;
This part works fine!
Yes...I mean, only this part works...:\

Edited by S3LMON

Share this post


Link to post
Share on other sites

Have you tried executing those commands without remoteExec from initPlayerLocal.sqf?

Place these params on top of initPlayerLocal.sqf:

params ["_player", "_didJIP"];

 

and script from there below:

_player moveInCargo BASE;

...etc

Share this post


Link to post
Share on other sites
3 hours ago, RCA3 said:

Have you tried executing those commands without remoteExec from initPlayerLocal.sqf?

Place these params on top of initPlayerLocal.sqf:

params ["_player", "_didJIP"];

 

and script from there below:

_player moveInCargo BASE;

...etc

 

Thanks for the reply! 🙂

But the logic to execute that command exists in initServer.

But how can I execute these statements in initPlayerLocal? Is there a way?

Share this post


Link to post
Share on other sites

From initServer:

fnc_base = compile "_this moveInCargo BASE;_this allowDamage false";

{[_x,fnc_base] remoteExec ["call",_x]} forEach HP ;

 

From initPlayerLocal.sqf:

player moveInCargo BASE;

player allowDamage false

What else?

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

×