Home   Help Search Login Register  

Author Topic: init.sqf and UPS problems  (Read 1449 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
init.sqf and UPS problems
« on: 18 Jul 2009, 13:51:29 »
hi guys

having problems with my init.sqf and the Urban patrol script

im trying to hide the markers for UPS on briefing screen but when i enter the code

"m_alpha" setMarkerPos [-(getMarkerPos "m_alpha" select 0),-(getMarkerPos "m_alpha" select 1)]; 

i screw up my init.sqf

Code: [Select]
server execVM "revive_init.sqf";
server execVM "briefing.sqf";

skiptime Param1;
setViewDistance 2500;
1 setRadioMsg "NULL";
2 setRadioMsg "NULL";
3 setRadioMsg "NULL";
4 setRadioMsg "NULL";

if (isServer) then {one=false; publicVariable "one"};
if (isServer) then {two=false; publicVariable "two"};
if (isServer) then {three=false; publicVariable "three"};
if (isServer) then {four=false; publicVariable "four"};
if (isServer) then {five=false; publicVariable "five"};
if (isServer) then {six=false; publicVariable "six"};
if (isServer) then {seven=false; publicVariable "seven"};
if (isServer) then {alert=false; publicVariable "alert"};
if (isServer) then {fin=false; publicVariable "fin"};
if (isServer) then {noreds=false; publicVariable "noreds"};
if (isServer) then {landed=false; publicVariable "landed"};

sleep 5;

PlayMusic "start";
0 fadeMusic 1;

};
    };


can anyone explain where  and how to insert the hide marker  code ?

again im sorry for my noobishness and for pestering you lot ...
that knock on the head  has fecked me up
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: init.sqf and UPS problems
« Reply #1 on: 18 Jul 2009, 15:39:43 »
Simpler method is just to delete the markers on the client machines, leaving them where they are on the server.
Code: [Select]
server execVM "revive_init.sqf";
server execVM "briefing.sqf";

skiptime Param1;
setViewDistance 2500;
1 setRadioMsg "NULL";
2 setRadioMsg "NULL";
3 setRadioMsg "NULL";
4 setRadioMsg "NULL";

// Might as well merge all the isServer blocks.
if (isServer) then {
  one=false; publicVariable "one";
  two=false; publicVariable "two";
  three=false; publicVariable "three";
  four=false; publicVariable "four";
  five=false; publicVariable "five";
  six=false; publicVariable "six";
  seven=false; publicVariable "seven";
  alert=false; publicVariable "alert";
  fin=false; publicVariable "fin";
  noreds=false; publicVariable "noreds";
  landed=false; publicVariable "landed";
};

// Delete all the markers on the client machines (leaving them on the server).
if (not isServer) then
{
  {
    deleteMarkerLocal _x;
  } forEach ["m_alpha", "m_beta"]; // List of markers to delete.
};

// Wait until the briefing is over.
if (not isDedicated) then { waitUntil { alive player } };
waitUntil { time > 0 };

// Call UPS now.

PlayMusic "start";
0 fadeMusic 1;
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: init.sqf and UPS problems
« Reply #2 on: 18 Jul 2009, 17:14:22 »
To be honest, Spooner, it's best to do it the way the OP mentioned (as suggested by Kronzky), as then it remains 'compatible' for non-dedicated hosts, too, rather than the host seeing the markers.

The following works perfectly for me in a number of missions:
Code: [Select]
if (isServer) then {
    "patrolMarker" setMarkerPos [-(getMarkerPos "patrolMarker" select 0),-(getMarkerPos "patrolMarker" select 1)];
};

This can be inserted anywhere in the init.sqf.  Just add more lines for more markers.