stimmt. es gibt ja auch das zinventar
ACE 3 Items kaufbar machen
-
- Altis Life
-
Azoni -
15. April 2016 um 20:43
-
-
ich hab das problem das in der 4.4R3 sich nach der behandlung die items löschen im inventar
-
Bei mir funktioniert der Taser nicht mehr und man kann keine Items/Waffen etc mehr kaufen, nur kleidung (Version 3.1.4.8)
Code: fn_handleItem.sqf
Alles anzeigen/* Author: Bryan "Tonic" Boardwine Description Main gear handling functionality. */ private["_item","_details","_bool","_ispack","_items","_isgun","_ongun","_override","_toUniform","_toVest","_preview","_acecheck"]; _item = [_this,0,"",[""]] call BIS_fnc_param; _bool = [_this,1,false,[false]] call BIS_fnc_param; _ispack = [_this,2,false,[false]] call BIS_fnc_param; _ongun = [_this,3,false,[false]] call BIS_fnc_param; _override = [_this,4,false,[false]] call BIS_fnc_param; _toUniform = [_this,5,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a uniform. _toVest = [_this,6,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a vest _preview = [_this,7,false,[true]] call BIS_fnc_param; _acecheck = ["ACE_atropine","ACE_morphine","ACE_epinephrine","ACE_CableTie","ACE_DefusalKit","ACE_M84","ACE_HandFlare_Red","ACE_Flashlight_XL50","ACE_gunbag","ACE_EarPlugs","ACE_acc_pointer_green","ACE_VMH3","ACE_SpottingScope","ACE_TacticalLadder_Pack","ACE_SpraypaintRed","ACE_Tripod","ACE_fieldDressing","ACE_elasticBandage","ACE_bloodIV_250","ACE_tourniquet","ACE_bodyBag","ACE_surgicalKit","ACE_personalAidKit","ACE_Cellphone","ACE_DeadManSwitch","ACE_bloodIV_500"]; //Some checks if(_item == "") exitWith {}; _isgun = false; _details = [_item] call life_fnc_fetchCfgDetails; if(count _details == 0) exitWith {}; if(_bool) then { switch((_details select 6)) do { case "CfgGlasses": { if(_toUniform) exitWith {player addItemToUniform _item;}; if(_toVest) exitWith {player addItemToVest _item;}; if(_ispack) then { player addItemToBackpack _item; } else { if(_override) then { player addItem _item; } else { if(goggles player != "") then { removeGoggles player; }; player addGoggles _item; }; }; }; case "CfgVehicles": { if(backpack player != "") then { _items = (backpackItems player); removeBackpack player; }; player addBackpack _item; clearAllItemsFromBackpack player; if(!isNil {_items}) then { {[_x,true,true,false,true] spawn life_fnc_handleItem; } foreach _items; }; }; case "CfgMagazines": { if(_toUniform) exitWith {player addItemToUniform _item;}; if(_toVest) exitWith {player addItemToVest _item;}; if(_ispack) exitWith {player addItemToBackpack _item;}; player addMagazine _item; }; case "CfgWeapons": { //New addition if(_toUniform) exitWith {player addItemToUniform _item;}; if(_toVest) exitWith {player addItemToVest _item;}; if(_ispack) exitWith {player addItemToBackpack _item;}; if((_details select 4) in [1,2,4,5,4096]) then { if((_details select 4) == 4096) then { if((_details select 5) == -1) then { if(_item in _acecheck) then{player addItem _item;}; _isgun = true; }; } else { _isgun = true; }; };
Code
Alles anzeigen#include <macro.h> /* File: fn_weaponShopBuySell.sqf Author: Bryan "Tonic" Boardwine Description: Master handling of the weapon shop for buying / selling an item. */ disableSerialization; private["_price","_item","_itemInfo","_bad"]; if((lbCurSel 38403) == -1) exitWith {hint localize "STR_Shop_Weapon_NoSelect"}; _price = lbValue[38403,(lbCurSel 38403)]; if(isNil "_price") then {_price = 0;}; _item = lbData[38403,(lbCurSel 38403)]; _itemInfo = [_item] call life_fnc_fetchCfgDetails; _bad = ""; if((_itemInfo select 6) != "CfgVehicles") then { if((_itemInfo select 4) in [4096,131072]) then { if(!(player canAdd _item) && (uiNamespace getVariable["Weapon_Shop_Filter",0]) != 1) exitWith {_bad = (localize "STR_NOTF_NoRoom")}; }; }; if(_bad != "") exitWith {hint _bad}; if((uiNamespace getVariable["Weapon_Shop_Filter",0]) == 1) then { ADD(CASH,_price); [_item,false] call life_fnc_handleItem; hint parseText format[localize "STR_Shop_Weapon_Sold",_itemInfo select 1,[_price] call life_fnc_numberText]; [nil,(uiNamespace getVariable["Weapon_Shop_Filter",0])] call life_fnc_weaponShopFilter; //Update the menu. } else { private["_hideout"]; _hideout = (nearestObjects[getPosATL player,["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"],25]) select 0; if(!isNil "_hideout" && {!isNil {grpPlayer getVariable "gang_bank"}} && {(grpPlayer getVariable "gang_bank") >= _price}) then { _action = [ format[(localize "STR_Shop_Virt_Gang_FundsMSG")+ "<br/><br/>" +(localize "STR_Shop_Virt_Gang_Funds")+ " <t color='#8cff9b'>$%1</t><br/>" +(localize "STR_Shop_Virt_YourFunds")+ " <t color='#8cff9b'>$%2</t>", [(grpPlayer getVariable "gang_bank")] call life_fnc_numberText, [CASH] call life_fnc_numberText ], localize "STR_Shop_Virt_YourorGang", localize "STR_Shop_Virt_UI_GangFunds", localize "STR_Shop_Virt_UI_YourCash" ] call BIS_fnc_guiMessage; if(_action) then { hint parseText format[localize "STR_Shop_Weapon_BoughtGang",_itemInfo select 1,[_price] call life_fnc_numberText]; _funds = grpPlayer getVariable "gang_bank"; _funds = _funds - _price; grpPlayer setVariable["gang_bank",_funds,true]; [_item,true,false,false,true] spawn life_fnc_handleItem; [1,grpPlayer] remoteExecCall ["TON_fnc_updateGang",RSERV]; } else { if(_price > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"}; hint parseText format[localize "STR_Shop_Weapon_BoughtItem",_itemInfo select 1,[_price] call life_fnc_numberText]; SUB(CASH,_price); [_item,true,false,false,true] spawn life_fnc_handleItem; }; } else { if(_price > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"}; hint parseText format[localize "STR_Shop_Weapon_BoughtItem",_itemInfo select 1,[_price] call life_fnc_numberText]; CASH = CASH - _price; [_item,true,false,false,true] spawn life_fnc_handleItem; }; }; [] call life_fnc_saveGear;
Version 3.1.4.8Edit:
Also es liegt an der "fn_weaponShopBuySell" , mit der normalen kann man alles bis auf ace items kaufen, mit der anderen kann man nix mehr kaufen. Wie muss man die modifizieren?
-
Geht das auch für die 4.4 ?
-
Hallo Leute,
Ich habe folgendes Problem, und zwar wenn ich den Classname ACE_WHEEL in die Config_Weapons.hpp eintrage wird mir das Rad als Rucksack erkannt.
Aber es soll im Z Inventar rein ich hab auch schon in der Config_vItems.hpp eine Classname erstellt und es dort eingetragen es geht aber immer noch nicht.
Vielleicht kann mir einer von euch helfen.
Dies bezüglich schon mal Vielen Dank im Vorraus.
MfG: Hahahoho -
-
Habe da nochmal eine Frage zur Ace Leiter müsste man das dann auch so lösen oder br1zey ?
-
denke ja aber die ist doch ein rucksack ....
-
Ja das Problem ist ich kann die nicht aufstellen....
-
funktioniert das auch bei TFAR ?
-
ich habe das iwe im TuT erklärt gemacht nur irgendwie funktioniert das ned
Hier einmel die datein:
Code: fn_handleItem.sqf
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_handleItem.sqf Author: Bryan "Tonic" Boardwine Description Main gear handling functionality. */ private["_item","_details","_bool","_ispack","_items","_isgun","_ongun","_override","_toUniform","_toVest","_preview","_acecheck"]; _item = [_this,0,"",[""]] call BIS_fnc_param; _bool = [_this,1,false,[false]] call BIS_fnc_param; _ispack = [_this,2,false,[false]] call BIS_fnc_param; _ongun = [_this,3,false,[false]] call BIS_fnc_param; _override = [_this,4,false,[false]] call BIS_fnc_param; _toUniform = [_this,5,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a uniform. _toVest = [_this,6,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a vest _preview = [_this,7,false,[false]] call BIS_fnc_param; _acecheck = ["ACE_atropine","ACE_fieldDressing","ACE_elasticBandage","ACE_quikclot","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_bodyBag","ACE_epinephrine","ACE_morphine","ACE_packingBandage","ACE_personalAidKit","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_surgicalKit","ACE_tourniquet","ACE_EarPlugs","ACE_CableTie","ACE_DAGR","ACE_Kestrel4500"]; //Some checks if (_item isEqualTo "") exitWith {}; _isgun = false; _details = [_item] call life_fnc_fetchCfgDetails; if (count _details isEqualTo 0) exitWith {}; if (_bool) then { switch (_details select 6) do { case "CfgGlasses": { if (_toUniform) exitWith {player addItemToUniform _item;}; if (_toVest) exitWith {player addItemToVest _item;}; if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { if (!(goggles player isEqualTo "")) then { removeGoggles player; }; player addGoggles _item; }; }; }; case "CfgVehicles": { if (!(backpack player isEqualTo "")) then { _items = (backpackItems player); removeBackpack player; }; player addBackpack _item; clearAllItemsFromBackpack player; if (!isNil "_items") then { {[_x,true,true,false,true] call life_fnc_handleItem; } forEach _items; }; }; case "CfgMagazines": { if (_toUniform) exitWith {player addItemToUniform _item;}; if (_toVest) exitWith {player addItemToVest _item;}; if (_ispack) exitWith {player addItemToBackpack _item;}; player addMagazine _item; }; case "CfgWeapons": { //New addition if (_toUniform) exitWith {player addItemToUniform _item;}; if (_toVest) exitWith {player addItemToVest _item;}; if (_ispack) exitWith {player addItemToBackpack _item;}; if ((_details select 4) in [1,2,4,5,4096]) then { if ((_details select 4) isEqualTo 4096) then { if ((_details select 5) isEqualTo -1) then { if(_item in _acecheck) then{player addItem _item;}; _isgun = true; }; } else { _isgun = true; }; }; if (_isgun) then { if (!_ispack && _override) exitWith {}; //It was in the vest/uniform, try to close to prevent it overriding stuff... (Actual weapon and not an item) if (_item isEqualTo "MineDetector") then { player addItem _item; } else { player addWeapon _item; }; } else { switch (_details select 5) do { case 0: { if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { if (_item in (assignedItems player)) then { player addItem _item; } else { player addItem _item; player assignItem _item; }; }; }; }; case 605: { if (_ispack) then{ player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { if (headgear player isEqualTo _item && {!_preview}) then { player addItem _item; } else { if (!(headgear player isEqualTo "")) then {removeHeadGear player;}; player addHeadGear _item; }; }; }; }; case 801: { if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { if (player isKindOf "Civilian") then { if (uniform player isEqualTo _item && {!_preview}) then { player addItem _item; } else { if (!(uniform player isEqualTo "")) then { _items = uniformItems player; removeUniform player; }; player addUniform _item; if (!isNil "_items") then { {player addItemToUniform _x} forEach _items; }; }; } else { if (!(uniform player isEqualTo "")) then { _items = uniformItems player; removeUniform player; }; if (!(player isUniformAllowed _item)) then { player forceAddUniform _item; } else { player addUniform _item; }; if (!isNil "_items") then { {player addItemToUniform _x} forEach _items; }; }; }; }; }; case 701: { if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then{ player addItem _item; } else { if (vest player isEqualTo _item && {!_preview}) then { player addItem _item; } else { if (!(vest player isEqualTo "")) then { _items = vestItems player; removeVest player; }; player addVest _item; if (!isNil "_items") then { {[_x,true,false,false,true] spawn life_fnc_handleItem;} forEach _items; }; }; }; }; }; case 201: { if (_ispack) then { player addItemToBackpack _item; } else { private "_type"; _type = [_item,201] call life_fnc_accType; if (_ongun) then { switch (_type) do { case 1: { player addPrimaryWeaponItem _item; }; case 2: { player addSecondaryWeaponItem _item; }; case 3: { player addHandgunItem _item; }; }; } else { if (_override) then { player addItem _item; } else { private["_wepItems","_action","_slotTaken"]; _wepItems = switch (_type) do {case 1:{primaryWeaponItems player}; case 2:{secondaryWeaponItems player}; case 3:{handgunItems player}; default {["","",""]};}; _slotTaken = false; if (!((_wepItems select 2) isEqualTo "")) then {_slotTaken = true;}; if (_slotTaken) then { _action = [localize "STR_MISC_AttachmentMSG",localize "STR_MISC_Attachment",localize "STR_MISC_Weapon",localize "STR_MISC_Inventory"] call BIS_fnc_guiMessage; if (_action) then { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; } else { player addItem _item; //Add it to any available container }; } else { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; }; }; }; }; }; case 301: { if (_ispack) then { player addItemToBackpack _item; } else { private "_type"; _type = [_item,301] call life_fnc_accType; if (_ongun) then { switch (_type) do { case 1: { player addPrimaryWeaponItem _item; }; case 2: { player addSecondaryWeaponItem _item; }; case 3: { player addHandgunItem _item; }; }; } else { if (_override) then { player addItem _item; } else { private["_wepItems","_action","_slotTaken"]; _wepItems = switch (_type) do {case 1:{primaryWeaponItems player}; case 2:{secondaryWeaponItems player}; case 3:{handgunItems player}; default {["","",""]};}; _slotTaken = false; if (!((_wepItems select 1) isEqualTo "")) then {_slotTaken = true;}; if (_slotTaken) then { _action = [localize "STR_MISC_AttachmentMSG",localize "STR_MISC_Attachment",localize "STR_MISC_Weapon",localize "STR_MISC_Inventory"] call BIS_fnc_guiMessage; if (_action) then { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; } else { player addItem _item; //Add it to any available container }; } else { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; }; }; }; }; }; case 101:{ if (_ispack) then { player addItemToBackpack _item; } else { private "_type"; _type = [_item,101] call life_fnc_accType; if (_ongun) then { switch (_type) do { case 1: { player addPrimaryWeaponItem _item; }; case 2: { player addSecondaryWeaponItem _item; }; case 3: { player addHandgunItem _item; }; }; } else { if (_override) then { player addItem _item; } else { private["_wepItems","_action","_slotTaken"]; _wepItems = switch (_type) do {case 1:{primaryWeaponItems player}; case 2:{secondaryWeaponItems player}; case 3:{handgunItems player}; default {["","",""]};}; _slotTaken = false; if (!((_wepItems select 0) isEqualTo "")) then {_slotTaken = true;}; if (_slotTaken) then { _action = [localize "STR_MISC_AttachmentMSG",localize "STR_MISC_Attachment",localize "STR_MISC_Weapon",localize "STR_MISC_Inventory"] call BIS_fnc_guiMessage; if (_action) then { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; } else { player addItem _item; //Add it to any available container }; } else { switch (_type) do { case 1: {player addPrimaryWeaponItem _item;}; case 2: {player addSecondaryWeaponItem _item;}; case 3: {player addHandgunItem _item;}; default {player addItem _item;}; }; }; }; }; }; }; case 621: { if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { player addItem _item; player assignItem _item; }; }; }; case 616: { if (_ispack) then { player addItemToBackpack _item; } else { if (_override) then { player addItem _item; } else { player addItem _item; player assignItem _item; }; }; }; default { if (_ispack) then { player addItemToBackpack _item; } else { player addItem _item; }; }; }; }; }; }; } else { switch (_details select 6) do { case "CfgVehicles": { removeBackpack player; }; case "CfgMagazines": { player removeMagazine _item; }; case "CfgGlasses": { if (_item isEqualTo goggles player) then { removeGoggles player; } else { player removeItem _item; }; }; case "CfgWeapons": { if ((_details select 4) in [1,2,4,5,4096]) then { if ((_details select 4) isEqualTo 4096) then { if ((_details select 5) isEqualTo 1) then { _isgun = true; }; } else { _isgun = true; }; }; if (_isgun) then { switch (true) do { case (primaryWeapon player isEqualTo _item) : {_ispack = false;}; case (secondaryWeapon player isEqualTo _item) : {_ispack = false;}; case (handgunWeapon player isEqualTo _item) : {_ispack = false;}; case (_item in assignedItems player) : {_ispack = false;}; default {_ispack = true;}; }; if (_item isEqualTo "MineDetector") then { player removeItem _item; } else { //Lovely code provided by [OCB]Dash private "_tmpfunction"; _tmpfunction = { private["_tWeapons","_tWeaponCount"]; switch (true) do { case (_this in (uniformItems player)): { _tWeapons = (getWeaponCargo (uniformContainer player)) select 0; _tWeaponCount = (getWeaponCargo (uniformContainer player)) select 1; clearWeaponCargo (uniformContainer player); { _numVestWeps = _tWeaponCount select _forEachIndex; if (_x == _this) then { _numVestWeps = _numVestWeps - 1; }; (uniformContainer player) addWeaponCargo [ _x,_numVestWeps]; }forEach _tWeapons; }; case (_this in (vestItems player)): { _tWeapons = (getWeaponCargo (vestContainer player)) select 0; _tWeaponCount = (getWeaponCargo (vestContainer player)) select 1; clearWeaponCargo (vestContainer player); { _numVestWeps = _tWeaponCount select _forEachIndex; if (_x == _this) then { _numVestWeps = _numVestWeps - 1; }; (vestContainer player) addWeaponCargo [ _x,_numVestWeps]; }forEach _tWeapons; }; case (_this in (backpackItems player)): { _tWeapons = (getWeaponCargo (backpackContainer player)) select 0; _tWeaponCount = (getWeaponCargo (backpackContainer player)) select 1; clearWeaponCargo (backpackContainer player); { _numVestWeps = _tWeaponCount select _forEachIndex; if (_x == _this) then { _numVestWeps = _numVestWeps - 1; }; (backpackContainer player) addWeaponCargo [ _x,_numVestWeps]; }forEach _tWeapons; }; }; }; if (_ispack) then { _item call _tmpfunction; } else { switch (true) do { case (_item in (uniformItems player)): {_item call _tmpfunction;}; case (_item in (vestItems player)) : {_item call _tmpfunction;}; case (_item in (backpackItems player)) : {_item call _tmpfunction;}; default {player removeWeapon _item;}; }; }; }; } else { switch (_details select 5) do { case 0: {player unassignItem _item; player removeItem _item;}; case 605: {if (headgear player isEqualTo _item) then {removeHeadgear player} else {player removeItem _item};}; case 801: {if (uniform player isEqualTo _item) then {removeUniform player} else {player removeItem _item};}; case 701: {if (vest player isEqualTo _item) then {removeVest player} else {player removeItem _item};}; case 621: {player unassignItem _item; player removeItem _item;}; case 616: {player unassignItem _item; player removeItem _item;}; default { switch (true) do { case (_item in primaryWeaponItems player) : {player removePrimaryWeaponItem _item;}; case (_item in handgunItems player) : {player removeHandgunItem _item;}; default {player removeItem _item;}; }; }; }; }; }; }; };
-
Hallo,
Super TuT hat mir sehr geholfen, jedoch gibts bei mir nun ein kleines Problem.
Ace items sind kaufbar und auch die Waffen und andere Items bleiben kaufbar.... Nur wenn man jetzt den Kleidungsshop aufruft und diesen schließt ohne was zu kaufen werden die gegenstände die man im Inventar trägt verdoppelt.
Die logs geben dabei keinerlei hilfe also steht nix weiter drin.
Hoffe jemand hat eine lösung für das kleine Problem =)
MfG
Wolfman
-
Guten Abend, ich hätte da einmal eine Frage bezüglich Ace 3.
Ich habe das alles gemacht und es funktioniert alles wunderbar.
Das Problem was ich jetzt habe sind die Ohrenstöpsel und die Kabelbinder...
Als Medic kann ich die Kaufen und das ohne Probleme, als Zivi, Cop jedoch kaufe ich es aber es kommt einfach nicht in mein Inventar rein.
In den RPT Logs habe ich nichts gefunden.
MfG
LowOesiii
-
Guten Abend, ich hätte da einmal eine Frage bezüglich Ace 3.
Ich habe das alles gemacht und es funktioniert alles wunderbar.
Das Problem was ich jetzt habe sind die Ohrenstöpsel und die Kabelbinder...
Als Medic kann ich die Kaufen und das ohne Probleme, als Zivi, Cop jedoch kaufe ich es aber es kommt einfach nicht in mein Inventar rein.
In den RPT Logs habe ich nichts gefunden.
MfG
LowOesiii
Behoben wie ichs mitbekommen habe, der fehler war die Groß und Klein schreibung der Classnames.
-
Ich melde mich mal nach einiger Zeit der ruhe in diesem Beitrag wegen einem Problem,
Bei mir ist alles kaufbar (ace items kleidung und das gedönns halt) nur Waffen und Magazine nicht
fn_handleItem.sqf
private ["_item","_details","_bool","_ispack","_items","_isgun","_ongun","_override","_toUniform","_toVest","_preview","_acecheck"];
_item = [_this,0,"",[""]] call BIS_fnc_param;
_bool = [_this,1,false,[false]] call BIS_fnc_param;
_ispack = [_this,2,false,[false]] call BIS_fnc_param;
_ongun = [_this,3,false,[false]] call BIS_fnc_param;
_override = [_this,4,false,[false]] call BIS_fnc_param;
_toUniform = [_this,5,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a uniform.
_toVest = [_this,6,false,[false]] call BIS_fnc_param; //Manual override to send items specifically to a vest
_preview = [_this,7,false,[false]] call BIS_fnc_param;
_acecheck = ["ACE_atropine","ACE_morphine","ACE_epinephrine","ACE_fieldDressing","ACE_elasticBandage","ACE_quikclot","ACE_bodyBag","ACE_CableTie","ACE_packingBandage","ACE_EarPlugs","ACE_tourniquet","ACE_surgicalKit","ACE_wirecutter"];
//Some checks
if (_item isEqualTo "") exitWith {};
_isgun = false;
_details = [_item] call life_fnc_fetchCfgDetails;
if (count _details isEqualTo 0) exitWith {};
if (_bool) then {
switch (_details select 6) do {
case "CfgGlasses": {
if (_toUniform) exitWith {player addItemToUniform _item;};
if (_toVest) exitWith {player addItemToVest _item;};
if (_ispack) then {
player addItemToBackpack _item;
} else {
if (_override) then {
player addItem _item;
} else {
if (!(goggles player isEqualTo "")) then {
removeGoggles player;
};
player addGoggles _item;
};
};
};
case "CfgVehicles": {
if (!(backpack player isEqualTo "")) then {
_items = (backpackItems player);
removeBackpack player;
};
player addBackpack _item;
clearAllItemsFromBackpack player;
if (!isNil "_items") then {
{[_x,true,true,false,true] call life_fnc_handleItem; } forEach _items;
};
};
case "CfgMagazines": {
if (_toUniform) exitWith {player addItemToUniform _item;};
if (_toVest) exitWith {player addItemToVest _item;};
if (_ispack) exitWith {player addItemToBackpack _item;};
player addMagazine _item;
};
case "CfgWeapons": {
//New addition
if (_toUniform) exitWith {player addItemToUniform _item;};
if (_toVest) exitWith {player addItemToVest _item;};
if (_ispack) exitWith {player addItemToBackpack _item;};
if ((_details select 4) in [1,2,4,5,4096]) then {
if ((_details select 4) isEqualTo 4096) then {
if ((_details select 5) isEqualTo -1) then {
if(_item in _acecheck) then{player addItem _item;};
_isgun = true;
};
} else {
_isgun = true;
};
};
fn_weaponShopBuySell.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_weaponShopBuySell.sqf
Author: Bryan "Tonic" Boardwine
Description:
Master handling of the weapon shop for buying / selling an item.
*/
disableSerialization;
private ["_price","_item","_itemInfo","_bad"];
if ((lbCurSel 38403) isEqualTo -1) exitWith {hint localize "STR_Shop_Weapon_NoSelect"};
_price = lbValue[38403,(lbCurSel 38403)]; if (isNil "_price") then {_price = 0;};
_item = lbData[38403,(lbCurSel 38403)];
_itemInfo = [_item] call life_fnc_fetchCfgDetails;
_bad = "";
if ((_itemInfo select 6) != "CfgVehicles") then {
if ((_itemInfo select 4) in [4096,131072]) then {
if (!(player canAdd _item) && (uiNamespace getVariable ["Weapon_Shop_Filter",0]) != 1) exitWith {_bad = (localize "STR_NOTF_NoRoom")};
};
};
if (_bad != "") exitWith {hint _bad};
if ((uiNamespace getVariable ["Weapon_Shop_Filter",0]) isEqualTo 1) then {
CASH = CASH + _price;
[_item,false] call life_fnc_handleItem;
hint parseText format [localize "STR_Shop_Weapon_Sold",_itemInfo select 1,[_price] call life_fnc_numberText];
[nil,(uiNamespace getVariable ["Weapon_Shop_Filter",0])] call life_fnc_weaponShopFilter; //Update the menu.
} else {
private _altisArray = ["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"];
private _tanoaArray = ["Land_School_01_F","Land_Warehouse_03_F","Land_House_Small_02_F"];
private _hideoutObjs = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
private _hideout = (nearestObjects[getPosATL player,_hideoutObjs,25]) select 0;
if (!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") >= _price}) then {
_action = [
format [(localize "STR_Shop_Virt_Gang_FundsMSG")+ "<br/><br/>" +(localize "STR_Shop_Virt_Gang_Funds")+ " <t color='#8cff9b'>$%1</t><br/>" +(localize "STR_Shop_Virt_YourFunds")+ " <t color='#8cff9b'>$%2</t>",
[(group player getVariable "gang_bank")] call life_fnc_numberText,
[CASH] call life_fnc_numberText
],
localize "STR_Shop_Virt_YourorGang",
localize "STR_Shop_Virt_UI_GangFunds",
localize "STR_Shop_Virt_UI_YourCash"
] call BIS_fnc_guiMessage;
if (_action) then {
hint parseText format [localize "STR_Shop_Weapon_BoughtGang",_itemInfo select 1,[_price] call life_fnc_numberText];
_funds = group player getVariable "gang_bank";
_funds = _funds - _price;
group player setVariable ["gang_bank",_funds,true];
[_item,true] spawn life_fnc_handleItem;
if (life_HC_isActive) then {
[1,group player] remoteExecCall ["HC_fnc_updateGang",HC_Life];
} else {
[1,group player] remoteExecCall ["TON_fnc_updateGang",RSERV];
};
} else {
if (_price > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
hint parseText format [localize "STR_Shop_Weapon_BoughtItem",_itemInfo select 1,[_price] call life_fnc_numberText];
CASH = CASH - _price;
[_item,true,false,false,true] spawn life_fnc_handleItem;
};
} else {
if (_price > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
hint parseText format [localize "STR_Shop_Weapon_BoughtItem",_itemInfo select 1,[_price] call life_fnc_numberText];
CASH = CASH - _price;
[_item,true,false,false,true] spawn life_fnc_handleItem;
};
};
[0] call SOCK_fnc_updatePartial;
[] call life_fnc_saveGear;
Vielen dank im vorraus
Mfg
Duelist
-
in Welche datei muss ich das eintragen das ich es im Shop kaufen kann ?
Danke
-
-
Das Tut für 4.X Versionen folgt!
Wo?
-
Funktioniert in der 5.0! Geiel
-
Funktioniert in der 5.0! Geiel
Kann ich bestätigen!!! - Hab das Tut erst nicht angefasst, weil ich dachte es funzt halt nicht für 5.0 - aber tut es!
-