OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: sharkattack 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
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
-
Simpler method is just to delete the markers on the client machines, leaving them where they are on the server.
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;
-
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:
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.