Forum Jump :

Author Message

Posts: 6

Level: Member

Country: uk
In-game name:

#1 Posted at 2008-07-23 07:35        
I have a marker that tracks a unit, however i only want the independent side to be able to see it. i looked in the mission.sqm but could not find any option for side. so how would i make the marker only visible to one side?


Author Message

Posts: 53

Level: Member

Country: uk
Location: West Yorkshire
Occupation: Proffesional Developer SQL/ C#/C/C++
In-game name:

#2 Posted at 2008-07-23 10:49        
I am going to assume this is multiplayer - bacause thats the more complicated scenario.

On first thought you might think that you want to run the code that moves the marker on the server, and then hide the marker on certain clients.

Its easier to run the code on every cleitn which needs to see the marker but only create LOCAL markers, ie every script command which has the word "marker" in needs a LOCAL on the end.

Be warned if you run any non-local command on a local marker, that marker becomes a public marker and will appear on EVERY client.

I've written this code off the top of my head during lunch, so it should point you in the right direction, but I don't promise that it is error free.

if ( playerSide == civilian) then {
   spawn {
      _markerName createMarkerLocal [_markerName, position _unitBeingTracked ];
      _markerName markerSetTypeLocal ["ICON"];
      _markerName markerSetShapeLocal ["DOT"];

      while { alive _unitBeingTracked } do {
           __markerName MarkersetPosLocal position _unitBeingTracked;
           sleep 0.5;
      };// end while 
   };// end spawn
};// end if

This post was edited by Big (2008-07-23 11:35, ago)


Author Message


Armaholic icons master

Posts: 5559

Level: Former Staff

Country: es
Location: Who knows
Occupation: Industrial Engineer
Age: 44
In-game name:

#3 Posted at 2008-07-23 11:36        
Plese use the bbcode "code" for a better view of the text:

[code]your text here[/ code]

(without the latest "space" between the / and code])