Jump to content
Sign in to follow this  
logan83

Attachto Problem _mrk attachto [_veh, [0,0,0]];

Recommended Posts

My idea is create a scrit that simulate a action to put a Rastreator attached to a vehicle, to track her position via map or GPS, but i have a problem... i cant attach _mrk (marker) with _veh (vehicle to track) any suggestion?

to launch the script i put this in the init of the vehicle:

 Emisor = This addAction ["<t color='#ffff11'>Colocar Rastreador</t>","scripts\Rastreador.sqf",[this],1,false,false,"","player distance cursortarget <4"];

And This is the script:

_veh = _this select 0;
_unit = _this select 1;
_veh removeAction Emisor;					// Quita el Adaction del Vehiculo



// El Marcador Gps

_mrk = createMarker ["Gpspos", _veh];
	"Gpspos" setMarkerColor "ColorRed";
	"Gpspos" setMarkerShape "ICON";
	"Gpspos" setMarkerType "mil_triangle"; 	//  Puede ser "dot" , "hd_dot",  "mil_dot", "mil_circle", "mil_box", "mil_triangle", "select" y muchos mas en http://community.bistudio.com/wiki/cfgMarkers
	"Gpspos" setMarkerSize [2, 2];
	"Gpspos" setMarkerDir 180;



sleep 0,1;

// Emisor GPS
_unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
[color="#FF0000"]_mrk attachto  [_veh, [0,0,0]];[/color]  // return error

	while {alive _veh} do
	{
	"Gpspos" setmarkeralpha 0;
	 sleep 0.4;
	 "Gpspos" setmarkeralpha 1;
	 sleep 0.2;
	 "Gpspos" setmarkeralpha 0;
	 sleep  0.4;
	 "Gpspos" setmarkeralpha 1;
	 sleep 0.2;
};


Share this post


Link to post
Share on other sites

Don't think you can attach a marker but you can move the marker to the position of the object every x seconds.

Share this post


Link to post
Share on other sites
while {true} do {

MARKER setMarkerPos (getPos VEHICLE);

sleep 1;

};

yes, i knew that i can do this, but the game Crash past some minutes... i think is due to the combination the blinking marker bucle ("Gpspos" setmarkeralpha 0; sleep 0.4; "Gpspos" setmarkeralpha 1; sleep 0.2; "Gpspos" setmarkeralpha 0; sleep 0.4; "Gpspos" setmarkeralpha 1; ) and the actualization of the marker position.

Drow09

can u have the marker assume the user name of the player in MP?

I´m very sorry, but I cant understand What are you saying to me? im not a good english speaker :o

kylania

setMarkerText

uhm... how can help, put text in the Marker?? im a newbie scripter... this is my third serious script. xDDDDDD can you extend your explanation please??

Thanks to all for the Help!!

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
Sign in to follow this  

×