LoOni3r 6 Posted January 28, 2019 hi, Is there a way to determine the position of a vehicle by vehiclevarname? I work on a survival server and want to save the positions even if the vehicle is moved without a driver. Many Thanks. Share this post Link to post Share on other sites
gc8 955 Posted January 28, 2019 you can use getpos on empty vehicles myVehicle = vehicle player; hint (str (getpos myVehicle)); Share this post Link to post Share on other sites
killzone_kid 1325 Posted January 28, 2019 You need to cycle through all vehicles and compare your varname to each vehicle varname and get vehicle reference when they match Share this post Link to post Share on other sites
Schatten 252 Posted January 28, 2019 23 minutes ago, LoOni3r said: Is there a way to determine the position of a vehicle by vehiclevarname? Sure: _position = getPos myvehiclevarname; or _position = getPos (missionNamespace getVariable "myvehiclevarname"); 25 minutes ago, LoOni3r said: I work on a survival server and want to save the positions even if the vehicle is moved without a driver. vehicles command returns all vehicles. Share this post Link to post Share on other sites
LoOni3r 6 Posted January 28, 2019 I solved it this way: { if (vehicleVarName _x != "") then { str typeOf _X remoteExec ["systemChat"]; str vehicleVarName _x remoteExec ["systemChat"]; str getPosATL _x remoteExec ["systemChat"]; str getDir _x remoteExec ["systemChat"]; str getAllHitPointsDamage _x remoteExec ["systemChat"]; }; } forEach vehicles; had hoped you can directly address the vehicle by vehiclevarname without scanning for all vehicle. Many Thanks for your answers. Share this post Link to post Share on other sites
killzone_kid 1325 Posted January 28, 2019 If a vehicle is assigned to global variable with the same name as vehicleVarName, you can try get the reference with _veh = missionNamespace getVariable ["myvehvarname", objNull]; Share this post Link to post Share on other sites