OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: snakedoctor on 31 Oct 2009, 15:01:50

Title: Unit/vehicle tracking marker.
Post by: snakedoctor on 31 Oct 2009, 15:01:50
i found this script with search function and it seems work fine.What i want is when the vehicle damaged change the marker type and of course when its get repaired marker turns default.There are some scripts in forum but they are all old sqs.Need you help..

Code: [Select]
_marker = _this select 0;
_vehicle = _this select 1;

while {alive _vehicle} do
  {
  _marker setmarkerpos getpos _vehicle;
  sleep 1;
  };
Title: Re: Unit/vehicle tracking marker.
Post by: Shuko on 31 Oct 2009, 17:43:24
Check the damage and setmarkertype accordingly.
Title: Re: Unit/vehicle tracking marker.
Post by: tcp on 31 Oct 2009, 18:43:57
You probably want run it on locally on clients only and use local markers, to save the server from some processing. Also, there are so many examples of this already, you really should search around.
Title: Re: Unit/vehicle tracking marker.
Post by: snakedoctor on 31 Oct 2009, 20:41:53
Found lot of examples, but they are all .sqs from ofp times.Thie sqf ones dont have damage system...
Title: Re: Unit/vehicle tracking marker.
Post by: mikey on 02 Nov 2009, 13:34:57
Untested:

Code: [Select]

_marker = _this select 0;
_vehicle = _this select 1;

while { alive _vehicle } do
{
_markerType = if ( (damage _vehicle) > 0 ) then{ "n_maint" } else { "vehicle" };
_marker setMarkerTypeLocal _markerType;
_marker setMarkerPosLocal (getpos _vehicle);

sleep 1;
};

I also made this a script that uses local effect commands now, so you need to execute the script on every client.