Notfallset zum Öffnen von Fahrzeugen für Medics
Script Owner : ToxicRageTv und Tonic
Dieses Script ermögtlich Medics das aufschließen von Fahrzeugen über die Windows Taste.
Dann fangen wir mal an !
Backup Machen !!!!
1.| Als erstes gehe zu "Altis_Life.Altis\core\actions" und erstellen die Datei-----> "fn_jaws.sqf"
In dieser Datei tragen wir folgendes ein :
#include "..\..\script_macros.hpp"
/*
File: fn_jaws.sqf
Author: Bryan "Tonic" Boardwine
redone by: Toxic
Description:
Main functionality for lock-picking.
*/
private ["_curTarget","_distance","_isVehicle","_title","_progressBar","_cP","_titleText","_dice","_badDistance"];
_curTarget = cursorObject;
life_interrupted = false;
if (life_action_inUse) exitWith {};
if (isNull _curTarget) exitWith {}; //Bad type
_distance = ((boundingBox _curTarget select 1) select 0) + 2;
if (player distance _curTarget > _distance) exitWith {}; //Too far
_isVehicle = if ((_curTarget isKindOf "LandVehicle") || (_curTarget isKindOf "Ship") || (_curTarget isKindOf "Air")) then {true} else {false};
if (_isVehicle && _curTarget in life_vehicles) exitWith {hint localize "STR_ISTR_Lock_AlreadyHave"};
//More error checks
if (!_isVehicle && !isPlayer _curTarget) exitWith {};
if (!_isVehicle && !(_curTarget getVariable ["restrained",false])) exitWith {};
if (_curTarget getVariable "NPC") exitWith {hint localize "STR_NPC_Protected"};
_title = format [localize "STR_ISTR_Jaws",if (!_isVehicle) then {"Handcuffs"} else {getText(configFile >> "CfgVehicles" >> (typeOf _curTarget) >> "displayName")}];
life_action_inUse = true; //Lock out other actions
//Setup the progress bar
disableSerialization;
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format ["%2 (1%1)...","%",_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
sleep 0.26;
if (isNull _ui) then {
"progressBar" cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
};
_cP = _cP + 0.05;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
if (_cP >= 1 || !alive player) exitWith {};
if (life_istazed) exitWith {}; //Tazed
if (life_isknocked) exitWith {}; //Knocked
if (life_interrupted) exitWith {};
if (player getVariable ["restrained",false]) exitWith {};
if (player distance _curTarget > _distance) exitWith {_badDistance = true;};
};
//Kill the UI display and check for various states
"progressBar" cutText ["","PLAIN"];
player playActionNow "stop";
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
if (!isNil "_badDistance") exitWith {titleText[localize "STR_ISTR_Lock_TooFar","PLAIN"]; life_action_inUse = false;};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
life_action_inUse = false;
if (!_isVehicle) then {
_curTarget setVariable ["restrained",false,true];
_curTarget setVariable ["Escorting",false,true];
_curTarget setVariable ["transporting",false,true];
} else {
titleText[localize "STR_ISTR_Jaws_Success","PLAIN"];
life_vehicles pushBack _curTarget;
};
Alles anzeigen
2.| Jetzt öffnen wir die Mission und dort die "Functions.hpp"
dort suchen wir die Class "Actions" und fügen das folgende hinzu
class jaws {}; // einfach wie die anderen einfügen die in der class Actions schon vorhanden sind
3.| Als nächstes öffnen wir in der Mission die "Stringtable.xml" und fügen folgendes nach dem letzen Eintrag ein achtet nur darauf das die letzte Klammer vorhanden ist !
<Key ID="STR_ISTR_Jaws">
<Original>Using Jaws Of Life On: %1</Original>
<German>Nutze Notfallset bei: %1</German>
</Key>
<Key ID="STR_ISTR_Jaws_Success">
<Original>The Jaws Of Life Where Successful!</Original>
<German>Das Notfallset war Erfolgreich!</German>
</Key>
<Key ID ="STR_vInAct_Jaws">
<Original>Jaws Of Life</Original>
<German>Notfallset benutzen</German>
</Key>
Alles anzeigen
4.| Nun geh ihr zu "Altis_Life.Altis\core\vehicle" und öffnen die Datei "fn_vInteractionMenu.sqf" und fügen über
das folgende ein
if (playerSide isEqualTo independent) then {
_Btn5 ctrlSetText localize "STR_vInAct_Jaws";
_Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_jaws; closeDialog 0;";
}
Das sollte alles gewesen sein hoffe ich habe nichts vergessen ;D
Wenn Fehler vorhanden sind bitte melden
Ich wünsche viel Spaß mit dem Script