Jump to content

Leigham

Member
  • Content Count

    322
  • Joined

  • Last visited

  • Days Won

    1

Leigham last won the day on January 17 2015

Leigham had the most liked content!

About Leigham

  • Rank
    Hardened

Recent Profile Visitors

1475 profile views
  1. since making this I have come a little way way it comes to developing, so in the next few days, I will put up a test server, and remake this :)
  2. does anyone if this works with the new version, if it doesnt I might update it :D
  3. Leigham

    Quick Question.

    Still need help if poss
  4. Leigham

    Quick Question.

    _GetVehicleClassnameFromList = { { if(_selectionData == (_x select 0))then{ _VehicleClassname = _x Select 0; diag_log format ["%1",_VehicleClassname]; // Gives the Right Classname; }; }foreach UG_VehicleList; _VehicleClassname // Return Variable. // Is this right, in this position ? }; _Vehicleinfo = call _GetVehicleClassnameFromList; // Calling the function to get the classname from the list. Diag_Log format ["%1",_VehicleInfo]; //This One, Undefined Variable. This is what Ive put to first test what you have given me and alter in the way I think I need to.
  5. Leigham

    Quick Question.

    Still Stuck on this part. Any help is great.
  6. Leigham

    Quick Question.

    So Basically, the best way to do it for me would be, one function to get the wanted array, and sort them into variables. then another function for each variable, that needs one, (IE. one for checking the inventory, one for the spawning of the crafted vehicle, and removing items, an such Edit, Something like if the classname was "Mosquito_Epoch" _GetChosenVehicleClassname = { if(_selectionData == (_x select 0))then{ _VehicleClassname = _x Select 0; _VehicleClassname }; }foreach UG_VehicleList; _VehicleClassname = Call _GetChosenVehiclename; Systemchat format ["%1",_VehicleClassname]; Would that return "Mosquito_Epoch" ?
  7. Leigham

    Quick Question.

    I Dont know whats going on, im not too sure on how to pass a variable out of the foreach loop, to be used outside of it after searching for the Items heres what I have disableSerialization; _display = findDisplay 7770; _ObjectTypeText = _display displayCtrl 7779; _typeselection = lbCurSel _ObjectTypeText; _ObjectTypeName = lbtext [7779,_typeselection]; _index = lbCurSel _ObjectTypeText; //index is required to access data _selectionData = _ObjectTypeText lbData _index; //className we saved earlier in a data field diag_log format ["%1-%2",_selectionData,_ObjectTypeName]; { if(_selectionData == (_x select 0))then{ Diag_Log format ["%1",_x];//Dialogging the Whole Chosen Array. _CraftingItems = _x Select 1;//Getting the Items Needed to Craft _CraftingSave = _x Select 2;//Is the Vehicle going to be saved ? _CraftingKrypto = _x Select 3;//How Much Krypto _CraftingIteems pushBack [_craftingItems]; //Arma 3 }; _itemsOnPlayer = (magazines player) + (items player) + (weapons player); _found = []; _foundPlusCount = []; //Find and Find + count { if (_x in _itemsOnPlayer) then { //found item on player if !(_x in _found) then { //but only if item is not already added _found pushBack _x; //Arma 3 _y = _x; //can't use magic var further, so store it in _y or w/e _count = { _x == _y} count _itemsOnPlayer; _foundPlusCount pushBack [_y,_count]; //Arma 3 systemchat format ["%1 %2,_Count,_foundPlusCount"]; }; }; } forEach _CraftingIteems; }forEach UG_VehicleList;
  8. Leigham

    Quick Question.

    This is where im up too Say I wanted to search a players inventory for a random array of items ThisNestedArrays = [ ["ItemClassname",[1,1,1,2,2,3]], ["ItemClassname",[2,3,3,4,5]], ["ItemClassname",[2,4,5,6,7,7,3]] ]; I know i would use a foreach loop to check something like, { _ItemClassname = _x select 0; _ItemArray = _x Select 1; //this is the part I need help with //Something like { if(_x in (magazines player))then{ //Maybe ? I want it to check for all the Items in the players inventory before carrying on. }foreach _ItemArray; }foreach ThisNestedArrays;Any Help would be Great, Can provide a Github, link for people who want a look. Edit, forgot to put, each number represents an Item, and the multiples are there for a reason, so if I needed to search for a multiple of the same Item.
  9. Leigham

    Quick Question.

    So Im to the point where it is checking the players inventory for the required Items and got it to Diag _log what is needed, but if there is more than 1 of an Item, it is still only checking if there is 1 in his inventory.
  10. Leigham

    Quick Question.

    The list box is showing the Display name already, im onto the actual spawning part of the dialog, after clicking the spawn button. just need to find a way of searching for multiples of the same item. UG_Classname Vehicle is changing the displayname to classname, im using that to changed the selected item into the Classname, so I can compare that to the {_x select 0;}foreach UG_VehicleList; in the spawn vehicle script.
  11. Leigham

    Quick Question.

    https://github.com/Leigham/Epoch-Action-Menu/blob/master/ActionMenu/Scripts/SpawnVehicle.sqf specifically this file. if you could take a look it would be great.
  12. Leigham

    Quick Question.

    Im working on a script, and Im so Close to finishing, just this one thing Keeps getting stuck Ill explain Below. If I have an array. UG_VehicleList = [ ["Mosquito_Epoch",[""],false,0], ["Mosquito_Epoch",[""],true,0], ["Ebike_Epoch",[""],false,0], ["Ebike_Epoch",[""],true,0] ]; and I wanted to do if(_CraftingItems == "")then{exitwith {};}else{ { _CraftingItems = _x select 2; if(_CraftingItems in (magazines player))then{ }foreach UG_VehicleList; }I cant get that to check for multiples of the same item, I want it to check if the player has all the items in the array before it takes it out.
  13. For the Crafting part of it, I have an array, which you can add more vehicles to it. ["Mosquito_Epoch",[""],true,0] ["Vehicle_Classname",["Items It Will Cost"],SavetoDB true or false,how much krypto it will cost]
×
×
  • Create New...