Jump to content
Robustcolor

RemoteExec and moveInDriver problem

Recommended Posts

createVehicle is EG so the vehicle exists on each PC. The owner remains local (server or client (when driven))

There is no need for a remote execution

deleteVehicle is AG EG , so you can delete the vehicle from where you want. (no need to be local). So no remote execution needed.

You can even deleteVehicle from multiple PCs , that doesn't matter (no error).

 

That said, you can set a variable on spawned vehicles, like:

private _veh = createVehicle ["B_Heli_Light_01_F", [0,0,0], [], 0, "FLY"];

_veh setVariable ["aSpawnedOne",TRUE,TRUE];   // the second true means public variable it, so the variable is known everywhere.

 

in initServer:
 

[] spawn {
  while {true} do {
    { _v = _x; {_v deleteVehicleCrew _x} count crew _v;  deleteVehicle _v} forEach (vehicles select {!alive _x && !isNil {_x getVariable "aSpawnedOne"}} );
    sleep 2;
  };
};

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, pierremgi said:

_veh setVariable ["aSpawnedOne",TRUE,TRUE];   // the second true means public variable it, so the variable is known everywhere.

Thanks for the help Pierre, since it's only the server that will handle the deleting of the vehicles then i guess i could only send it to the server as publicVariableServer "_veh" instead of sending the variable to everyone. The loop is only running from server. Correct? Or making it public is unnecessary and just a regular check with getVariable if a non public variable is set on the vehicle?

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

×