Jump to content

Schatten

Member
  • Content Count

    782
  • Joined

  • Last visited

  • Medals

Everything posted by Schatten

  1. Schatten

    Name Tags JIP issues

    It contains if !(hasInterface) exitWith {}; at the beginning, so it will work only on client PCs. I would recommend to rewrite the script that it will be client only.
  2. @dernikkl1, try this: { _x action ["GetOut", _vehicle]; } forEach ((crew _vehicle) - [player]);
  3. @Dj Rolnik, trigger statements are local, i.e. they are executed by each client. At the same time you use remoteExec. It means that if the trigger condition is true, the code placed in "On activation" field is executed by each client. This leads to duplicating actions. To solve the problem either make your trigger server only, or don't use remoteExec.
  4. There are getTriggerXXX commands. Can you provide full error message got from RPT-file?
  5. @doctorbutts, as far as I remember, if an object is attached to a trigger using triggerAttachVehicle command, then the object is accessible through thisList variable, so try to use this code: _healed_trig setTriggerStatements [ "this && { _victim = thisList select 0; !([_victim] call ace_medical_blood_fnc_isBleeding) && { [_victim] call ace_common_fnc_isAwake } }", "hint 'victim healed';", "" ]; Also you can use getVariable and setVariable commands to transfer variables between the trigger and your code: _healed_trig setTriggerStatements [ "this && { _victim = thisTrigger getVariable 'victim'; !([_victim] call ace_medical_blood_fnc_isBleeding) && { [_victim] call ace_common_fnc_isAwake } }", "hint 'victim healed';", "" ]; _healed_trig setVariable ["victim", _victim];
  6. Schatten

    Help with set/get variable

    Yes, you don't need to delete variables using setVariable before deleting an object.
  7. Schatten

    Help with set/get variable

    @Robustcolor, use this code: _respawnPositionAdded = false; for "_i" from 1 to 5 do { _veh = "Jeep" createVehicle [0,0,0]; _veh setVariable ["RWPoint", false]; if (!_respawnPositionAdded) then { [west, _veh] call BIS_fnc_addRespawnPosition; _veh setVariable ["RWPoint", true]; _respawnPositionAdded = true; }; }; But in this code only the first vehicle will always be added to respawn positions. If you need that random vehicle will be added, then use this code: _vehicles = []; for "_i" from 1 to 5 do { _veh = "Jeep" createVehicle [0,0,0]; _veh setVariable ["RWPoint", false]; _vehicles pushBack _veh; }; (selectRandom _vehicles) setVariable ["RWPoint", true]; Next, you should check vehicle variable before deleting vehicle itself: params ["_veh"]; if (_veh getVariable ["RWPoint", false]) then { [_veh] call BIS_fnc_removeRespawnPosition; }; deleteVehicle _veh;
  8. @CY4, use this code: _loadoutWeightsInfo = thisList apply { format ["%1: %2lbs", name _x, (round ((loadAbs _x) * 10)) / 10 ^ 2] }; hintSilent (parseText (format ["Loadout Weight<br/>%1", _loadoutWeightsInfo joinString "<br/>"]));
  9. Schatten

    execVM not running?

    call command doesn't accept path to a function. Also, you already added your function into function library, so use this code: remoteExec ["AURA_fnc_SFInteraction"];
  10. Schatten

    hint parseText for MP

    @7erra, thanks for the clarification. It's possible to use this simplified code: { hint parseText "Who<br/><img size='5' image='pic\man.jpg'/><br/>is it?"; } remoteExec ["call"];
  11. Schatten

    hint parseText for MP

    @major-stiffy, try this: (parseText "Who<br/><img size= '5' image='pic\man.jpg'/><br/>is it?") remoteExec ["hint"];
  12. You can create 35 markers and the script, that creates 105 triggers. Also, I missed that your trigger is activated by any player, so here is updated version: - trigger condition: (this and { !(thisTrigger getVariable ["script1Started", false]) }) or { _unit = thisList select 0; (((_unit distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) or { ((_unit distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) } } } - on activation: if (!(thisTrigger getVariable ["script1Started", false])) then { execVM "scripts\scripts_1.sqf"; thisTrigger setVariable ["script1Started", true]; }; call { _unit = thisList select 0; if (((_unit distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) then { execVM "scripts\scripts_2.sqf"; thisTrigger setVariable ["script2Started", true]; }; if (((_unit distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) }) then { execVM "scripts\scripts_3.sqf"; thisTrigger setVariable ["script3Started", true]; }; };
  13. @Coladebote, trigger condition: (this and { !(thisTrigger getVariable ["script1Started", false]) }) or { ((player distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) } } or { ((player distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) } } on activation: if (!(thisTrigger getVariable ["script1Started", false])) then { execVM "scripts\scripts_1.sqf"; thisTrigger setVariable ["script1Started", true]; }; if (((player distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) then { execVM "scripts\scripts_2.sqf"; thisTrigger setVariable ["script2Started", true]; }; if (((player distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) }) then { execVM "scripts\scripts_3.sqf"; thisTrigger setVariable ["script3Started", true]; }; Seems that creating 3 triggers can be simpler.
  14. How exactly do you run it? You should pass path to a file: execVM "myCode.sqf";
  15. I guess you need this: _marker = allMapMarkers select (allMapMarkers findIf { (markerColor _x) == "ColorOPFOR" });
  16. Sure, call { private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { if (((getMarkerColor _x) == "ColorOPFOR") and { _distance = (getMarkerPos _x) distance2D player; (_distance >= 400) and { _distance < _distanceMin } }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; _marker };
  17. distance2D can accept objects, so you don't need to get position in advance. How did you test? If you just copy and paste the code into console, then it won't work. Instead you should wrap it: call { private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { _distance = (getMarkerPos _x) distance2D player; if ((_distance >= 400) and { _distance < _distanceMin }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; _marker };
  18. @Sayker, something like this: private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { _distance = (getMarkerPos _x) distance2D player; if ((_distance >= 400) and { _distance < _distanceMin }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; ?
  19. ([tank1, tank2, tank3, tank4] findIf { (damage _x) >= 0.8 }) >= 0 ({ (damage _x) >= 0.8 } count [tank1, tank2, tank3, tank4]) == 2 ({ (damage _x) >= 0.8 } count [tank1, tank2, tank3, tank4]) == 3 ([tank1, tank2, tank3, tank4] findIf { (damage _x) < 0.8 }) < 0
  20. @Luft08, use this code: #define MARKER "markerName" private _markerSize = getMarkerSize MARKER; private _radius = if ((markerShape MARKER) == "RECTANGLE") then { sqrt ((_markerSize select 0) ^ 2 + (_markerSize select 1) ^ 2); } else { selectMax _markerSize; }; private _minesCount = { _x inArea MARKER } count ((getMarkerPos MARKER) nearObjects ["APERSBoundingMine_Range_Ammo", _radius]);
  21. @gc8, BIS_fnc_holdActionAdd returns action ID. I'm sure you can use it to change the title using setUserActionText command.
  22. Schatten

    1 person view in town

    @Casio91Fin, condition: this && { (vehicle player) in thisList } && { cameraView == "EXTERNAL" } On activation: (vehicle player) switchCamera "INTERNAL"; titleText ["You are\nIN\n1stPV Area!", "PLAIN DOWN", 3];
  23. @pSiKO, if you kill someone from a vehicle, _killer will be the vehicle. You can use this workaround: params ["_unit", "_killer", "_instigator"]; if (!(isNull _instigator)) then { _killer = _instigator; } else { if (!(_killer isKindOf "CAManBase")) then { _killer = effectiveCommander _killer; }; };
  24. _spawn isn't available inside "On deact." field, but you can save action ID in the trigger object: - On act.: thisTrigger setVariable ["actionId", player addAction ["Spawn Units", "spawn.sqf"]]; - On deact.: _actionId = thisTrigger getVariable ["actionId", -1]; if (_actionId >= 0) then { player removeAction _actionId; };
  25. @redarmy, unfortunately, you need to write a script that will monitor each unit in a group and order those of them to return to initial position. Here is example: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/0554cc7aabc300d2a92a85df361ad5e1dba140db/server/functions/defendArea.sqf#L78
×