Der Orginal Post ist von SBuserhy und ich Remake ihn nur für die Life Version 5.0!
Bevor ihr anfangt BACKUPS MACHEN!!
Brennerei NPC
Spoiler anzeigen
this allowDamage false; this enableSimulation false; this addAction [ ""Process Mash"", { [[[""cornmeal"",1],[""waterbottle"",1]],""license_civ_mashL"",50000,[[""mash"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""mashL"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""mashL"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""mashL"",0,false,false,"""",' !license_civ_mashL && playerSide == civilian '];this addAction [ ""Process Moonshine"", { [[[""mash"",1],[""yeast"",1]],""license_civ_MoonshineL"",50000,[[""Moonshine"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""MoonshineL"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""MoonshineL"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""MoonshineL"",0,false,false,"""",' !license_civ_MoonshineL && playerSide == civilian '];this addAction [ ""Process Whiskey"", { [[[""rye"",1],[""yeast"",1],[""waterbottle"",1]],""license_civ_WhiskeyL"",50000,[[""whiskey"",1],[""AItem:>"",3]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""WhiskeyL"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""WhiskeyL"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""WhiskeyL"",0,false,false,"""",' !license_civ_WhiskeyL && playerSide == civilian '];
Brauerei NPC
Spoiler anzeigen
this allowDamage false; this enableSimulation false; this addAction [ ""Brew Beer"", { [[[""hops"",1],[""yeast"",1],[""waterbottle"",1]],""license_civ_liquor"",50000,[[""beerp"",1],[""AItem:>"",3]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""liquor"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""liquor"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""liquor"",0,false,false,"""",' !license_civ_liquor && playerSide == civilian ']; this addAction [ ""Mix Apple juice"", { [[[""apple"",1],[""waterbottle"",1]],""license_civ_liquor"",50000,[[""applej"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""liquor"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""liquor"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""liquor"",0,false,false,"""",' !license_civ_liquor && playerSide == civilian '];
Abfüller NPC
Spoiler anzeigen
this allowDamage false; this enableSimulation false; this addAction [ ""Bottle Beer"", { [[[""beerp"",1],[""bottles"",1]],""license_civ_bottler"",50000,[[""bottledBeer"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""bottler"",0,false,false,"""",' !license_civ_bottler && playerSide == civilian '];this addAction [ ""Bottle Whiskey"", { [[[""whiskey"",1],[""bottles"",1]],""license_civ_bottler"",50000,[[""bottledwhiskey"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""bottler"",0,false,false,"""",' !license_civ_bottler && playerSide == civilian '];this addAction [ ""Bottle Moonshine"", { [[[""moonshine"",1],[""bottles"",1]],""license_civ_bottler"",50000,[[""bottledshine"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""bottler"",0,false,false,"""",' !license_civ_bottler && playerSide == civilian '];this addAction [ ""Bottle Apple juice"", { [[[""applej"",1],[""bottles"",1]],""license_civ_bottler"",50000,[[""bottledapplej"",1],[""AItem:>"",2]]] spawn life_fnc_dynprocess; } ]; this addAction[format[""%1 ($%2)"",localize (getText(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""displayName"")), [(getNumber(missionConfigFile >> ""Licenses"" >> ""bottler"" >> ""price""))] call life_fnc_numberText],life_fnc_buyLicense,""bottler"",0,false,false,"""",' !license_civ_bottler && playerSide == civilian '];
Mr Moonshine
Spoiler anzeigen
this allowDamage false; this enableSimulation false; this addAction["Mr.Moonshine",life_fnc_virt_menu,"mrmoonshine"];
Kneipe/Bar
Spoiler anzeigen
this allowDamage false; this enableSimulation false; this addAction["Barkeeper",life_fnc_virt_menu,"alkbar"];
Nun Erstellt ihr noch 3 Marker mit den Folgenden Namen:
Spoiler anzeigen
yeast_1
rye_1
hops_1
Config_vItems.hpp (Bei den Items Einfügen)
Spoiler anzeigen
class bottledshine{
variable = "bottledshine";
displayName = "STR_Item_BottledShine";
weight = 2;
buyPrice = -1;
sellPrice = 15000;
illegal = true;
edible = 10;
icon = "";
};
class bottledwhiskey{
variable = "bottledwhiskey";
displayName = "STR_Item_BottledWhiskey";
weight = 2;
buyPrice = -1;
sellPrice = 7000;
illegal = false;
edible = 10;
icon = "";
};
class bottledBeer{
variable = "bottledBeer";
displayName = "STR_Item_BottledBeer";
weight = 2;
buyPrice = -1;
sellPrice = 5500;
illegal = false;
edible = 10;
icon = "";
};
class bottledapplej{
variable = "bottledapplej";
displayName = "STR_Item_bottledapplej";
weight = 2;
buyPrice = -1;
sellPrice = 2000;
illegal = false;
edible = 10;
icon = "";
};
class moonshine{
variable = "moonshine";
displayName = "STR_Item_Moonshine";
weight = 2;
buyPrice = -1;
sellPrice = -1;
illegal = true;
edible = -1;
icon = "";
};
class whiskey{
variable = "whiskey";
displayName = "STR_Item_Whiskey";
weight = 2;
buyPrice = 5000;
sellPrice = -1;
illegal = false;
edible = -1;
icon = "";
};
class beerp{
variable = "beerp";
displayName = "STR_Item_Beerp";
weight = 2;
buyPrice = 5000;
sellPrice = -1;
illegal = false;
edible = -1;
icon = "";
};
class mash{
variable = "mash";
displayName = "STR_Item_Mash";
weight = 4;
buyPrice = -1;
sellPrice = -1;
illegal = true;
edible = -1;
icon = "";
};
class rye{
variable = "rye";
displayName = "STR_Item_Rye";
weight = 2;
buyPrice = -1;
sellPrice = -1;
illegal = false;
edible = -1;
icon = "";
};
class hops{
variable = "hops";
displayName = "STR_Item_Hops";
weight = 2;
buyPrice = -1;
sellPrice = -1;
illegal = false;
edible = -1;
icon = "";
};
class yeast{
variable = "yeast";
displayName = "STR_Item_Yeast";
weight = 2;
buyPrice = -1;
sellPrice = -1;
illegal = false;
edible = -1;
icon = "";
};
class cornmeal{
variable = "cornmeal";
displayName = "STR_Item_Cornmeal";
weight = 2;
buyPrice = 500;
sellPrice = 200;
illegal = false;
edible = -1;
icon = "";
};
class bottles{
variable = "bottles";
displayName = "STR_Item_Bottles";
weight = 2;
buyPrice = 100;
sellPrice = 75;
illegal = false;
edible = -1;
icon = "";
};
class applej{
variable = "applej";
displayName = "STR_Item_applej";
weight = 2;
buyPrice = 100;
sellPrice = 75;
illegal = false;
edible = -1;
icon = "";
};
Config_vItems.hpp (Bei den Shops)
Spoiler anzeigen
class mrmoonshine {
name = "STR_Shops_MRMoonshine";
side = "civ";
conditions = "";
items[] = { "bottledshine" };
};
class alkbar {
name = "STR_Shops_alkbar";
side = "civ";
conditions = "";
items[] = { "bottledBeer", "bottledwhiskey", "bottledapplej" };
};
Config_Licenses.hpp
Spoiler anzeigen
class MoonshineL{
variable = "MoonshineL";
displayName = "STR_License_MoonshineL";
price = 50000;
illegal = true;
side = "civ";
};
class liquor{
variable = "liquor";
displayName = "STR_License_Liquor";
price = 100000;
illegal = false;
side = "civ";
};
class bottler{
variable = "bottler";
displayName = "STR_License_Bottler";
price = 100000;
illegal = false;
side = "civ";
};
class mashL{
variable = "mashL";
displayName = "STR_License_MashL";
price = 50000;
illegal = true;
side = "civ";
};
class whiskeyL{
variable = "whiskeyL";
displayName = "STR_License_whiskeyL";
price = 50000;
illegal = false;
side = "civ";
};
class applejL{
variable = "applejL";
displayName = "STR_License_applejL";
price = 50000;
illegal = false;
side = "civ";
};
Stringtable.xml
<Key ID="STR_MISC_AlreadyDrinking">
<Original>You are already drinking some booze</Original>
<German>Du trinkst bereits etwas!</German>
</Key>
<Key ID="STR_MISC_WestIndNoNo">
<Original>No drinking on duty</Original>
<German>Du darfst im Dienst kein Alkohol trinken!</German>
</Key>
<Key ID="STR_MISC_DrunkBlackout">
<Original>No have passed out</Original>
<German>Du hast einen Blackout!</German>
</Key>
<Key ID="STR_MISC_DrunkBlackout1">
<Original>What the hell happened to me?</Original>
<German>Was zum Teufel ist mit mir passiert?!</German>
</Key>
<Key ID="STR_Item_Bottles">
<Original>Glass Bottles</Original>
<German>Glasflasche</German>
</Key>
<Key ID="STR_Item_BottledShine">
<Original>Bottled Moonshine</Original>
<German>abgefüllter Moonshine</German>
</Key>
<Key ID="STR_Item_BottledWhiskey">
<Original>Bottled Whiskey</Original>
<German>abgefüllter Whiskey</German>
</Key>
<Key ID="STR_Item_BottledBeer">
<Original>Bottled Beer</Original>
<German>abgefülltes Bier</German>
</Key>
<Key ID="STR_Item_BottledApplej">
<Original>Bottled Apple juice</Original>
<German>abgefüllter Apfelsaft</German>
</Key>
<Key ID="STR_Item_Moonshine">
<Original>Moonshine</Original>
<German>Moonshine</German>
</Key>
<Key ID="STR_Item_Whiskey">
<Original>Distilled Whiskey</Original>
<German>Destillierter Whiskey</German>
</Key>
<Key ID="STR_Item_Beerp">
<Original>Fermented Beer</Original>
<German>gebrautes Bier</German>
</Key>
<Key ID="STR_Item_Mash">
<Original>Mash</Original>
<German>Mash</German>
</Key>
<Key ID="STR_Item_Rye">
<Original>Rye</Original>
<German>Roggen</German>
</Key>
<Key ID="STR_Item_Hops">
<Original>Hops</Original>
<German>Hopfen</German>
</Key>
<Key ID="STR_Item_Yeast">
<Original>Yeast</Original>
<German>Hefe</German>
</Key>
<Key ID="STR_Item_Cornmeal">
<Original>Cornmeal Grain</Original>
<German>Getreidemehl</German>
</Key>
<Key ID="STR_Item_Applej">
<Original>Apple juice</Original>
<German>Apfelsaft</German>
</Key>
<Key ID="STR_License_MashL">
<Original>Mash License</Original>
<German>Mash-Lizenz</German>
</Key>
<Key ID="STR_License_Liquor">
<Original>Liquor License</Original>
<German>Alkohol-Lizenz</German>
</Key>
<Key ID="STR_License_Bottler">
<Original>Bottling License</Original>
<German>Abfüller-Lizenz</German>
</Key>
<Key ID="STR_License_MoonshineL">
<Original>Moonshine License</Original>
<German>Moonshine-Lizenz</German>
</Key>
<Key ID="STR_License_whiskeyL">
<Original>Whiskey License</Original>
<German>Whiskey-Lizenz</German>
</Key>
<Key ID="STR_Shops_MRMoonshine">
<Original>MR. Moonshine</Original>
<German>MR. Moonshine</German>
</Key>
<Key ID="STR_Shops_alkbar">
<Original>Pub</Original>
<German>Bar</German>
</Key>
<Key ID="STR_pInAct_Breathalyzer">
<Original>Breathalyzer</Original>
<German>Alkoholtest</German>
</Key>
<Key ID="STR_Crime_390">
<Original>Public Intoxication</Original>
<German>Trinken in der Oeffentlichkeit</German>
<French>Public Intoxication</French>
<Italian>Public Intoxication</Italian>
<Portuguese>Public Intoxication</Portuguese>
</Key>
Alles anzeigen
core/Configuration.sqf | bei Backend Variables einfügen
Spoiler anzeigen
life_drink = 0;
Config_Gather.hpp | In das "Packet" class Resources {}; mit rein
Spoiler anzeigen
class rye {
amount = 2;
zones[] = { "rye_1" };
item = "";
zoneSize = 30;
};
class yeast {
amount = 2;
zones[] = { "yeast_1" };
item = "";
zoneSize = 30;
};
class hops{
amount = 2;
zones[] = { "hops_1" };
item = "";
zoneSize = 30;
};
core/pmenu/fn_useItem.sqf
Spoiler anzeigen
case (_item in ["waterBottle","coffee","redgull"]): {
Wird zu
case (_item in ["waterBottle","coffee","redgull","bottledapplej"]): {
Spoiler anzeigen
case (_item isEqualTo "bottledwhiskey"): {
if(([false,_item,1] call life_fnc_handleInv)) then {
if(isNil "life_drink") then {
life_drink = 0;
};
life_drink = life_drink + 0.06;
[] spawn life_fnc_drinkwhiskey;
};
};
case (_item isEqualTo "bottledshine"): {
if(([false,_item,1] call life_fnc_handleInv)) then {
if(isNil "life_drink") then {
life_drink = 0;
};
life_drink = life_drink + 0.08;
[] spawn life_fnc_drinkmoonshine;
};
};
case (_item isEqualTo "bottledbeer"): {
if(([false,_item,1] call life_fnc_handleInv)) then {
if(isNil "life_drink") then {
life_drink = 0;
};
life_drink = life_drink + 0.02;
[] spawn life_fnc_drinkbeer;
};
};
Functions.hpp unter Class Actions
Spoiler anzeigen
class dynprocess {};
Functions.hpp unter Class Cop
Spoiler anzeigen
class breathalyzer {};
Functions.hpp unter Class Items
Spoiler anzeigen
class drinkbeer {};
class drinkmoonshine {};
class drinkwhiskey {};
core/fn_survival.sqf
sucht nach
//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
und fügt folgendes darüber ein.
Spoiler anzeigen
[] spawn
{
while {true} do
{
waitUntil {(life_drink > 0)};
while{(life_drink > 0)} do {
if(life_drink > 0.08) then {
"radialBlur" ppEffectEnable true;
"radialBlur" ppEffectAdjust[0.08, 0,0.35,0.37];
"radialblur" ppEffectCommit 3;
sleep 240;
life_drink = life_drink - 0.02;
} else {
"radialBlur" ppEffectEnable true;
"radialBlur" ppEffectAdjust[0.05, 0,0.36,0.38];
"radialBlur" ppEffectCommit 1;
sleep 180;
life_drink = life_drink - 0.02;
};
};
"radialBlur" ppEffectAdjust [0,0,0,0];
"radialblur" ppEffectCommit 5;
"radialblur" ppEffectEnable false;
life_drink = 0;
};
};
core/action/fn_dynprocess.sqf erstellen mit folgendem Inhalt:
Spoiler anzeigen
#include "..\..\script_macros.hpp"
/*
BY OPTIX aka https://native-network.net/forum/thread/3…om/id/ryanthett
THIS HEADER HAS TO BE LEFT UNCHANGED UNDER ALL CIRCUMSTANCES!
CHANGING ANYTHING OF THE SCRIPT DOESN'T MAKE IT YOURS!
*/
private ["_currentPos","_itemsBenoetigtArray","_lizenzBenoetigt","_lizenzKaufkosten","_produkt","_lizenzBoolean","_weiter","_itemHatAnzahlArray","_itemMussAnzahlArray","_indexAktuell","_itemMaximal","_minWert","_indexAktuellEnde","_anzahlMaxVerarbeiten"];
// SONDERFÄLLE PRÜFEN
if (isServer) exitWith {};
if (vehicle player != player) then {hint "Du kannst nicht aus dem Fahrzeug verarbeiten!"};
if (life_is_processing) exitWith {hint "Du verarbeitest bereits etwas!"};
if(vehicle player != player) exitwith {hint format["Du befindest dich in einem Fahrzeug und kannst deshalb nichts verarbeiten!"]};
// AB JETZT VERARBEITET DER SPIELER
life_is_processing = true;
// DEKLARIEREN DER BENÖTIGEN VARIABELN UND AUFRUFEN DER ÜBERGEBENEN PARAMETER
_currentPos = position player;
_itemsBenoetigtArray = [_this,0,[],[[]]] call BIS_fnc_param;
_lizenzBenoetigt = [_this,1,"",[""]] call BIS_fnc_param;
_lizenzKaufkosten = [_this,2,0,[0]] call BIS_fnc_param;
_produkt = [_this,3,[],[[]]] call BIS_fnc_param;
_lizenzBoolean = false;
// LIZENZ PRÜFEN, WENN NICHT VORHANDEN KAUF VERSUCHEN
call compile format ["_lizenzBoolean = %1",_lizenzBenoetigt];
_nah = false;
if (!_lizenzBoolean) then {
if (CASH>=_lizenzKaufkosten) then {
CASH = CASH - _lizenzKaufkosten;
call compile format ["%1 = true",_lizenzBenoetigt];
hint format ["Du hast eine Lizenz fuer %1 Dollar gekauft und kannst nun verarbeiten!",_lizenzKaufkosten];
} else {
hint format ["Leider hast du nicht %1 Dollar dabei, um eine Lizenz zu erwerben!",_lizenzKaufkosten];
if (true) exitWith {life_is_processing = false;5 cutText ["","PLAIN"];_nah=true};
};
};
if (_nah) exitWith {life_is_processing = false;5 cutText ["","PLAIN"]};
// PRÜFEN, OB ITEMS VORHANDEN SIND
_nah = false;
{
_itemsBenoetigtAktuell = _x;
_itemName = _itemsBenoetigtAktuell select 0;
_itemAnzahlBenoetigt = _itemsBenoetigtAktuell select 1;
call compile format ["itemAnzahlHat = life_inv_%1",_itemName];
if (_itemAnzahlBenoetigt>itemAnzahlHat) then {_nah = true};
} forEach _itemsBenoetigtArray;
if (_nah) exitWith {life_is_processing = false;5 cutText ["","PLAIN"];hint "Du hast nicht genuegend Items dabei!"};
// PROGRESSBAR SCHALTEN
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%","Verarbeite..."];
_progress progressSetPosition 0.01;
_cP = 0.01;
_nah=false;
while{true} do
{
sleep 0.3;
_cP = _cP + 0.01;
if (_cp<=1) then { _progress progressSetPosition _cP; };
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%","Verarbeite..."];
if(_cP >= 1) exitWith {};
if(player distance _currentPos > 10) exitWith {hint "Du hast dich zu weit entfernt!";life_is_processing = false;5 cutText ["","PLAIN"];_nah=true};
};
if (_nah) exitWith {life_is_processing = false;5 cutText ["","PLAIN"]};
// VERARBEITUNGSANZAHL BERECHNEN -> MATHE FTW
_itemHatAnzahlArray = [];
{
_itemsBenoetigtAktuell = _x;
_itemName = _itemsBenoetigtAktuell select 0;
call compile format ["_itemHatAnzahlArray = _itemHatAnzahlArray + [life_inv_%1]",_itemName];
} forEach _itemsBenoetigtArray;
_itemMussAnzahlArray = [];
{
_itemsBenoetigtAktuell = _x;
_itemAnzahlBenoetigt = _itemsBenoetigtAktuell select 1;
call compile format ["_itemMussAnzahlArray = _itemMussAnzahlArray + [%1]",_itemAnzahlBenoetigt];
} forEach _itemsBenoetigtArray;
_indexAktuell = -1;
_itemMaximal = [];
{
_indexAktuell = _indexAktuell + 1;
_itemMaximal = _itemMaximal + [(floor ((_itemHatAnzahlArray select _indexAktuell)/(_itemMussAnzahlArray select _indexAktuell)))];
} forEach _itemHatAnzahlArray;
_minWert = _itemMaximal select 0;
_indexAktuellEnde = 0;
{
_indexAktuellEnde = _indexAktuellEnde + 1;
if (_x<_minWert) then {_minWert=_x};
} forEach _itemMaximal;
_anzahlMaxVerarbeiten = _minWert;
// ITEMS ENTZIEHEN
{
_itemsBenoetigtAktuell = _x;
[false,_itemsBenoetigtAktuell select 0,((_itemsBenoetigtAktuell select 1)*_anzahlMaxVerarbeiten)] call life_fnc_handleInv;
} forEach _itemsBenoetigtArray;
// ITEMS ADDEN
{
[true,_x select 0,((_x select 1)*_anzahlMaxVerarbeiten)] call life_fnc_handleInv;
} forEach _produkt;
//_toLog = format ["4|%1 (%2) hat %3 Mal %4 durch verarbeiten erhalten.", name player,getPlayerUID player,_anzahlMaxVerarbeiten,_produkt];
//[[_toLog],"Arma3Log"] call life_fnc_MP;
life_is_processing = false;
5 cutText ["","PLAIN"];
core/cop/fn_breathalyzer.sqf erstellen mit folgendem Inhalt:
Spoiler anzeigen
/*
File: fn_breathalyzer.sqf
Author: midgetgrimm
Description:
Allows Cops breathalyze Player
*/
private["_cop","_drinky"];
_cop = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if(isNull _cop) exitWith {};
_drinky = life_drink;
if(_drinky > 0.07) then {
[[1,format["Alkoholtest: %1 \n\n Promille: %2 \n\n Das ist zuviel! ",name player,[_drinky] call life_fnc_numberText]],"life_fnc_broadcast",_cop,false] spawn life_fnc_MP;
};
else
{};