Mission:
1. Geht in die Functions.h und schreibt unter class Functions das:
tragt unterclass Config das ein:
2. Schreibt folgendes in eure Masterhandler.h ein:
3. Stringable.xml fügt ihr ganz unten das ein:
<Package name="Life_Prof">
<Key ID="STR_Prof_Oil">
<Original>Oil Proficiency</Original>
<English>Oil Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Sand">
<Original>Sand Proficiency</Original>
<English>Sand Proficiency</English>
<German>Sand Können</German>
<French>compétence d'sable</French>
<Italian>Proficiency sabbia</Italian>
<Portuguese>areia de Proficiência </Portuguese>
</Key>
<Key ID="STR_Prof_Rock">
<Original>Rock Proficiency</Original>
<English>Rock Proficiency</English>
<German>Rock Können</German>
<French>compétence d'rock</French>
<Italian>Proficiency roccia</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Salt">
<Original>Salt Proficiency</Original>
<English>Salt Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Canabis">
<Original>Cannabis Proficiency</Original>
<English>Cannabis Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Heroin">
<Original>Heroin Proficiency</Original>
<English>Heroin Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Cocain">
<Original>Cocaine Proficiency</Original>
<English>Cocaine Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Diamond">
<Original>Diamond Proficiency</Original>
<English>Diamond Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Iron">
<Original>Iron Proficiency</Original>
<English>Iron Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Copper">
<Original>Copper Proficiency</Original>
<English>Copper Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
<Key ID="STR_Prof_Fruit">
<Original>Fruit Proficiency</Original>
<English>Fruit Proficiency</English>
<German>Öl Können</German>
<French>compétence d'huile</French>
<Italian>Proficiency olio</Italian>
<Portuguese>Proficiência Oil</Portuguese>
</Key>
Alles anzeigen
4.In der Player_inv.hpp fügt ihr ganz unten das ein:
class ProfButton : life_RscButtonMenu {
text = "Proficiency";
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
onButtonClick = "[] call life_fnc_profSetup;
";
x = 0.11;
y = 0.70;
w = (5.75 / 40);
h = (1 / 25);
};
5.In der Fn_VarToStr.sqf im letzten case das einfügen:
//Prof Block
case "Oil_Prof": {(localize "STR_Prof_Oil")};
case "Iron_Prof": {(localize "STR_Prof_Iron")};
case "Copper_Prof": {(localize "STR_Prof_Copper")};
case "Rock_Prof": {(localize "STR_Prof_Rock")};
case "Fruit_Prof": {(localize "STR_Prof_Fruit")};
case "Salt_Prof": {(localize "STR_Prof_Salt")};
case "Sand_Prof": {(localize "STR_Prof_Sand")};
case "Diamond_Prof": {(localize "STR_Prof_Diamond")};
case "Cocain_Prof": {(localize "STR_Prof_Cocain")};
case "Canabis_Prof": {(localize "STR_Prof_Canabis")};
case "Heroin_Prof": {(localize "STR_Prof_Heroin")};
Alles anzeigen
6. Ersetzt die fn_updateRequest durch das:
/*File: fn_updateRequest.sqfAuthor: Bryan "Tonic" Boardwine Description:Ain't got time to describe it, READ THE FILE NAME!*/
private["_uid","_side","_cash","_bank","_licenses","_gear","_name","_query","_thread"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_side = [_this,2,sideUnknown,[civilian]] call BIS_fnc_param;
_cash = [_this,3,0,[0]] call BIS_fnc_param;
_bank = [_this,4,5000,[0]] call BIS_fnc_param;
_licenses = [_this,5,[],[[]]] call BIS_fnc_param;
_gear = [_this,6,[],[[]]] call BIS_fnc_param;
_prof = [_this, 7,[],[[]]] call BIS_fnc_param;
//Get to those error checks.
if((_uid == "") OR (_name == "")) exitWith {};
//Parse and setup some data.
_name = [_name] call DB_fnc_mresString;
_gear = [_gear] call DB_fnc_mresArray;
_cash = [_cash] call DB_fnc_numberSafe;
_bank = [_bank] call DB_fnc_numberSafe;
//Does something license related but I can't remember I only know it's important?
for "_i" from 0 to count(_licenses)-1 do {_bool = [(_licenses select _i) select 1] call DB_fnc_bool;
_licenses set[_i,[(_licenses select _i) select 0,_bool]];
};
_licenses = [_licenses] call DB_fnc_mresArray;
_prof = [_prof] call DB_fnc_mresArray;
switch (_side) do {case west: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_prof='%7' WHERE playerid='%6'",_name,_cash,_bank,_gear,_licenses,_uid,_prof];
};
case civilian: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%6', arrested='%7', civ_prof='%8' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,[_this select 8] call DB_fnc_bool,_prof];
};
case independent: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%6',med_prof='%7' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,_prof];
};
};
waitUntil {sleep (random 0.3);
!DB_Async_Active};
_queryResult = [_query,1] call DB_fnc_asyncCall;
Alles anzeigen
7. Unter” if(has_license) then “ müsst er alles ersetzten (Fn_processaction.sqf)
if(_hasLicense) then{_time = 0.3;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then {switch ( _data select 0 ) do{case 1: { _time = 0.4;
_cpUp = 0.01;
};
case 2: { _time = 0.35;
_cpUp = 0.01;
};
case 3: { _time = 0.3;
_cpUp = 0.01;
};
case 4: { _time = 0.25;
_cpUp = 0.01;
};
case 5: { _time = 0.2;
_cpUp = 0.01;
};
case 6: { _time = 0.2;
_cpUp = 0.02;
};
case 7: { _time = 0.2;
_cpUp = 0.03;
};
case 8: { _time = 0.2;
_cpUp = 0.04;
};
case 9: { _time = 0.15;
_cpUp = 0.05;
};
case 10: { _time = 0.1;
_cpUp = 0.07;
};
};
};
while{true} do{sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {};
if(player distance _vendor > 10) exitWith {};
};
if(player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay";
5 cutText ["","PLAIN"];
life_is_processing = false;
};
if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"];
life_is_processing = false;
};
if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"];
[true,_oldItem,_oldVal] call life_fnc_handleInv;
life_is_processing = false;
};
5 cutText ["","PLAIN"];
titleText[format[localize "STR_Process_Processed",_oldVal,_itemName],"PLAIN"];
if( _profName != "" ) then { [_profName,40] call life_fnc_addExp;
};
life_is_processing = false;
}
else{if(life_cash < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText];
5 cutText ["","PLAIN"];
life_is_processing = false;
};
_time = 0.9;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then {switch ( _data select 0) do{case 1: { _time = 0.9;
_cpUp = 0.01;
};
case 2: { _time = 0.8;
_cpUp = 0.01;
};
case 3: { _time = 0.7;
_cpUp = 0.01;
};
case 4: { _time = 0.6;
_cpUp = 0.01;
};
case 5: { _time = 0.5;
_cpUp = 0.01;
};
case 6: { _time = 0.4;
_cpUp = 0.01;
};
case 7: { _time = 0.3;
_cpUp = 0.01;
};
case 8: { _time = 0.2;
_cpUp = 0.01;
};
case 9: { _time = 0.2;
_cpUp = 0.02;
};
case 10: { _time = 0.2;
_cpUp = 0.03;
};
};
};
while{true} do{sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {};
if(player distance _vendor > 10) exitWith {};
};
if(player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay";
5 cutText ["","PLAIN"];
life_is_processing = false;
};
if(life_cash < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText];
5 cutText ["","PLAIN"];
life_is_processing = false;
};
if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"];
life_is_processing = false;
};
if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"];
[true,_oldItem,_oldVal] call life_fnc_handleInv;
life_is_processing = false;
};
5 cutText ["","PLAIN"];
titleText[format[localize "STR_Process_Processed2",_oldVal,_itemName,[_cost] call life_fnc_numberText],"PLAIN"];
life_cash = life_cash - _cost;
if( _profName != "" ) then {[_profName,40] call life_fnc_addExp;
};
life_is_processing = false;
};
Alles anzeigen
8.Unter ”life_action_inuse = true“ müsst er alles ersetzten (Fn_pickaxeUse.sqf)
life_action_inUse = true;
_time = 0;
_profName = [_gather] call life_fnc_profType;
if( _profName != "" ) then {_data = missionNamespace getVariable (_profName);
_time = ( 3 - (0.25 * (_data select 0)));
};
for "_i" from 0 to 2 do{player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
};
sleep _time;
};
if(([true,_mine,_diff] call life_fnc_handleInv)) then{_itemName = [([_mine,0] call life_fnc_varHandle)] call life_fnc_varToStr;
titleText[format[localize "STR_ISTR_Pick_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then {[_profName,25] call life_fnc_addExp;
};
};
life_action_inUse = false;
Alles anzeigen
9.Unter ”life_action_inuse = true“ müsst er alles ersetzten (fn_gather.sqf)
life_action_inUse = true;
_time = 0;
_profName = [_gather] call life_fnc_profType;
if( _profName != "" ) then {_data = missionNamespace getVariable (_profName);
_time = ( 3 - (0.25 * (_data select 0)));
};
for "_i" from 0 to 2 do{player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
};
sleep _time;
};
if(([true,_gather,_diff] call life_fnc_handleInv)) then{_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;
titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then {[_profName,25] call life_fnc_addExp;
};
};
life_action_inUse = false;
Alles anzeigen
10. Unter ”life_gear = _this select 8 down;“ müsst er alles ersetzten (fn_requestRecieved.sqf)
life_gear = _this select 8;
[] call life_fnc_loadGear;
if(count (_this select 9) > 0) then {{missionNamespace setVariable [(_x select 0),[parseNumber (_x select 1), parseNumber (_x select 2)]];
} foreach (_this select 9);
};
//Parse side specific information.
switch(playerSide) do {case west: {__CONST__(life_coplevel, parseNumber(_this select 7));
__CONST__(life_medicLevel,0);
life_blacklisted = _this select 10;
};
case civilian: {life_is_arrested = _this select 7;
__CONST__(life_coplevel, 0);
__CONST__(life_medicLevel, 0);
life_houses = _this select 10;
{_house = nearestBuilding (call compile format["%1", _x select 0]);
life_vehicles pushBack _house;
} foreach life_houses;
life_gangData = _This select 11;
if(count life_gangData != 0) then {[] spawn life_fnc_initGang;
};
[] spawn life_fnc_initHouses;
};
case independent: {__CONST__(life_medicLevel, parseNumber(_this select 7));
__CONST__(life_coplevel,0);
};
};
if(count (_this select 13) > 0) then {{life_vehicles pushBack _x;
} foreach (_this select 12);
};
life_session_completed = true;
Alles anzeigen
11. In der configuration.sqf sucht nach://Setup License Variables{missionNamespace setVariable[(_x select 0),false];} foreach life_licenses; und scheibt folgendes darunter:
life_prof =[["Oil_Prof","civ"],["Iron_Prof","civ"],["Copper_Prof","civ"],["Heroin_Prof","civ"],["Canabis_Prof","civ"],["Cocain_Prof","civ"],["Salt_Prof","civ"],["Fruit_Prof","civ"],["Diamond_Prof","civ"],["Rock_Prof","civ"],["Sand_Prof","civ"]];
//Setup License Variables
{missionNamespace setVariable[(_x select 0),[1,0]];} foreach life_prof;
Alles anzeigen
12. Ladet euch diesen Ordner herunter:Level System (3).zip und fügt die Dateien ein.
Live_Server
13. Ersetzt in der fn_Updaterequest.sqf alles durch das:
/*File: fn_updateRequest.sqfAuthor: Bryan "Tonic" Boardwine Description:Ain't got time to describe it, READ THE FILE NAME!*/
private["_uid","_side","_cash","_bank","_licenses","_gear","_name","_query","_thread"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_side = [_this,2,sideUnknown,[civilian]] call BIS_fnc_param;
_cash = [_this,3,0,[0]] call BIS_fnc_param;
_bank = [_this,4,5000,[0]] call BIS_fnc_param;
_licenses = [_this,5,[],[[]]] call BIS_fnc_param;
_gear = [_this,6,[],[[]]] call BIS_fnc_param;
_prof = [_this, 7,[],[[]]] call BIS_fnc_param;
//Get to those error checks.
if((_uid == "") OR (_name == "")) exitWith {};
//Parse and setup some data.
_name = [_name] call DB_fnc_mresString;
_gear = [_gear] call DB_fnc_mresArray;
_cash = [_cash] call DB_fnc_numberSafe;
_bank = [_bank] call DB_fnc_numberSafe;
//Does something license related but I can't remember I only know it's important?
for "_i" from 0 to count(_licenses)-1 do {_bool = [(_licenses select _i) select 1] call DB_fnc_bool;
_licenses set[_i,[(_licenses select _i) select 0,_bool]];
};
_licenses = [_licenses] call DB_fnc_mresArray;
_prof = [_prof] call DB_fnc_mresArray;
switch (_side) do {case west: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_prof='%7' WHERE playerid='%6'",_name,_cash,_bank,_gear,_licenses,_uid,_prof];
};
case civilian: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%6', arrested='%7', civ_prof='%8' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,[_this select 8] call DB_fnc_bool,_prof];
};
case independent: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%6',med_prof='%7' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,_prof];
};
};
waitUntil {sleep (random 0.3);
!DB_Async_Active};
_queryResult = [_query,1] call DB_fnc_asyncCall;
Alles anzeigen