Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions addons/main/cfgVehiclesModulesFa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,25 @@ class Fa_Module_Unflip_Vehicle : Fa_Fa_Module_Base
function = "tac1_admin_fnc_UnflipVehicle";
};

class Fa_Module_Reset_Downed_Player : Fa_Fa_Module_Base
class Fa_Module_Reset_Downed_PlayerOld : Fa_Fa_Module_Base
{
scopeCurator = 2;
displayName = "Reset downed player";
function = "tac1_admin_fnc_ResetDownedPlayer";
displayName = "Reset downed player (SWS)";
function = "tac1_admin_fnc_ResetDownedPlayerOld";
};

class Fa_Module_Reset_Downed_PlayerFAM : Fa_Fa_Module_Base
{
scopeCurator = 2;
displayName = "Reset downed player (FAM)";
function = "tac1_admin_fnc_ResetDownedPlayerFAM";
};

class Fa_Module_Reset_Downed_PlayerVanilla : Fa_Fa_Module_Base
{
scopeCurator = 2;
displayName = "Reset downed player (vanilla)";
function = "tac1_admin_fnc_ResetDownedPlayerVanilla";
};

class Fa_Module_Repair_Vehicle : Fa_Fa_Module_Base
Expand All @@ -20,6 +34,13 @@ class Fa_Module_Repair_Vehicle : Fa_Fa_Module_Base
function = "tac1_admin_fnc_RepairVehicle";
};

class Fa_Module_AddVehicleFA3FCS : Fa_Fa_Module_Base
{
scopeCurator = 2;
displayName = "Add FA3 FCS to vehicle";
function = "tac1_admin_fnc_AddVehicleFA3FCS";
};

class Fa_Module_Heal_Player : Fa_Fa_Module_Base
{
scopeCurator = 2;
Expand All @@ -32,4 +53,11 @@ class Fa_Module_Resurrect_Player : Fa_Fa_Module_Base
scopeCurator = 2;
displayName = "Resurrect player";
function = "tac1_admin_fnc_ResurrectPlayer";
};

class Fa_Module_SlapPlayer : Fa_Fa_Module_Base
{
scopeCurator = 2;
displayName = "Slap player";
function = "tac1_admin_fnc_slapPlayer";
};
14 changes: 9 additions & 5 deletions addons/main/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CfgFunctions
class actionGroupTeleport {};
class actionPlayerTeleport {};
class actionZeusAddAllObjects {};
class addVehicleFA3FCS{};
class endMissionInstant {};
class endMissionSmooth {};
class fillMissionEndingBox {};
Expand All @@ -52,11 +53,14 @@ class CfgFunctions
class teleportMapClick {};
class teleportMapLoaded {};
class messageAdmin {};
class UnflipVehicle;
class ResetDownedPlayer;
class HealPlayer;
class RepairVehicle;
class ResurrectPlayer;
class UnflipVehicle{};
class ResetDownedPlayerOld{};
class ResetDownedPlayerFAM{};
class ResetDownedPlayerVanilla{};
class HealPlayer{};
class RepairVehicle{};
class ResurrectPlayer{};
class SlapPlayer{};
};
class scripts
{
Expand Down
32 changes: 32 additions & 0 deletions addons/main/func/fn_AddVehicleFA3FCS.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "\1tac_admin\module_header.hpp"

if (isNil "f_fnc_fcsInit") exitWith { systemChat "FA ADMIN ZEUS MODULE: FA3 FCS module not present in mission.";};

private _vehicleToFCS = (position _logic) nearestObject "LandVehicle";
private _displayName = getText (configOf _vehicleToFCS >> "displayName");

titleText [format ["Selected vehicle - %1 - press ENTER within 10 seconds to confirm",_displayName],"PLAIN"];

uiNamespace setVariable ["fa_admin_vehicleToFCS",_vehicleToFCS];
private _EH = (findDisplay 46) displayAddEventHandler ["KeyDown",{
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
if (_key in [156,28]) then {
private _vehicle = uiNamespace getVariable ["fa_admin_vehicleToFCS",objNull];
if (alive _vehicle) then {
[_vehicle] remoteExec ["f_fnc_fcsInit",0];
};
(findDisplay 46) displayRemoveEventHandler _thisEventHandler;
uiNamespace setVariable ["fa_admin_vehicleToFCS",objNull];
true
} else {
false
};
}];

_EH spawn {
sleep 10;
(findDisplay 46) displayRemoveEventHandler _EH;
uiNamespace setVariable ["fa_admin_vehicleToFCS",objNull];
};

#include "\1tac_admin\module_footer.hpp"
4 changes: 2 additions & 2 deletions addons/main/func/fn_HealPlayer.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "\1tac_admin\module_header.hpp"
menToHeal = (position _logic) nearEntities [["Man"], 2];
private _menToHeal = (position _logic) nearEntities [["CAManBase"], 2];
{
_x setDamage 0;
} forEach menToHeal;
} forEach _menToHeal;

#include "\1tac_admin\module_footer.hpp"
10 changes: 10 additions & 0 deletions addons/main/func/fn_ResetDownedPlayerFAM.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "\1tac_admin\module_header.hpp"
private _downedUnits = (position _logic) nearEntities [["CAManBase"], 1];
{
if(isPlayer _x) then
{
[_x] remoteExec ["f_fnc_famReset", _x] ;
};
} forEach _downedUnits;

#include "\1tac_admin\module_footer.hpp"
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "\1tac_admin\module_header.hpp"
downedUnits = (position _logic) nearEntities [["Man"], 1];
private _downedUnits = (position _logic) nearEntities [["CAManBase"], 1];
{

// if unit is down , revive him.
if(_x getVariable ["f_wound_down",false] ) then
{
[_x,false] remoteExec ["f_fnc_SetDowned", _x, false] ;
[_x,false] remoteExec ["f_fnc_SetDowned", _x];
};

if(_x getVariable ["f_wound_bleeding",false]) then {
[_x,false] remoteExec ["f_fnc_SetBleeding", _x, false] ;
[_x,false] remoteExec ["f_fnc_SetBleeding", _x];
};
} forEach downedUnits;
} forEach _downedUnits;

#include "\1tac_admin\module_footer.hpp"
13 changes: 13 additions & 0 deletions addons/main/func/fn_ResetDownedPlayerVanilla.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "\1tac_admin\module_header.hpp"
private _downedUnits = (position _logic) nearEntities [["CAManBase"], 1];
{

// if unit is down , revive him.
if(isPlayer _x) then
{
["#rev",1,_x] remoteExecCall ["BIS_fnc_reviveOnState", _x] ;
};

} forEach _downedUnits;

#include "\1tac_admin\module_footer.hpp"
44 changes: 22 additions & 22 deletions addons/main/func/fn_ResurrectPlayer.sqf
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "\1tac_admin\module_header.hpp"

if(isNil "initRunner") then {
initRunner = {
_corpse = _this select 0;
_unit = _this select 1;
if(isNil "fa_admin_fnc_initRunner") then {
fa_admin_fnc_initRunner = compileFinal {
params ["_corpse","_unit"];
if(!isNil "F_fnc_ForceExit") then {
[] call F_fnc_ForceExit;
f_cam_VirtualCreated = nil;
Expand All @@ -13,36 +12,37 @@ if(isNil "initRunner") then {

setPlayable _unit;
selectPlayer _unit;
_corpse setName format ["Ressurection%1", round(random 20000)];
_corpse setName format ["Resurrection%1", round(random 20000)];
_init = compile preprocessFile "init.sqf";
_handle = [] spawn _init;
waitUntil{scriptDone _handle};
waitUntil {scriptDone _handle};
deleteVehicle _corpse;
};
publicVariable "fa_admin_fnc_initRunner";
};


serverRunner = {
{
_logicPos = _this select 0;
diag_log format ["comparing %1", (name _x)];
if((_logicPos distance _x) < 2 && (owner _x != 2)) then {
_unit = (group _x) createUnit [(typeOf _x), position _x, [], 0, "NONE"];
_unit setName format ["Ressurection%1", round(random 20000)];
waitUntil{!isNil "_unit"};
(group _unit) setGroupOwner (owner _x);
[_x, _unit] remoteExec ["initRunner", (owner _x), false];
};
}forEach allDead;
if (isNil "fa_admin_fnc_serverRunner") then {
fa_admin_fnc_serverRunner = compileFinal {
{
private _logicPos = _this select 0;
diag_log format ["comparing %1", (name _x)];
if((_logicPos distance _x) < 2 && (owner _x != 2)) then {
_unit = (group _x) createUnit [(typeOf _x), position _x, [], 0, "NONE"];
_unit setName format ["Resurrection%1", round(random 20000)];
waitUntil{!isNil "_unit"};
(group _unit) setGroupOwner (owner _x);
[_x, _unit] remoteExec ["fa_admin_fnc_initRunner", (owner _x)];
};
}forEach allDead;
};
publicVariable "fa_admin_fnc_serverRunner";
};

publicVariable "loadoutCopy";
publicVariable "initRunner";
publicVariable "serverRunner";

_logicPos = (position _logic);

[_logicPos] remoteExec ["serverRunner", 2, false];
[_logicPos] remoteExec ["fa_admin_fnc_serverRunner", 2];

#include "\1tac_admin\module_footer.hpp"

47 changes: 47 additions & 0 deletions addons/main/func/fn_SlapPlayer.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "\1tac_admin\module_header.hpp"

if (isNil "fa_admin_fnc_slapPlayerLocal") then {
fa_admin_fnc_slapPlayer = {
params ["_unit"];
private _oldDamageState = isDamageAllowed _unit;
_unit allowDamage false;
private _randomStage1 = [
random [-1, selectRandom [0.5,-0.5], 1],
random [-1, selectRandom [0.5,-0.5], 1]
];
private _randomStage2 = [selectRandom _randomStage1, selectRandom _randomStage1, 0.5];
_unit addForce [_randomStage2 vectorMultiply 4000, [0,0,1]];
sleep 10;
_unit setUnconscious false;
_unit allowDamage _oldDamageState;
_unit playMoveNow "amovppnemstpsraswrfldnon";
};
publicVariable "fa_admin_fnc_slapPlayerLocal";
};

private _targetUnit = (position _logic) nearestObject "CAManBase";
titleText [format ["Selected player - %1 - press ENTER within 10 seconds to confirm",name _targetUnit],"PLAIN"];

uiNamespace setVariable ["fa_admin_playerToSlap",_targetUnit
private _EH = (findDisplay 46) displayAddEventHandler ["KeyDown",{
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
if (_key in [156,28]) then {
private _unit = uiNamespace getVariable ["fa_admin_playerToSlap",objNull];
if (alive _unit) then {
[_unit] remoteExec ["fa_admin_fnc_slapPlayerLocal",_unit];
};
(findDisplay 46) displayRemoveEventHandler _thisEventHandler;
uiNamespace setVariable ["fa_admin_playerToSlap",objNull];
true
} else {
false
};
}];

_EH spawn {
sleep 10;
(findDisplay 46) displayRemoveEventHandler _EH;
uiNamespace setVariable ["fa_admin_playerToSlap",objNull];
};

#include "\1tac_admin\module_footer.hpp"
6 changes: 3 additions & 3 deletions addons/main/func/fn_UnflipVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ if (isNil "fa_UnflipVehicleFunction") then {
publicVariable "fa_UnflipVehicleFunction";
};

vehicleFlipped = (position _logic) nearEntities [["Car"], 10];
private _vehicleFlipped = (position _logic) nearEntities [["LandVehicle"], 10];
{
[_x, "fa_UnflipVehicleFunction", true] spawn BIS_fnc_MP;
} forEach vehicleFlipped;
[_x] remoteExec ["fa_UnflipVehicleFunction",_x];
} forEach _vehicleFlipped;

#include "\1tac_admin\module_footer.hpp"