Moin,
was mir aufgefallen ist dass neben dem standart @life_server ordner noch einen life_hc ordner gibt, welche funktion hat dieser
Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.
Moin,
was mir aufgefallen ist dass neben dem standart @life_server ordner noch einen life_hc ordner gibt, welche funktion hat dieser
Ich danke dir, jetzt funktioniert es
@blackfisch wie meinst du das?
#include "..\..\script_macros.hpp"
/*
File:
Author:
Description:
*/
private["_dialog","_myListBox","_selectedItem","_itemname"];
disableSerialization;
_dialog = findDisplay 25600;
_myListBox = _dialog displayCtrl 25601;
if (lbCurSel _myListBox < 0) exitWith {hint "Bitte wähle ein Item aus";};
_selectedItem = call compile (_myListBox lbData (lbCurSel _myListBox));
_itemname = _selectedItem select 0;
switch (true) do {
case (_itemname isEqualTo "MineDetector"): {
if ([_itemname,false] call life_fnc_handleItem) then {
[true,"waterBottle",1] spawn life_fnc_handleInv;
};
};
default {
hint localize "STR_ISTR_NotUsable";
};
};
Alles anzeigen
So, habs selber zum teil hinbekomen. also der MinenDetector wird mir weggenommen, aber es wird mit keine wasserflasche gegeben....nein es gibt keine fehlermeldung
hast du die spitzhacke in der useitem.sqf eingetragen?
100%tig liegt der fehler hier dran, da ich bestimmt z viel (erstmal) ausgeklammert habe....erstmal deswegen, weil ich ja am probieren bin und wenn funktioniert wird aufgeräumt
#include "..\..\script_macros.hpp"
/*
File: fn_vAH_loadInventory.sqf
Author: Fresqo
Description: Loads players items from person and auction house and displays it in game UID
- The load i gear is from Tonics base code pretty sure
*/
waitUntil {createDialog "itemumwandeln";};
disableSerialization;
_dialog = findDisplay 25600;
_myInvListbox = _dialog displayCtrl 25601;
lbClear _myInvListbox;
playerInventoryArray = [];
_magazines = magazines player;
_items = items player;
_weapons = currentWeapon player;
_uniform = uniform player;
_vest = vest player;
_backpack = backpack player;
{
_index = -1;
_curItemName = _x;
_wasInArray = false;
{
_index = _index + 1;
if (_x select 0 == _curItemName) then {
_wasInArray = true;
playerInventoryArray set [_index,[_curItemName,(_x select 1)+1]];
};
} forEach playerInventoryArray;
if (!_wasInArray) then {
playerInventoryArray set [count playerInventoryArray,[_curItemName,1]];
};
} forEach _magazines;
{
_index = -1;
_curItemName = _x;
_wasInArray = false;
{
_index = _index + 1;
if (_x select 0 == _curItemName) then {
_wasInArray = true;
playerInventoryArray set [_index,[_curItemName,(_x select 1)+1]];
};
} forEach playerInventoryArray;
if (!_wasInArray) then {
playerInventoryArray set [count playerInventoryArray,[_curItemName,1]];
};
} forEach _items;
if (_weapons!="") then {
_index = -1;
_wasInArray = false;
{
_index = _index + 1;
if (_x select 0 == _weapons) then {
_wasInArray = true;
playerInventoryArray set [_index,[_weapons,(_x select 1)+1]];
};
} forEach playerInventoryArray;
if (!_wasInArray) then {
playerInventoryArray set [count playerInventoryArray,[_weapons,1]];
};
};
if (_backpack!="") then {
playerInventoryArray pushBack [_backpack,1];
};
if (_vest!="") then {
_index = -1;
_wasInArray = false;
{
_index = _index + 1;
if (_x select 0 == _vest) then {
_wasInArray = true;
playerInventoryArray set [_index,[_vest,(_x select 1)+1]];
};
} forEach playerInventoryArray;
if (!_wasInArray) then {
playerInventoryArray set [count playerInventoryArray,[_vest,1]];
};
};
if (_uniform!="") then {
_index = -1;
_wasInArray = false;
{
_index = _index + 1;
if (_x select 0 == _uniform) then {
_wasInArray = true;
playerInventoryArray set [_index,[_uniform,(_x select 1)+1]];
};
} forEach playerInventoryArray;
if (!_wasInArray) then {
playerInventoryArray set [count playerInventoryArray,[_uniform,1]];
};
};
private["_allmine","_val","_name"];
//{ _val = ITEM_VALUE(configName _x); if (_val > 0) then { _y = configName _x; _name = _y; playerInventoryArray pushBack [_name,_val,3,"ymenu"]; }; } foreach ("true" configClasses (missionConfigFile >> "VirtualItems"));
playerInventoryArray pushback ["yolo"];
private["_uid","_type","_status","_stat","_itemDisplayName","_pic","_item","_price","_priceDisplay","_time","_timeDisplay","_id","_toDel"];
_uid = getPlayerUID player;
_price = 0;
//{if(_x select 5 == _uid && _x select 1 == 0) then {playerInventoryArray pushBack [_x select 3 select 0,_x select 2,_x select 7,"ymenu",_x select 8,_x select 4,_x select 0]};} forEach all_ah_items; //GET Y MENU AND THEIR STATUS
{if(_x select 5 == _uid && _x select 1 == 1) then {playerInventoryArray pushBack [_x select 3 select 0,_x select 2,_x select 7,"imenu",_x select 8,_x select 4,_x select 0]};} forEach all_ah_items; //GET I MENU AND THEIR STATUS
_index = -1;
if (count playerInventoryArray == 1) then {
_myInvListbox lbAdd format ["You have no items in your inventory or auction house!"];
} else {
{
_status = [_x,2,3,[3]] call BIS_fnc_param;
switch (_status) do {
case 0: {_stat = ": AH: For Sale"}; //AH: for sale
case 1: {_stat = ": AH: Expired"}; //AH: expired
case 2: {_stat = "SOLD SHOULD NOT EVER BE VISIBLE"}; //sold
case 3: {_stat = ": In My Inventory"}; //MY INV
};
_type = [_x,3,"",[""]] call BIS_fnc_param;
_item = _x select 0;
_id = [_x,6,0,[0]] call BIS_fnc_param;
_index = _index + 1;
if (_item == "yolo") then {
//_myInvListbox lbAdd format ["--------------------AUCTION HOUSE ITEMS-----------------------"];
//_myInvListbox lbSetData [(lbSize _myInvListbox)-1,format ["%1",[_x select 0]]];
} else {
switch (_type) do {
case "imenu": {
_itemDisplayName = ([_item] call life_fnc_fetchCfgDetails) select 1;
_pic = [_item] call life_fnc_fetchCfgDetails select 2;
};
/*case "ymenu": {
_itemDisplayName = localize ITEM_NAME(_item);
_pic = M_CONFIG(getText,"VirtualItems",_item,"icon");
_price = [_x,5,0,[0]] call BIS_fnc_param;
_time = [_x,4,0,[0]] call BIS_fnc_param;
_time = round (_time / 3);
if (_time <= 0) then {_price = 0; if (_status == 1) then {_toDel = round(_time + 216); _timeDisplay = format[": Removed in %1 Hrs",_toDel]} else {_timeDisplay = "";};} else {_timeDisplay = format[": Expires in %1 Hrs",_time]};
if (_price == 0) then {_priceDisplay = ""} else {_priceDisplay = format[": Auction Price $%1",[_price]call life_fnc_numberText];};
};*/
default {
_itemDisplayName = ([_item] call life_fnc_fetchCfgDetails) select 1;
_pic = [_item] call life_fnc_fetchCfgDetails select 2;
};
};
_itemQuantity = _x select 1;
_myInvListbox lbAdd format ["(%2) %1 %3",_itemDisplayName,_itemQuantity,_stat];
_myInvListbox lbSetPicture [_index, _pic];
_myInvListbox lbSetPictureColor [_index, [1, 1, 1, 1]];
_myInvListbox lbSetData [(lbSize _myInvListbox)-1,format ["%1",[_x select 0,_type,_status,_itemQuantity,_id]]];
};
} forEach playerInventoryArray;};
Alles anzeigen
Inwiefern dort eingefügt??
Ich schick dir dann mal en Video per PN da zeig ich dir mal im genauen wo ich was eingefügt und eingetragen habe.
Vllt. als hinweis noch nebendran, ich verwende als GUI die oberfläche vom Auktionshaus (die Seite wo du deine sachen zum Verkauf bereitstellen kanst) und habe dies überarbeitet, also Button und felder entfernt und 1 button umbenannt.
Das script scheint ja aber zum teil zu funktionieren, da die Meldung "Der Gegenstand ist nicht benutzbar" vom script selber kommt
Ich vermute dass das Script nicht erkennt was ich ausgewählt habe, aber es erkennt das ich was ausgewählt habe
ja, das ist das einzige neben meiner kleidung was mir angezeigt wird, da ich nix anderes im inventar habe
danke für den hinweis, nur trotzdem funktionierts nicht...wenn ich das Item auswähle und dann auf umwandeln klicke kommt, der gegenstand ist nicht benutzbar
Das script soll ein I-Inventar Item zu einem Z-Inventar Item umwandeln...als Test habe ich einen Minendetector der zu einer Wasserflasche gewechselt werden soll, aber es funktioniert nicht...
Bevor die frage kommt RPT...bla...habe bereits mehrfach durchgeschaut es gibt keine fehlermeldung und auch keine Scriptfehlermeldung im Spiel.
#include "..\..\script_macros.hpp"
private "_item";
disableSerialization;
if ((lbCurSel 25601) isEqualTo -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";};
_item = CONTROL_DATA(25601);
switch (true) do {
case (_item isEqualTo "MineDetector"): {
if ([_item,false,1] call life_fnc_handleItem) then {
["waterBottle",true] spawn life_fnc_handleInv;
};
};
default {
hint localize "STR_ISTR_NotUsable";
};
};
Alles anzeigen
Moin,
ich möchte I Inventar Items (Waffen, Kleidung, etc.) als V Items umwandeln lassen an z.B. einem NPC.
An dem NPC soll sich ein fenster öffnen wo sich alle Aktuell im Rucksack,Veste,Uniform befindlichen Items angezeigt werden und man dort auswählen kann welches Item man umwandeln möchte.
Die benötigten V-Items habe ich bereits erstellt und auch die umwandlung von V-Item zu I-Item funktioniert. nur andersherrum bin ich derzeit etwas überfragt.
Hofe jemand hat eine Idee.
Ok funktioniert nun alles....zu meiner nächsten frage erstelle ich einen neuen Beitrag
Version 4.4r3
ok, danke....muss ich das für jedes item einzeln machen oder gibt es eine möglichkeit das gesammelt zu tun, also das ich alle Items in eine datei schreibe und über die fn_ahsell.sqf das über eine abfrage, abfragen lasse wie viele items derjenige gerade im inventar hat, das die fn_ahsell.sqf eine anfrage an z.b. die fn_ahitems.sqf stellt und fragt welche items im auktionshaus verkauft werden dürfen und das er dann zählt wie viele die person aktuell dabei hat von den jeweiligen items.
hofe es ist verständlich
Moin,
gibt es eine abfragemöglichkeit um zu erfahren we viele vItem (also im Z inventar) ein spieler besitzt?
Ich frage weil ich dies gerne im auktionshaus ändern möche.
derzeit ist die abfrage
_onGuy = {_classname == _x} count (magazines player);
if (_onGuy < _quantity) then {hint "You dont have that many!";_bad = true;}
};
aber ich würde gerne das nur Z-Inventar Items im Auktionshaus verkauft werden können.
wie muss ich
switch (_type) do
{
case 0: {
_realName = localize ITEM_NAME(_classname);
if (_quantity > 100) then {_bad = true; hint "Are you fu*** kidding me, dont be a dickhead, put a proper amount in!"};
};
case 1: {if (_quantity > 1) then
{
_details = [_classname] call life_fnc_fetchCfgDetails;
if (!(_details select 6 == "CfgMagazines")) then {
hint "You can only sell 1 of any of this item!";_bad = true;};
_onGuy = {_classname == _x} count (magazines player);
if (_onGuy < _quantity) then {hint "You dont have that many!";_bad = true;}
};
_realName = ([_classname] call life_fnc_fetchCfgDetails) select 1;
};
};
Alles anzeigen
umschreiben damit der nicht nur die Magazine sondern auch Erste Hilfe kästen und so zählt und ich von dennen dann auch mehr als nur 1 verkaufen kann wie bei den magazinen
alles behoben bis jetzt, nur jetzt besteht noch das problem das man nur 1 item verkaufn kann (wenn man 2 Erste hilfe kästen hat und beide verkaufen möchte dann kommt die meldung "You dont have that many!"
wo ist der fehler
#include "..\..\script_macros.hpp"
/*
File: fn_vAH_sell.sqf
Author: Fresqo
Description: sells items to our auction house and blah blah too much fml
*/
private["_able","_uid","_dialog","_myListbox","_myQuantity","_onGuy","_details","_tquantity","_myTotal","_price","_typeb","_type","_classname","_realName","_bad","_tax","_action","_selectedSell","_quantity","_tochangePriceText","_tochangePriceNumber","_tochangeQuantityText","_tochangeQuantityNumber","_invItem"];
disableSerialization;
_dialog = findDisplay 15600;
_myListbox = _dialog displayCtrl 15601;
_able = 1;
if (!vAH_loaded) exitWith {hint "Auction house is busy at the moment, please try again in a short while!"};
_bad = false;
_realName = "";
/*switch (FETCH_CONST(life_donator)) do {
case 1: {_able = 2};
case 2: {_able = 3};
case 3: {_able = 4};
case 4: {_able = 5};
case 5: {_able = 6};
default {_able = 1};
};
*/
_uid = getPlayerUID player;
if (({_x select 5 == _uid} count all_ah_items) >= _able) exitWith {hint format["You can only have %1 items listed",_able];closeDialog 0;};
_price = ctrlText 15603;
_quantity = ctrlText 15602;
if(! ([_price] call TON_fnc_isnumber)) exitWith {hint "You have to enter a number in the price field.";};
if(! ([_quantity] call TON_fnc_isnumber)) exitWith {hint "You have to enter a number in the quantity field.";};
_price = parseNumber _price;
_quantity = parseNumber _quantity;
if (lbCurSel _myListbox < 0) exitWith {hint "Please select an Item";};
_selectedSell = call compile (_myListbox lbData (lbCurSel _myListbox));
_classname = _selectedSell select 0;
if (_classname == "yolo") exitWith {};
_typeb = _selectedSell select 1;
_invItem = [_selectedSell,2,3,[3]] call BIS_fnc_param;
if (_invItem != 3) exitWith {hint "You cannot sell an item that is already on the auction house, expired, or sold!"};
if(_typeb == "ymenu") then {_type = 0} else {_type = 1};
if (_price < 1) exitWith {hint "Invalid value"};
if (_price > 9000000) exitWith {hint "Invalid value. Must be lower than 9 mil"};
_tax = round (_price * 0.03);
switch (_type) do
{
case 0: {
_realName = localize ITEM_NAME(_classname);
if (_quantity > 100) then {_bad = true; hint "Are you fu*** kidding me, dont be a dickhead, put a proper amount in!"};
};
case 1: {if (_quantity > 1) then
{
_details = [_classname] call life_fnc_fetchCfgDetails;
if (!(_details select 6 == "CfgMagazines")) then {
hint "You can only sell 1 of any of this item!";_bad = true;};
_onGuy = {_classname == _x} count (magazines player);
if (_onGuy < _quantity) then {hint "You dont have that many!";_bad = true;}
};
_realName = ([_classname] call life_fnc_fetchCfgDetails) select 1;
};
};
if (_bad) exitWith {closeDialog 0;};
_action = [format["You will be taxed $%1 . Continue?",_tax],"Auction Confirmation","CONTINUE","CANCEL"] call BIS_fnc_guiMessage;
if(_action) then {
if(BANK < _tax) exitWith {hint "You don't have enough money in the bank to pay the tax";_bad = true;};
switch (_type) do {
case 0: {if(!([false,_classname,_quantity] call life_fnc_handleInv)) then {hint "You dont have that many!";_bad = true;};};
case 1: {
_tquantity = _quantity +1;
for [{_i=1}, {_i<_tquantity}, {_i=_i+1}] do
{
[_classname,false] spawn life_fnc_handleItem;
};
};
};
if (_bad) exitWith {closeDialog 0;};
[4,_type,_quantity,_price,getPlayerUID player,_classname,_realName,name player] remoteExec ["TON_fnc_vAH_update",0];
hint "Auction Successfully Added";
BANK = BANK - _tax;
closeDialog 0;
} else {
closeDialog 0;
};
[1] call SOCK_fnc_updatePartial;
[3] call SOCK_fnc_updatePartial;
Alles anzeigen