Jump to content

Dyeg0

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Posts posted by Dyeg0


  1. On 7/17/2021 at 6:03 PM, Harzach said:

     

    What is "playerunit" - where is it defined?

     

    Why are you using initPlayerServer.sqf ?

     

    Because I already tried other formats.

    It works well in SP, but not in MP.

    Originally, it was:

    player == JTAC

    (name of specific player).

     

    Also, before, it was in an initPlayerLocal (as MIL_SPEC had suggested up here), so I thought that this would work fine executed on initPlayerServer.

     

    I'm just trying to get it to work in MP, that's all.

     


  2. cool little script to make ai units join you in-game:

     

    1. Place your player on the map
    2. Place as many AI units you desire
    3. Name each the AI unit a specific Variable Name. Example: AIsoldier_1, AIsoldier_2, AIsoldier_3, etc. The Variable Name should be unique and placed in each ai attribute (under Variable Name)
    4. Place a no space trigger 

    under "Trigger: Expression"
            Condition

    player distance AIsoldier_1 <2

            On Activation:

    [AIsoldier_1] join player;

     

    You will have to walk up to the ai unit (within 2 meters according to this script) to have it join your squad.

    Picture

    • Like 1

  3. On 1/23/2021 at 11:21 PM, Alex Dyre said:

    Just wanted to add a little bit of info for others to this awesome script.

    At least for me, this does not work on a dedicated server.

     

    To run the MIL_CAS on a dedicated server you need to remote execute the function to the server as the BIS_fnc_moduleCAS will exit if not executed on the server.

     

    I call in CAS through radio triggers and the command looks something like this for it to work on a dedicated server.

    
    _tr3 setTriggerStatements ["this", "[[screenToWorld [0.5,0.5],getDir player, 'I_Plane_Fighter_03_dynamicLoadout_F', 3], 'MIL_CAS.sqf'] remoteExec['BIS_fnc_execVM',2];", ""];

    Which uses the position of the terrain the player is looking at, and the direction the player is facing.

    How did you do that?

    I'm trying to get this to work in Multiplayer, but getting nowhere so far.

     

    This is what I have at the moment:

    (calls gun run followed by a playsound3D and a 180 second cooldown with the hint to player to wait for the cooldown. works very well in singlepayer though)

     

    initPlayerServer.sqf

    if (playerunit == JTAC) then {
    	_id = playerunit addAction [
    		"<t color='#FF0000'>Call for Gun Run</t>",
    		{
    			params ["_target","","_id"];
    if (diag_tickTime < (uiNamespace getVariable ['tag_cooldown',-1])) exitWith {
    hint (format ['CAS Pilots are busy doing runs. Please wait %1 more seconds.',(round ((uiNamespace getVariable ['tag_cooldown',-1]) -diag_tickTime))]);};
    _cooldown = 180;
    uiNamespace setVariable ['tag_cooldown',(diag_tickTime + _cooldown)];
    			nul = [screenToWorld [0.5,0.5],200,"B_Plane_CAS_01_F",0] execVM "MIL_CAS.sqf";
    _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
    _soundToPlay = _soundPath + "sounds\radio4guns.ogg";
    playSound3D [_soundToPlay,soundSource];
    		},
    		nil,
    		0,
    		true,
    		true,
    		"",
    		"alive _target",
    		-1,
    		false
    	];
    };

     

×