I have a problem with my "Deploy Rally Point" script. It seems to work fine for the leader "s1", but only if the host is s1. If somebody else takes the leader s1 slot, they are not able to deploy the Rally Point at all. I had the script working in another mission I made, but this time I have written the script a little differently. In the past when the Rally Point was deployed, it would first delete the old Rally Point and then create a new one, but this time I have placed the Rally Point at base and when it is deployed someplace else - I simply setPos the Rally Point in the new position. Again everything seems to be working ok, except it only seems to work if the host is player s1.
init.sqf
Repeating trigger at base tells player s1 to exec this:Code:if (isServer) then { rallyMoved=false; publicVariable "rallyMoved"; };
s1_add_deploy_rally.sqf
s1_deploy_rally.sqf:Code:if (alive s1) then { _actS1 = s1 addAction ["Deploy Rally Point", "rally\s1_deploy_rally.sqf", [], -1, false, true, "", "(_target == _this) && (speed s1) < 7"];
so can anybody help me fix this so it works for anybody that choose the leader s1 slot, and not just the host?Code:_manS1 = _this select 0; _actS1 = _this select 2; if (alive s1 and rallyTimer>0) then { hint "10 minutes has not yet passed."; sleep 6; hint ""; } else { rallyTimer=1; rallyMoved = false; publicVariable "rallyMoved"; waitUntil {!isNil "rallyMoved"}; _manS1 switchMove "AinvPknlMstpSlayWrflDnon_medic"; sleep 3; _manS1 switchMove "amovpknlmstpsraswrfldnon_gear"; nest setDir ((direction _manS1) -180); nest setPos (_manS1 modelToWorld [0.5,1.4,((position _manS1) select 2)]); crate setDir ((direction _manS1) -90); crate setPos (_manS1 modelToWorld [1.18,1.85,((position _manS1) select 2)-0.12]); nest setpos [(getpos nest) select 0, (getpos nest) select 1, -0.1]; crate setpos [(getpos crate) select 0, (getpos crate) select 1, -0.1]; teleport_to_object setDir ((direction _manS1) -90); teleport_to_object setPos (_manS1 modelToWorld [-0.2,+0.6,((position _manS1) select 2)-2]); "RallyPoint" setMarkerPos getPos teleport_to_object; sleep 0.5; rallyMoved = true; publicVariable "rallyMoved"; waitUntil {!isNil "rallyMoved"}; waitUntil{!(isNil "BIS_MPF_InitDone")}; [s1,nil,rGLOBALCHAT,"Rally Point deployed and marked on map."] call RE; sleep 6; hint "You cannot deploy a new Rally Point until 10 minutes has passed."; sleep 6; hint ""; sleep 588; rallyTimer=0; waitUntil {alive s1}; hint composeText [parsetext format["<t size='1' align='center' color='#00FF00'>Rally Point deploy available.%1</t>"]]; };
HOME
Reply With Quote