You've already forked arma2-epoch-server
Initial
This commit is contained in:
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