Jump to content

Lucullus

Member
  • Content Count

    134
  • Joined

  • Last visited

  • Medals

Posts posted by Lucullus


  1. Give your playable units a variable name such as: P01.
    Replace "player" with the "P01" and you have the solution.
    The server doesn´t know player but P01.

    {_x in H1} count (units group P01) == {alive _x} count (units group P01);

    Player is a command that points to an object and works only on clients or client-server, not on dedicated-server.

     

    It would be better to give the different groups a name, for example: G01.

     

    Edit: ... and welcome to the Arma MP Universe, there are a lot of stumbling blocks left ...

    • Thanks 1

  2. For vehicles you could do it like this:

    tag_fnc_used_mags =
    {	_mags = magazinesAllTurrets _this;
    	private _used_mags = [];
    	{	_x params ["_mag","_turret","_count"];
    		if (getNumber (configfile >> "CfgMagazines" >> _mag >> "count") > _count) then
    		{	_used_mags pushBack _mag
    		};
    	} forEach _mags;
    	_used_mags
    };

    Call e.g. with: vehicle player call tag_fnc_used_mags

    Spits out an array of used magazines.

    So many ways to do something...

     

    • Like 2

  3. I had done this last year:

    tag_fnc_PylonArray =
    {	// predefine the return value
    	private _returnArray = [];
    	// read all existing magazines in the pylons
    	_arrPylonMagazines = getPylonMagazines _this;
    	// create the return array using the config
    	{	_returnArray pushback
    		[	// pylon name
    			_x,
    			// pylon magazine
    			_arrPylonMagazines select _forEachIndex,
    			// amount of ammunition
    			_this ammoOnPylon _x
    		]
    	} forEach ("true" configClasses (configFile>>"CfgVehicles">>typeOf _this>>"Components">>"TransportPylonsComponent">>"pylons") apply {configName _x});
    	_returnArray
    };

    Call e.g. with: vehicle player call tag_fnc_PylonArray;

    The function gives you e.g. the following array back:

    [	["Pylons1","PylonRack_1Rnd_Missile_AA_04_F",1],
    	["Pylons2","PylonRack_7Rnd_Rocket_04_HE_F",7],
    	["Pylons3","PylonRack_3Rnd_Missile_AGM_02_F",3],
    	["Pylons4","PylonMissile_1Rnd_Bomb_04_F",1],
    	["Pylons5","PylonMissile_1Rnd_Bomb_04_F",1],
    	["Pylons6","PylonMissile_1Rnd_Bomb_04_F",1],
    	["Pylons7","PylonMissile_1Rnd_Bomb_04_F",1],
    	["Pylons8","PylonRack_3Rnd_Missile_AGM_02_F",3],
    	["Pylons9","PylonRack_7Rnd_Rocket_04_AP_F",7],
    	["Pylons10","PylonRack_1Rnd_Missile_AA_04_F",1]
    ]

    [ ["pylon name","pylon magazine",amount of ammunition], ...]

    With the help of the array you can quickly see which ammunition needs to be filled up.

     

    • Like 1

  4. Maybe, but you can try the difference.

     

    From my ArmaArcade mission onPlayerKilled.sqf:

    params ["_oldUnit","_killer"];
    _load = getUnitLoadout _oldUnit;
    
    // a few more lines...
    
    waitUntil
    {	sleep 0.1;
    	!isNull player
    };
    player setUnitLoadout [_load,false];

     

    • Like 1
    • Thanks 1
×