hellstorm77 2 Posted June 26, 2013 I was wondering what the script code was for attaching markers to a vehicle? i want the marker to always be there even when the vehicle respawns. Share this post Link to post Share on other sites
mindstorm 8 Posted June 26, 2013 Not sure if you could use attachTo but you could do this vehicle init: while {alive this} do { "mymarker" setMarkerPos getPos this; "mymarker" setMarkerDir getDir this; sleep 1; //Decrease if you want it to be more smooth }; Share this post Link to post Share on other sites
hellstorm77 2 Posted June 26, 2013 thanks it worked great Share this post Link to post Share on other sites
hellstorm77 2 Posted June 26, 2013 I have this script and for the life of me i can't remember how to called it up on a vehicle so the marker named chopper1 will attach to the chopper so when you look at the map you see the marker moving with the chopper. marker_units.sqf private ["_unit","_marker","_delay"]; _unit = _this select 0; _marker = _this select 1; _delay = _this select 2; while {true} do { _marker setMarkerAlpha 1; while {alive _unit} do { _marker setMarkerPosLocal getPos _unit; sleep _delay; }; _marker setMarkerAlpha 0; waitUntil {alive _unit}; }; Share this post Link to post Share on other sites
mindstorm 8 Posted June 26, 2013 it would be this in the vehicle init: [this, "marker_name", 1] execVM "marker_units.sqf"; Share this post Link to post Share on other sites
hellstorm77 2 Posted June 26, 2013 mindstorm said: it would be this in the vehicle init:[this, "marker_name", 1] execVM "marker_units.sqf"; it didnt work Share this post Link to post Share on other sites
kater_begemot 10 Posted June 26, 2013 hellstorm77 said: it didnt work hi, try this, it works: you need a marker named chopper1, and write in init of vehicle: null = [this, "chopper1", 1] execVM "marker_units.sqf"; Share this post Link to post Share on other sites
Blitzer134 1 Posted June 26, 2013 try this if wrong sorry really tired will test tomorrow -------init.sqf------- [] spawn { while{not isnull Heli1} do {"Marker" setmarkerpos getpos Heli1; sleep 0.4;}; }; -------------------------- Explanation: Heli1 = Unit the marker follows "Marker = Name of the marker sleep 0.4 = time the marker updates - here 0.4 seconds Share this post Link to post Share on other sites
hellstorm77 2 Posted June 27, 2013 i did try this yesterday null = [this, "chopper1", 1] execVM "marker_units.sqf"; and it worked :) Share this post Link to post Share on other sites