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
/*
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;
};
};
Alles anzeigen
Code
#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;
Alles anzeigen
Version 3.1.4.8
Edit:
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?