Was macht das Script?
Da man nicht an jeder Ecke einen Market stehen hat und der Weg kurz vor dem verhungern lang sein kann, bieten die Medics mit diesem Script eine mobile Sozialstation als Container an. Spieler können sich an den Container stellen und haben dann über das Mausrad zugriff auf kostenloses Essen, Trinken und Heilen. Dank der zahlreichen Kleiderspenden haben alle Civilisten zugriff auf die Kleiderkammer, welche ebenfalls im Container enthalten ist. Die Sozialstation ist in der Lage, von einem erfahrenen Piloten an jedem Ort(Land) der Karte abgestellt zu werden. Eure Medics benötigen dafür mindestens einen Orca. Die Hellcat und der Huron können diesen Container auch transportieren. Aber auch flugtechnisch unbegabte Medics können den Container aufstellen, da der Transport per Luftfracht nicht notwendig ist. Item benutzen, platzieren, fertig.
Wie immer untersage ich die Verbreitung des von mir verfassten Tutorials in anderen Foren ohne vorher mein Einverständnis dazu einzuholen.
** Mindestanforderungen: **
- Medic Shop für Z-Items erstellen
- Altis Life 4.0
- Arma 3 DLC (Heli ??)
BACKUP machen
Medic Part Schritt 1 Sozialstation
Config_Master.hpp class VirtualItems
VITEMMACRO(Supportcontainer, "STR_Item_Supportcontainer", "Supportcontainer", 15, 2500, 1200, false, -1, "")
class VirtualShops class medmarket erweitern mit , "Supportcontainer" sollte dann so aussehen
class medmarket {
name = "STR_Shops_Med";
items[] = { "waterBottle", "apple", "fuelFull", "Supportcontainer"};
};
core/config/fn_varToStr.sqf
//Virtual Inventory Items
case "life_inv_supportcontainer": {(localize "STR_Item_Supportcontainer")};
core/config/fn_varHandle.sqf in Case 0
core/config/fn_varHandle.sqf in Case 1
core/pmenu/fn_useItem.sqf
case (EQUAL(_item,"Supportcontainer")): {
if(!isNull life_Supportcontainer) exitWith {hint localize "STR_ISTR_SupportcontainerDeployment"};
if(([false,_item,1] call life_fnc_handleInv)) then {
[] spawn life_fnc_Supportcontainer;
};
};
core/configuration.sqf Backend Variables
stringtable.xml sucht nach <Package name="Notifications"> und fügt folgendes darunter ein
<Key ID="STR_NOTF_Supportcontainer">
<Original>You have packed up the Supportcargo.</Original>
<German>Du hast den Supportcontainer eingepackt.</German>
<French>You have packed up the Supportcargo.</French>
<Italian>You have packed up the Supportcargo.</Italian>
<Portuguese>You have packed up the Supportcargo.</Portuguese>
</Key>
stringtable.xml sucht nach <Package name="Life_Items"> und fügt folgendes darunter ein
<Key ID="STR_Item_Supportcontainer">
<Original>Supportcargo</Original>
<German>Supportcontainer</German>
<French>Supportcargo</French>
<Italian>Supportcargo</Italian>
<Portuguese>Supportcargo</Portuguese>
</Key>
stringtable.xml sucht nach <Package name="More_Item_Strings"> und fügt folgendes darunter ein
<Key ID="STR_ISTR_Supportcontainer_Place">
<Original>Place Supportcargo</Original>
<German>Supportcontainer platzieren</German>
<French>Place Supportcargo</French>
<Italian>Place Supportcargo</Italian>
<Portuguese>Place Supportcargo</Portuguese>
</Key>
<Key ID="STR_ISTR_Supportcontainer_Pack">
<Original>Pack up Supportcargo</Original>
<German>Supportcontainer einpacken</German>
<French>Pack up Supportcargo</French>
<Italian>Pack up Supportcargo</Italian>
<Portuguese>Pack up Supportcargo</Portuguese>
</Key>
<Key ID="STR_ISTR_SupportcontainerDeployment">
<Original>You already have a Supportcargo active in deployment</Original>
<German>Du stellst bereits einen Supportcontainer auf</German>
<French>You already have a Supportcargo active in deployment</French>
<Italian>You already have a Supportcargo active in deployment</Italian>
<Portuguese>You already have a Supportcargo active in deployment</Portuguese>
</Key>
Alles anzeigen
function.h class Actions
class packupSupportContainer {};
class essen {};
class trinken {};
class heilung {};
class kleiderkammer {};
function.h class Items
core/fn_setupActions.sqf über switch (playerSide) do {
//Altis Care Essen
life_actions = life_actions + [player addAction["<t color='#FF0000'>Essen</t>",life_fnc_Essen,"",1,false,true,"",' !isNull cursorTarget && (typeOf cursorTarget) == "Land_Pod_Heli_Transport_04_medevac_F" && (player distance cursorTarget) < 5 ']];
//Altis Care Trinken
life_actions = life_actions + [player addAction["<t color='#FF0000'>Trinken</t>",life_fnc_Trinken,"",1,false,true,"",' !isNull cursorTarget && (typeOf cursorTarget) == "Land_Pod_Heli_Transport_04_medevac_F" && (player distance cursorTarget) < 5 ']];
//Altis Care Heilung
life_actions = life_actions + [player addAction["<t color='#FF0000'>Heilen</t>",life_fnc_Heilung,"",1,false,true,"",' !isNull cursorTarget && (typeOf cursorTarget) == "Land_Pod_Heli_Transport_04_medevac_F" && (player distance cursorTarget) < 5 ']];
//Altis Care Kleiderkammer
life_actions = life_actions + [player addAction["<t color='#FF0000'>Kleiderkammer</t>",life_fnc_Kleiderkammer,"",1,false,true,"",' !isNull cursorTarget && (typeOf cursorTarget) == "Land_Pod_Heli_Transport_04_medevac_F" && (player distance cursorTarget) < 5 ']];
nachfolgende Dateien neu erstellen
core/actions/fn_packupSupportContainer.sqf
/* Orginal File: fn_packupSpikes.sqf
Author: Bryan "Tonic" Boardwine
Change to: fn_packupSupportContainer.sqf
*/
private["_Supportcon"];
_Supportcon = nearestObjects[getPos player,["Land_Pod_Heli_Transport_04_medevac_F"],8] select 0;
if(isNil "_Supportcon") exitWith {};
if(([true,"Supportcontainer",1] call life_fnc_handleInv)) then
{
titleText[localize "STR_NOTF_Supportcontainer","PLAIN"];
player removeAction life_action_SupportcontainerPickup;
life_action_SupportcontainerPickup = nil;
deleteVehicle _Supportcon;
};
Alles anzeigen
core/items/fn_SupportContainer.sqf
#include <macro.h>
/* Orginal File: fn_spikeStrip.sqf
Author: Bryan "Tonic" Boardwine
Change to: fn_SupportContainer.sqf
*/
if((FETCH_CONST(life_mediclevel)) == 0) exitWith {titleText["Du bist dazu nicht berechtigt!","PLAIN"];};
private["_position","_Supportcontainer"];
_Supportcontainer = "Land_Pod_Heli_Transport_04_medevac_F" createVehicle [0,0,0];
_Supportcontainer attachTo[player,[0,5.5,0]];
_Supportcontainer setDir 90;
_Supportcontainer allowDamage false;
_Supportcontainer setVehicleLock "LOCKED";
_Supportcontainer setVariable["item","ContainerUse",true];
_Supportcontainer setVehicleVarName "Support";
removeAllItems _Supportcontainer;
life_Supportcontainer = _Supportcontainer;
life_action_Supportcontainer = player addAction[localize "STR_ISTR_Supportcontainer_Place",{if(!isNull life_Supportcontainer) then {detach life_Supportcontainer; life_Supportcontainer = ObjNull;}; player removeAction life_action_Supportcontainer; life_action_Supportcontainer = nil;},"",999,false,false,"",'!isNull life_Supportcontainer'];
waitUntil {isNull life_Supportcontainer};
/* ## Optional ##
Support = _Supportcontainer;
_marker = createMarker ["Containertext", position player];
_marker setMarkerType "Mil_dot";
_marker setMarkerColor "ColorGreen";
_marker setMarkerText "Sozialstation";
*/
if(!isNil "life_action_Supportcontainer") then {
player removeAction life_action_Supportcontainer;};
if(isNull _Supportcontainer) exitWith {life_Supportcontainer = ObjNull;};
_Supportcontainer setPos [(getPos _Supportcontainer select 0),(getPos _Supportcontainer select 1),0];
_Supportcontainer setDamage 0;
//_Supportcontainer setObjectTextureGlobal [0,"textures\Supportcontainer_1.jpg"];
//_Supportcontainer setObjectTextureGlobal [1,"textures\Supportcontainer_2.jpg"];
waitUntil {isNull life_Supportcontainer};
life_action_SupportcontainerPickup = player addAction[localize "STR_ISTR_Supportcontainer_Pack",life_fnc_packupSupportContainer,"",0,false,false,"",' _Supportcon = nearestObjects[getPos player,["Land_Pod_Heli_Transport_04_medevac_F"],8] select 0; !isNil "_Supportcon" && !isNil {(_Supportcon getVariable "item")}'];
Alles anzeigen
core/actions/fn_essen.sqf