You've already forked arma2-epoch-server
Initial
This commit is contained in:
88
MPMissions/DayZ_Epoch_24.Napf/logistic/compiles.sqf
Executable file
88
MPMissions/DayZ_Epoch_24.Napf/logistic/compiles.sqf
Executable file
@ -0,0 +1,88 @@
|
||||
if (!isDedicated) then {
|
||||
|
||||
call compile preprocessFileLineNumbers "logistic\config.sqf";
|
||||
call compile preprocessFileLineNumbers format ["logistic\lang\%1_lang.sqf", LOG_CFG_lANG];
|
||||
|
||||
MONI_OBJECT = compile preprocessFileLineNumbers "logistic\monitor\monitor_object.sqf";
|
||||
MONI_ACTION = compile preprocessFileLineNumbers "logistic\monitor\monitor_action.sqf";
|
||||
LOG_OBJ_INIT = compile preprocessFileLineNumbers "logistic\object\init.sqf";
|
||||
LOG_LIFT_INIT = compile preprocessFileLineNumbers "logistic\lift\init.sqf";
|
||||
LOG_TOW_INIT = compile preprocessFileLineNumbers "logistic\tow\init.sqf";
|
||||
|
||||
LOG_FNCT_DETACH_AND_SAVE = {
|
||||
private ["_object"];
|
||||
_object = (_this select 0);
|
||||
_object setVelocity [0,0,0];
|
||||
detach _object;
|
||||
PVDZ_veh_Save = [_object,"position",true];
|
||||
if (isServer) then {
|
||||
PVDZ_veh_Save call server_updateObject;
|
||||
} else {
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
player playActionNow "Medic";
|
||||
[player,"repair",0,false,20] call dayz_zombieSpeak;
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
diag_log format [STR_LOG_UNTOWED, typeOf _object];
|
||||
};
|
||||
|
||||
LOG_FNCT_LOCKED = {
|
||||
private ["_return","_target"];
|
||||
_target = (_this select 0);
|
||||
_return = true;
|
||||
if ( !(LOG_CFG_ALLOW_LOCKED) && (locked _target) ) then {
|
||||
_return = false;
|
||||
};
|
||||
_return
|
||||
};
|
||||
|
||||
LOG_FNCT_CHAINING = {
|
||||
private ["_return","_target"];
|
||||
_target = (_this select 0);
|
||||
_return = true;
|
||||
if !(LOG_CFG_ALLOW_CHAINING) then {
|
||||
if ( ( (_this select 1) == 1 ) && !( isNull (_target getVariable "LOG_moves_by") || (!alive (_target getVariable "LOG_moves_by")) ) ) then {_return = false;};
|
||||
if ( (_this select 1) == 2 && !isNull (_target getVariable "LOG_trailer") ) then { _return = false;};
|
||||
};
|
||||
_return
|
||||
};
|
||||
|
||||
LOG_FNCT_GETPOS = {
|
||||
private "_pos";
|
||||
if (isNil {_this select 0}) exitWith {[0,0,0]};
|
||||
_thingy = _this select 0;
|
||||
_pos = getPosASL _thingy;
|
||||
if !(surfaceIsWater _pos) then { _pos = ASLToATL _pos;};
|
||||
_pos
|
||||
};
|
||||
|
||||
LOG_OBJECT_MOVES = objNull;
|
||||
LOG_OBJECT_SELECTION = objNull;
|
||||
LOG_OBJECT_ADDACTION = objNull;
|
||||
LOG_INPROGRESS = false;
|
||||
LOG_LOAD_MOVES_VALID = false;
|
||||
LOG_LOAD_SELECTION_VALID = false;
|
||||
LOG_CONTENT_VALID = false;
|
||||
LOG_TRAILER_MOVE_VALID = false;
|
||||
LOG_TRAILER_SELECT_VALID = false;
|
||||
LOG_HELI_LIFT_VALID = false;
|
||||
LOG_HELI_DROP_VALID = false;
|
||||
LOG_OBJECT_TRAILER_VALID = false;
|
||||
LOG_DETACH_VALID = false;
|
||||
|
||||
|
||||
COLOR_DEFAULT = [(51/255),(181/255),(229/255),1];
|
||||
COLOR_SUCCESS = [(153/255),(204/255),0,1];
|
||||
COLOR_ERROR = [1,(68/255),(68/255),1];
|
||||
|
||||
SAM_SAYS = {
|
||||
private ["_message","_color"];
|
||||
_message = _this select 0;
|
||||
_color = _this select 1;
|
||||
taskHint [format[_message], _color, "taskNew"];
|
||||
_message call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
LOG_READY = true;
|
||||
};
|
37
MPMissions/DayZ_Epoch_24.Napf/logistic/config.sqf
Executable file
37
MPMissions/DayZ_Epoch_24.Napf/logistic/config.sqf
Executable file
@ -0,0 +1,37 @@
|
||||
|
||||
LOG_CFG_lANG = "en"; /* en = english , de = german , fr = french */
|
||||
LOG_CFG_ALLOW_LOCKED = false; /* allow to transport locked vehicles */
|
||||
LOG_CFG_ALLOW_CHAINING = false; /* allow chain towing */
|
||||
LOG_CFG_ALLOW_GETIN = true; /* allow player to get into a towed / lifted object */
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------
|
||||
LIST OF VEHICLES WHERE CAN TOW
|
||||
---------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
LOG_CFG_CANTOW=[
|
||||
"Car","Tank","Ship","Motorcycle","ReammoBox_EP1"
|
||||
];
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------
|
||||
LIST OF VEHICLES WHERE IS TOWABLE
|
||||
---------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
LOG_CFG_ISTOWABLE=[
|
||||
"Car","Tank","Air","Ship","ReammoBox_EP1"
|
||||
];
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------
|
||||
LIST OF HELIS WHERE CAN LIFT
|
||||
---------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
LOG_CFG_CANLIFT=[
|
||||
"Plane","Helicopter"
|
||||
];
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------
|
||||
LIST OF VEHICLES WHERE IS LIFTABLE
|
||||
---------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
LOG_CFG_ISLIFTABLE=[
|
||||
"Car","Tank","Air","Ship","Motorcycle"
|
||||
];
|
9
MPMissions/DayZ_Epoch_24.Napf/logistic/init.sqf
Executable file
9
MPMissions/DayZ_Epoch_24.Napf/logistic/init.sqf
Executable file
@ -0,0 +1,9 @@
|
||||
if (!isDedicated) then {
|
||||
LOG_READY = false;
|
||||
call compile preprocessFileLineNumbers "logistic\compiles.sqf";
|
||||
waitUntil{LOG_READY};
|
||||
[] spawn MONI_OBJECT;
|
||||
sleep 0.1;
|
||||
[] spawn MONI_ACTION;
|
||||
};
|
||||
|
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/de_lang.sqf
Executable file
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/de_lang.sqf
Executable file
@ -0,0 +1,18 @@
|
||||
STR_LOG_LIFT = "OBJEKT KOPPELN";
|
||||
STR_LOG_ATTACHED = "OBJEKT '%1' GEKOPPELT.";
|
||||
STR_LOG_DROPPED = "OBJEKT '%1' ABGEKOPPELT.";
|
||||
STR_LOG_DROP = "OBJEKT ABKOPPELN";
|
||||
STR_LOG_CANT_LIFT_TOWING = "OBJEKT '%1' KANN NICHT HOCHGEZOGEN WERDEN, WEIL ES BEREITS ABGESCHLEPPT WIRD.";
|
||||
STR_LOG_CANT_LIFT_MOVING = "OBJEKT '%1' IST DICHT AN EINEM ANDEREN SPIELER DRAN.";
|
||||
STR_LOG_CANT_LIFT_PLAYER = "IM OBJEKT '%1' BEFINDET SICH EIN SPIELER.";
|
||||
STR_LOG_ALREADY = "DAS OBJEKT '%1' WIRD BEREITS VON EINEM ANDEREN OBJEKT TRANSPORTIERT.";
|
||||
STR_LOG_NOW_SELECT = "WÄHLE NUN DAS OBJEKT, DAS OBJEKT '%1' ABSCHLEPPEN SOLL...";
|
||||
STR_TOW_THIS = "DAS OBJEKT KOPPELN";
|
||||
STR_LOG_TUG_SELECT = "... AUSGEWÄHLTES OBJEKT MIT DIESEM ABSCHLEPPEN";
|
||||
STR_LOG_TOW = "ABSCHLEPPEN...";
|
||||
STR_LOG_UNTOW = "DAS OBJEKT ABKOPPELN";
|
||||
STR_LOG_TOO_FAR = "DAS OBJEKT '%1' IST ZU WEIT ENTFERNT ZUM KOPPELN.";
|
||||
STR_LOG_IMPOSSIBLE_VEHICLE = "NUR DER PILOT KANN DIESE OBJEKT ABKOPPELN.";
|
||||
STR_LOG_IN_TRANSIT = "DAS OBJEKT '%1' IST IN BEWEGUNG.";
|
||||
STR_LOG_INPROGRESS = "SORRY, ABER DIE DERZEITIGE AKTION IST NOCH NICHT BEENDET!";
|
||||
STR_LOG_UNTOWED = "OBJEKT '%1' WURDE ABGEKOPPELT.";
|
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/en_lang.sqf
Executable file
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/en_lang.sqf
Executable file
@ -0,0 +1,18 @@
|
||||
STR_LOG_LIFT = "LIFT OBJECT";
|
||||
STR_LOG_ATTACHED = "OBJECT '%1' ATTACHED.";
|
||||
STR_LOG_DROPPED = "OBJECT '%1' DROPPED.";
|
||||
STR_LOG_DROP = "DROP OBJECT";
|
||||
STR_LOG_CANT_LIFT_TOWING = "CAN NOT LIFT OBJECT '%1', BECAUSE IT'S TOWING ANOTHER OBJECT.";
|
||||
STR_LOG_CANT_LIFT_MOVING = "OBJECT '%1' IS BEING BY A PLAYER.";
|
||||
STR_LOG_CANT_LIFT_PLAYER = "THERE IS A PLAYER IN OBJECT '%1'.";
|
||||
STR_LOG_ALREADY = "OBJECT '%1' IS ALREADY TRANSPORTED BY ANOTHER OBJECT.";
|
||||
STR_LOG_NOW_SELECT = "SELECT THE OBJECT WHICH IS TO TOW WITH '%1'...";
|
||||
STR_TOW_THIS = "TOW OBJECT";
|
||||
STR_LOG_TUG_SELECT = "... TOW SELECTED OBJECT TO THIS OBJECT";
|
||||
STR_LOG_TOW = "TOW...";
|
||||
STR_LOG_UNTOW = "UNTOW OBJECT";
|
||||
STR_LOG_TOO_FAR = "OBJECT '%1' IS TOO FAR FROM THE OBJECT TO BE TOWED.";
|
||||
STR_LOG_IMPOSSIBLE_VEHICLE = "ONLY THE PILOT CAN DETACH THIS OBJECT.";
|
||||
STR_LOG_IN_TRANSIT = "OBJECT '%1' IS IN TRANSIT.";
|
||||
STR_LOG_INPROGRESS = "SORRY, BUT THE CURRENT OPERATION IS NOT FINISHED YET!";
|
||||
STR_LOG_UNTOWED = "OBJECT '%1' UNTOWED.";
|
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/fr_lang.sqf
Executable file
18
MPMissions/DayZ_Epoch_24.Napf/logistic/lang/fr_lang.sqf
Executable file
@ -0,0 +1,18 @@
|
||||
STR_LOG_LIFT = "Hélitreuiller l'objet";
|
||||
STR_LOG_ATTACHED = "Véhicule '%1' attaché.";
|
||||
STR_LOG_DROPPED = "Véhicule '%1' détaché.";
|
||||
STR_LOG_DROP = "Détacher l'objet";
|
||||
STR_LOG_CANT_LIFT_TOWING = "Véhicule non hélitreuillable '%1' car il tracte un autre objet.";
|
||||
STR_LOG_CANT_LIFT_MOVING = "Remorquage du véhicule '%1' en cours par un autre joueur.";
|
||||
STR_LOG_CANT_LIFT_PLAYER = "Il y a un joueur dans le véhicule '%1'.";
|
||||
STR_LOG_ALREADY = "Véhicule '%1' est déjà transporté par un autre véhicule.";
|
||||
STR_LOG_NOW_SELECT = "Sélectionner l'objet à remorquer avec '%1'.";
|
||||
STR_TOW_THIS = "Remorquer l'objet";
|
||||
STR_LOG_TUG_SELECT = "... remorquer le véhicule sélectionné à ce véhicule";
|
||||
STR_LOG_TOW = "Remorquage...";
|
||||
STR_LOG_UNTOW = "Détacher l'objet";
|
||||
STR_LOG_TOO_FAR = "Le véhicule '%1' est trop loin du véhicule à remorquer.";
|
||||
STR_LOG_IMPOSSIBLE_VEHICLE = "Seulement le conducteur peut détacher ce véhicule.";
|
||||
STR_LOG_IN_TRANSIT = "Véhicule '%1' est en mouvement.";
|
||||
STR_LOG_INPROGRESS = "L'opération n'est pas encore terminée!";
|
||||
STR_LOG_UNTOWED = "Véhicule '%1' détaché.";
|
13
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/drop.sqf
Executable file
13
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/drop.sqf
Executable file
@ -0,0 +1,13 @@
|
||||
if (LOG_INPROGRESS) then{
|
||||
[STR_LOG_INPROGRESS,COLOR_ERROR] call SAM_SAYS;
|
||||
}else{
|
||||
LOG_INPROGRESS = true;
|
||||
private ["_carrier","_object"];
|
||||
_carrier = _this select 0;
|
||||
_object = _carrier getVariable "LOG_heliporte";
|
||||
_carrier setVariable ["LOG_heliporte", objNull, true];
|
||||
_object setVariable ["LOG_moves_by", objNull, true];
|
||||
[_object] call LOG_FNCT_DETACH_AND_SAVE;
|
||||
[format [STR_LOG_DROPPED, getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName")],COLOR_SUCCESS] call SAM_SAYS;
|
||||
LOG_INPROGRESS = false;
|
||||
};
|
8
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/init.sqf
Executable file
8
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/init.sqf
Executable file
@ -0,0 +1,8 @@
|
||||
private ["_carrier","_disabled","_object"];
|
||||
_carrier = _this select 0;
|
||||
_disabled = _carrier getVariable "LOG_disabled";
|
||||
if (isNil "_disabled") then{ _carrier setVariable ["LOG_disabled",false];};
|
||||
_object = _carrier getVariable "LOG_heliporte";
|
||||
if (isNil "_object") then{ _carrier setVariable ["LOG_heliporte",objNull,false];};
|
||||
_carrier addAction [("<t color='#dddd00'>" + STR_LOG_LIFT + "</t>"),"logistic\lift\lift.sqf",[],0,true,true,"","LOG_OBJECT_ADDACTION == _target && LOG_HELI_LIFT_VALID"];
|
||||
_carrier addAction [("<t color='#dddd00'>" + STR_LOG_DROP + "</t>"),"logistic\lift\drop.sqf",[],0,true,true,"","LOG_OBJECT_ADDACTION == _target && LOG_HELI_DROP_VALID"];
|
35
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/lift.sqf
Executable file
35
MPMissions/DayZ_Epoch_24.Napf/logistic/lift/lift.sqf
Executable file
@ -0,0 +1,35 @@
|
||||
if (LOG_INPROGRESS) then{
|
||||
[STR_LOG_INPROGRESS,COLOR_ERROR] call SAM_SAYS;
|
||||
} else {
|
||||
LOG_INPROGRESS = true;
|
||||
private ["_heliporteur", "_object","_name"];
|
||||
_heliporteur = _this select 0;
|
||||
_object = nearestObjects [_heliporteur, LOG_CFG_ISLIFTABLE, 20];
|
||||
_object = _object - [_heliporteur];
|
||||
if (count _object > 0) then{
|
||||
_object = _object select 0;
|
||||
_name = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName");
|
||||
if !([_object] call LOG_FNCT_LOCKED) exitWith {LOG_INPROGRESS = false;};
|
||||
if !(_object getVariable "LOG_disabled") then {
|
||||
if (isNull (_object getVariable "LOG_moves_by")) then {
|
||||
if (count crew _object == 0) then{
|
||||
if (isNull (_object getVariable "LOG_moves_by") || (!alive (_object getVariable "LOG_moves_by"))) then{
|
||||
private ["_no_trailer", "_trailer"];
|
||||
_no_trailer = true;
|
||||
_trailer = _object getVariable "LOG_trailer";
|
||||
if !(isNil "_trailer") then{
|
||||
if !(isNull _trailer) then{ _no_trailer = false;};
|
||||
};
|
||||
if (_no_trailer) then{
|
||||
_heliporteur setVariable ["LOG_heliporte", _object, true];
|
||||
_object setVariable ["LOG_moves_by", _heliporteur, true];
|
||||
_object attachTo [_heliporteur, [0,0,(boundingBox _heliporteur select 0 select 2) - (boundingBox _object select 0 select 2) - (getPos _heliporteur select 2) + 0.5]];
|
||||
[ format [STR_LOG_ATTACHED,_name], COLOR_SUCCESS] call SAM_SAYS;
|
||||
}else{ [ format [STR_LOG_CANT_LIFT_TOWING,_name],COLOR_ERROR] call SAM_SAYS;};
|
||||
}else{[ format [STR_LOG_CANT_LIFT_MOVING,_name],COLOR_ERROR] call SAM_SAYS;};
|
||||
}else{[ format [STR_LOG_CANT_LIFT_PLAYER,_name],COLOR_ERROR] call SAM_SAYS;};
|
||||
}else{[ format [STR_LOG_ALREADY, _name],COLOR_ERROR] call SAM_SAYS;};
|
||||
};
|
||||
};
|
||||
LOG_INPROGRESS = false;
|
||||
};
|
52
MPMissions/DayZ_Epoch_24.Napf/logistic/monitor/monitor_action.sqf
Executable file
52
MPMissions/DayZ_Epoch_24.Napf/logistic/monitor/monitor_action.sqf
Executable file
@ -0,0 +1,52 @@
|
||||
private ["_target"];
|
||||
while {true} do{
|
||||
|
||||
LOG_OBJECT_ADDACTION = objNull;
|
||||
_target = cursorTarget;
|
||||
|
||||
if ( !(isNull _target) && ( player distance _target < 13 ) ) then{
|
||||
LOG_OBJECT_ADDACTION = _target;
|
||||
|
||||
if ({_target isKindOf _x} count LOG_CFG_ISTOWABLE > 0) then {
|
||||
LOG_OBJECT_TRAILER_VALID = (vehicle player == player && (alive _target) && (count crew _target == 0) &&
|
||||
isNull LOG_OBJECT_MOVES && isNull (_target getVariable "LOG_moves_by") &&
|
||||
(isNull (_target getVariable "LOG_moves_by") || (!alive (_target getVariable "LOG_moves_by"))) &&
|
||||
!(_target getVariable "LOG_disabled") && ( [_target] call LOG_FNCT_LOCKED ) && ( [_target,2] call LOG_FNCT_CHAINING ) );
|
||||
|
||||
LOG_DETACH_VALID = ( vehicle player == player && (isNull LOG_OBJECT_MOVES) && !isNull (_target getVariable "LOG_moves_by") && !(_target getVariable "LOG_disabled") );
|
||||
};
|
||||
|
||||
|
||||
if ({_target isKindOf _x} count LOG_CFG_CANTOW > 0) then {
|
||||
|
||||
LOG_TRAILER_MOVE_VALID = (vehicle player == player && (alive _target) && (!isNull LOG_OBJECT_MOVES) &&
|
||||
(alive LOG_OBJECT_MOVES) && !(LOG_OBJECT_MOVES getVariable "LOG_disabled") &&
|
||||
({LOG_OBJECT_MOVES isKindOf _x} count LOG_CFG_ISTOWABLE > 0) &&
|
||||
isNull (_target getVariable "LOG_trailer") && ([0,0,0] distance velocity _target < 6) &&
|
||||
(getPos _target select 2 < 2) && !(_target getVariable "LOG_disabled"));
|
||||
|
||||
LOG_TRAILER_SELECT_VALID = ( vehicle player == player && (alive _target) && (isNull LOG_OBJECT_MOVES) &&
|
||||
(!isNull LOG_OBJECT_SELECTION) && (LOG_OBJECT_SELECTION != _target) &&
|
||||
!(LOG_OBJECT_SELECTION getVariable "LOG_disabled") &&
|
||||
({LOG_OBJECT_SELECTION isKindOf _x} count LOG_CFG_ISTOWABLE > 0) &&
|
||||
isNull (_target getVariable "LOG_trailer") && ([0,0,0] distance velocity _target < 6) &&
|
||||
(getPos _target select 2 < 2) && !(_target getVariable "LOG_disabled") && ( [_target] call LOG_FNCT_LOCKED ) && ( [ _target,1] call LOG_FNCT_CHAINING ) );
|
||||
};
|
||||
};
|
||||
|
||||
if ({(vehicle player) isKindOf _x} count LOG_CFG_CANLIFT > 0) then{
|
||||
LOG_OBJECT_ADDACTION = vehicle player;
|
||||
LOG_TRAILER_MOVE_VALID = false;
|
||||
LOG_TRAILER_SELECT_VALID = false;
|
||||
|
||||
LOG_HELI_LIFT_VALID = (driver LOG_OBJECT_ADDACTION == player &&
|
||||
({_x != LOG_OBJECT_ADDACTION && !(_x getVariable "LOG_disabled") && [_x] call LOG_FNCT_LOCKED } count (nearestObjects [LOG_OBJECT_ADDACTION, LOG_CFG_ISLIFTABLE, 10]) > 0) &&
|
||||
isNull (LOG_OBJECT_ADDACTION getVariable "LOG_heliporte") && ([0,0,0] distance velocity LOG_OBJECT_ADDACTION < 8 ) && (getPos LOG_OBJECT_ADDACTION select 2 > 1) &&
|
||||
!(LOG_OBJECT_ADDACTION getVariable "LOG_disabled"));
|
||||
|
||||
LOG_HELI_DROP_VALID = (driver LOG_OBJECT_ADDACTION == player && !isNull (LOG_OBJECT_ADDACTION getVariable "LOG_heliporte") &&
|
||||
([0,0,0] distance velocity LOG_OBJECT_ADDACTION <= 10 ) && (getPos LOG_OBJECT_ADDACTION select 2 <= 40) && !(LOG_OBJECT_ADDACTION getVariable "LOG_disabled"));
|
||||
};
|
||||
|
||||
sleep 0.2;
|
||||
};
|
20
MPMissions/DayZ_Epoch_24.Napf/logistic/monitor/monitor_object.sqf
Executable file
20
MPMissions/DayZ_Epoch_24.Napf/logistic/monitor/monitor_object.sqf
Executable file
@ -0,0 +1,20 @@
|
||||
sleep 0.1;
|
||||
private ["_transportable","_known","_list","_count","_i","_object"];
|
||||
_transportable = LOG_CFG_ISTOWABLE + LOG_CFG_ISLIFTABLE;
|
||||
_known = [];
|
||||
while {true} do{
|
||||
if !(isNull player) then{
|
||||
_list = (vehicles + nearestObjects [player, ["Static"], 80]) - _known;
|
||||
_count = count _list;
|
||||
if (_count > 0) then{
|
||||
for [{_i = 0}, {_i < _count}, {_i = _i + 1}] do{
|
||||
_object = _list select _i;
|
||||
if ({_object isKindOf _x} count _transportable > 0) then{[_object] spawn LOG_OBJ_INIT;};//if look at
|
||||
if ({_object isKindOf _x} count LOG_CFG_CANLIFT > 0) then{[_object] spawn LOG_LIFT_INIT;};//if in
|
||||
if ({_object isKindOf _x} count LOG_CFG_CANTOW > 0) then{[_object] spawn LOG_TOW_INIT;};//if look at
|
||||
sleep (18/_count);
|
||||
};
|
||||
_known = _known + _list;
|
||||
}else{sleep 18;};
|
||||
}else{sleep 2;};
|
||||
};
|
30
MPMissions/DayZ_Epoch_24.Napf/logistic/object/init.sqf
Executable file
30
MPMissions/DayZ_Epoch_24.Napf/logistic/object/init.sqf
Executable file
@ -0,0 +1,30 @@
|
||||
private ["_object","_moves_by","_trailer","_disabled"];
|
||||
_object = _this select 0;
|
||||
_disabled = _object getVariable "LOG_disabled";
|
||||
|
||||
if (isNil "_disabled") then{_object setVariable ["LOG_disabled", false];};
|
||||
|
||||
//_trailer = _object getVariable "LOG_trailer";
|
||||
//if (isNil "_trailer") then{_object setVariable ["LOG_trailer", objNull, false];};
|
||||
|
||||
_moves_by = _object getVariable "LOG_moves_by";
|
||||
if (isNil "_moves_by") then{_object setVariable ["LOG_moves_by", objNull, false];};
|
||||
|
||||
if !(LOG_CFG_ALLOW_GETIN) then {
|
||||
_object addEventHandler ["GetIn",{
|
||||
if (_this select 2 == player) then{
|
||||
_this spawn{
|
||||
private ["_eject"];
|
||||
_eject = false;
|
||||
if ((!(isNull (_this select 0 getVariable "LOG_moves_by")) && (alive (_this select 0 getVariable "LOG_moves_by")))) then { _eject = true;};
|
||||
if ((!(isNull (_this select 0 getVariable "LOG_heliporte")) && (alive (_this select 0 getVariable "LOG_heliporte")))) then { _eject = true;};
|
||||
if (_eject) then{ player action ["eject", _this select 0];};
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
if ({_object isKindOf _x} count LOG_CFG_ISTOWABLE > 0) then{
|
||||
_object addAction [("<t color='#dddd00'>" + STR_LOG_TOW + "</t>"),"logistic\object\isSelected.sqf",[],5,false,true,"","LOG_OBJECT_ADDACTION == _target && LOG_OBJECT_TRAILER_VALID"];
|
||||
_object addAction [("<t color='#dddd00'>" + STR_LOG_UNTOW + "</t>"),"logistic\tow\detach.sqf",[],6,true,true,"","LOG_OBJECT_ADDACTION == _target && LOG_DETACH_VALID"];
|
||||
};
|
6
MPMissions/DayZ_Epoch_24.Napf/logistic/object/isSelected.sqf
Executable file
6
MPMissions/DayZ_Epoch_24.Napf/logistic/object/isSelected.sqf
Executable file
@ -0,0 +1,6 @@
|
||||
if (LOG_INPROGRESS) then {
|
||||
[STR_LOG_INPROGRESS,COLOR_ERROR] call SAM_SAYS;
|
||||
} else{
|
||||
LOG_OBJECT_SELECTION = _this select 0;
|
||||
[format [STR_LOG_NOW_SELECT, getText (configFile >> "CfgVehicles" >> (typeOf LOG_OBJECT_SELECTION) >> "displayName")],COLOR_DEFAULT] call SAM_SAYS;
|
||||
};
|
46
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/attach.sqf
Executable file
46
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/attach.sqf
Executable file
@ -0,0 +1,46 @@
|
||||
if (LOG_INPROGRESS) then{
|
||||
[STR_LOG_INPROGRESS,COLOR_ERROR] call SAM_SAYS;
|
||||
} else {
|
||||
LOG_INPROGRESS = true;
|
||||
private ["_object","_tug"];
|
||||
_object = LOG_OBJECT_SELECTION;
|
||||
_tug = _this select 0;
|
||||
|
||||
if (!(isNull _object) && (alive _object) && !(_object getVariable "LOG_disabled")) then{
|
||||
if (isNull (_object getVariable "LOG_moves_by") && (isNull (_object getVariable "LOG_moves_by") || (!alive (_object getVariable "LOG_moves_by")))) then{
|
||||
if ( _object distance _tug <= 10 ) then{
|
||||
|
||||
_tug setVariable ["LOG_trailer", _object, true];
|
||||
|
||||
_object setVariable ["LOG_moves_by", _tug, true];
|
||||
|
||||
player attachTo [_tug, [
|
||||
(boundingBox _tug select 1 select 0),
|
||||
(boundingBox _tug select 0 select 1) + 2,
|
||||
(boundingBox _tug select 0 select 2) - (boundingBox player select 0 select 2)]];
|
||||
sleep 0.2;
|
||||
|
||||
player setDir 270;
|
||||
player setPos (getPos player);
|
||||
[player,"repair",0,false,20] call dayz_zombieSpeak;
|
||||
player playActionNow "Medic";
|
||||
sleep 2;
|
||||
|
||||
_object setVelocity [0,0,0];
|
||||
_object attachTo [ _tug, [
|
||||
0,
|
||||
(boundingBox _tug select 0 select 1) + (boundingBox _object select 0 select 1) - 1,
|
||||
(boundingBox _tug select 0 select 2) - (boundingBox _object select 0 select 2)
|
||||
]];
|
||||
|
||||
|
||||
LOG_OBJECT_SELECTION = objNull;
|
||||
detach player;
|
||||
|
||||
sleep 3;
|
||||
[format [STR_LOG_ATTACHED, getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName")],COLOR_SUCCESS] call SAM_SAYS;
|
||||
}else{[format [STR_LOG_TOO_FAR, getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName")],COLOR_ERROR] call SAM_SAYS;};
|
||||
}else{[format [STR_LOG_IN_TRANSIT, getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName")],COLOR_ERROR] call SAM_SAYS;};
|
||||
};
|
||||
LOG_INPROGRESS = false;
|
||||
};
|
16
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/detach.sqf
Executable file
16
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/detach.sqf
Executable file
@ -0,0 +1,16 @@
|
||||
if (LOG_INPROGRESS) then {
|
||||
[STR_LOG_INPROGRESS,COLOR_ERROR] call SAM_SAYS;
|
||||
} else{
|
||||
LOG_INPROGRESS = true;
|
||||
private ["_tug","_object"];
|
||||
_object = _this select 0;
|
||||
_tug = _object getVariable "LOG_moves_by";
|
||||
if ({_tug isKindOf _x} count LOG_CFG_CANTOW > 0) then{
|
||||
_tug setVariable ["LOG_trailer", objNull, true];
|
||||
_object setVariable ["LOG_moves_by", objNull, true];
|
||||
[_object] call LOG_FNCT_DETACH_AND_SAVE;
|
||||
sleep 3;
|
||||
[format [STR_LOG_UNTOWED, getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "displayName")],COLOR_SUCCESS] call SAM_SAYS;
|
||||
}else{[STR_LOG_IMPOSSIBLE_VEHICLE,COLOR_ERROR] call SAM_SAYS;};
|
||||
LOG_INPROGRESS = false;
|
||||
};
|
8
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/init.sqf
Executable file
8
MPMissions/DayZ_Epoch_24.Napf/logistic/tow/init.sqf
Executable file
@ -0,0 +1,8 @@
|
||||
private ["_tug","_disabled","_trailer"];
|
||||
_tug = _this select 0;
|
||||
_disabled = _tug getVariable "LOG_disabled";
|
||||
if (isNil "_disabled") then{_tug setVariable ["LOG_disabled",false];};
|
||||
_trailer = _tug getVariable "LOG_trailer";
|
||||
if (isNil "_trailer") then{ _tug setVariable ["LOG_trailer",objNull,false];};
|
||||
_tug addAction [("<t color='#dddd00'>" + STR_LOG_UNTOW + "</t>"), "logistic\tow\detach.sqf",[],0,true,true,"","LOG_OBJECT_ADDACTION == _target && LOG_TRAILER_MOVE_VALID"];
|
||||
_tug addAction [("<t color='#eeeeee'>" + STR_LOG_TUG_SELECT + "</t>"), "logistic\tow\attach.sqf",[],0,true,true,"","LOG_OBJECT_ADDACTION == _target && LOG_TRAILER_SELECT_VALID"];
|
Reference in New Issue
Block a user