Jump to content

Zelik

Member
  • Posts

    21
  • Joined

  • Last visited

Posts posted by Zelik

  1. Okay guys, I have seen a lot of people having trouble adding weapons and items to their traders. I will admit that I was having the same problem as well. So I decided to make a program for myself to help out with the problem. Today I finally decided to release the program to the community to help others out. :)
    So first things first, You can download the program from Here  Check out all of the spoilers for help.
     
    When you open it up it will look something like this, depending on your version of windows.

    yKPK1Fp.png

     

    For the

    LAST INDEX enter the last id used in your traders_data. On an unaltered server, this number is 7574
    Then click the SET button. For the ITEM NAME enter the items class name that you wish to add. ITEM COUNT is how many of that item you wish to add. TRADER TID is the id for the menu that you would like to add the item too. I'll come back TRADER TID later. BUY, SELL and TYPE are self explanatory. The CHECKBOX is only to be used if this is the last item you are adding at the time. After you have input all of the data you need click the NEXT button and it will add it to the preview text box. Then just alter your inputs for the next item and click NEXT again. Once you are done save your sql, then upload to your database. It's that easy.

     

    Now for the

    TRADER TID part. It's all pretty easy. Just go Here and then open the folder that corresponds to your server type. Mine for example would be DayZ_Epoch_16.Panthera2. Within this folder open server_traders.sqf. You will also be able to find this file in your mission.pbo but, I figured this way would be easier for some.Now for instance I want to add the DMR to my hero trader, I'll have a look at my server_traders.sqf and within it I see
    // DayZ Epoch TRADERS for 17
    serverTraders = ["Tanny_PMC","BAF_Soldier_AMG_W","BAF_Soldier_AAA_DDPM","CZ_Special_Forces_MG_DES_EP1","Damsel5","GUE_Commander","GUE_Woodlander1","GUE_Woodlander3","GUE_Soldier_Sab","GUE_Soldier_Pilot","GUE_Soldier_2","Soldier_PMC","Citizen2_EP1","Rita_Ensler_EP1","RU_Farmwife1","US_Soldier_Medic_EP1","USMC_Soldier_TL","USMC_SoldierS_Engineer","UN_CDF_Soldier_AAT_EP1","ValentinaVictim","UN_CDF_Soldier_MG_EP1","GUE_Soldier_1","FR_Corpsman","GUE_Soldier_AR","Dr_Hladik_EP1","RU_Villager1","Reynolds_PMC"];
    // Hero Vendor P
    menu_Tanny_PMC = [
    	[["Ammunition",478],["Clothes",476],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477]],
    	[],
    	"hero"
    ];
    // Ammunition Neutral P
    menu_BAF_Soldier_AMG_W = [
    	[["Assault Rifle Ammo",480],["Light Machine Gun Ammo",481],["Pistol Ammo",484],["Shotguns and Single-shot Ammo",573],["Sniper Rifle Ammo",482],["Submachine Gun Ammo",483]],
    	[],
    	"neutral"
    ]; 

    Bingo, Now I know that my TRADER TID for my Hero traders weapon category is 477. Now I'll input this into my program like so.9Ebu4Ab.png

    7574 goes into the LAST INDEX because I know it is the last used id in my traders_data. Click the SET button. Enter the weapons class name and other info, click the CHECKBOX because this is the only weapon I want to add. Then just save and import. :)

    I hope this is easy to understand and use. If not just let me know. I hope you guys like and enjoy this.

    If you have any suggestions I may be able to add them. Have a great day!

    Thanks,

    -Z

     

    And just so everyone feels a little safer.

    http://virusscan.jotti.org/en/scanresult/4bfc071e4742ab59a219a0d2e6b4eab6b138023f

    https://www.virustotal.com/en/file/338be750f28a82f855525615e8ff1f851dd555947e3d4fbee782097068ef5685/analysis/1400816403/

  2. Good. What did you end up with?

    closeDialog 0;
    _current = currentWeapon player;
    _primary = primaryWeapon player;
    
    if (_current == _primary) then {
    	player action ["WeaponOnBack", player] //puts primary weapon on your back
    	sleep 1; //waits long enough to finish animation
    	player action ["handGunOn", player]; //switches to pistol
    	sleep 1; //extra wait, just in case the animation is interrupted, via movement etc.
    } else { 
    	cutText ["You are already holding a secondary weapon!","PLAIN"];
    };
    
  3.  

    This should work.

    closeDialog 0;
    _current = currentWeapon player;
    _primary = primaryWeapon player;
    
    if (_current == _primary) then {
    	player action ["handGunOn", player];	
    } else { 
    	cutText ["You are already holding a secondary weapon!","PLAIN"];
    };
    

    I think it may work if I add sleep like lmapper said, I believe the animation is being interrupted by the else section of the code. Sleeping for about 3 seconds should allow the action to complete before the rest of the code is called. What do you think? I haven't tried it yet but, it sounds very plausible. By the way, thank you for the help. I appreciate it very much. 

  4. I'm from the U.S., I don't have much experience writing scripts but, I do know how to install them. Not much experience with infistar's antihack either. From what I hear it's a pain trying to install scripts if you use it.

  5.  

    This should work.

    closeDialog 0;
    _current = currentWeapon player;
    _primary = primaryWeapon player;
    
    if (_current == _primary) then {
    	player action ["handGunOn", player];	
    } else { 
    	cutText ["You are already holding a secondary weapon!","PLAIN"];
    };
    

    Your code works but, the handGunOn action "plays" immediately, couldn't I use the waituntil?

    //Example:
    waitUntil player action ["handGunOn", player]; 
    

    Not sure the syntax but something like that? Thanks in advance

  6.  

    This should work.

    closeDialog 0;
    _current = currentWeapon player;
    _primary = primaryWeapon player;
    
    if (_current == _primary) then {
    	player action ["handGunOn", player];	
    } else { 
    	cutText ["You are already holding a secondary weapon!","PLAIN"];
    };
    

    Giving it a try now, thanks.

  7. Did you get any errors? Check client .rpt or add -showScriptErrors to your start parameters.

    14:05:18 bin\config.bin/CfgMovesZombie/States/AmovPercMrunSnonWnonDfr.InterpolateTo: item count not multiple of 2 (is 17)
    14:05:18   bin\config.bin/CfgMovesZombie/States/AmovPercMrunSnonWnonDfr.InterpolateTo: Bad move 
    14:05:18 bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDl.InterpolateTo: item count not multiple of 2 (is 9)
    14:05:18   bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDl.InterpolateTo: Bad move 
    14:05:18 bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDb.InterpolateTo: item count not multiple of 2 (is 9)
    14:05:18   bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDb.InterpolateTo: Bad move 
    14:05:18 bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDbr.InterpolateTo: item count not multiple of 2 (is 9)
    14:05:18   bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDbr.InterpolateTo: Bad move 
    14:05:18 bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDfr.InterpolateTo: item count not multiple of 2 (is 11)
    14:05:18   bin\config.bin/CfgMovesZombie/States/AmovPpneMrunSnonWnonDfr.InterpolateTo: Bad move 
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medicEnd
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic0S
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic0
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic1
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic2
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic3
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic3
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic4
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic5
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic4
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDnon_medic5
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic0S
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic0
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic1
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.ConnectTo: Bad move AinvPknlMstpSnonWnonDr_medic2
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.InterpolateTo: Bad move AinvPknlMstpSnonWnonDnon_medic0S
    14:05:18   bin\config.bin/CfgMovesZombie/States/AinvPknlMstpSnonWnonDnon_medic.InterpolateTo: Bad move AinvPknlMstpSnonWnonDr_medic0S
    14:07:01 "get: STRING (134757638), sent: STRING (134757638)" 

    These are the errors I get from the right click option.

  8.  

    Maybe something like this

    closeDialog 0;
    _current = currentWeapon player;
    _primary = primaryWeapon player;
    _secondary = secondaryWeapon player;
    
    if (_current == _primary) then {
    	player selectWeapon _secondary;
    } else { 
    	cutText ["You are already holding a secondary weapon!","PLAIN"];
    };
    

    Your cutText code is working when I am already switched to the secondary but not the selectWeapon part. Any clues? Is the syntax correct? Thanks in advance.

  9. I am the type of person who hates using the self action scroll buttons to do things so I decided to look into the remove options problem that the toolbox has. This will fix the problem with not being able to remove tank traps and some camo nets via the right click menu for the toolbox.

     

    Upon writing this tutorial/fix I assume everyone knows how to call a custom sqf file and I assume everyone already has a custom compiles.sqf. I also will NOT be held reliable if you break your server. I did this on my test server and my live server and have no problems. Lets begin.

     

    First thing we need to do is get your object_removeTankTrap.sqf and object_removeNet.sqf. Both of these files can be found in the compile folder within dayz_code.pbo. Place these two files in your custom/fixes folder within your mission.pbo. or mission folder.

     

    Now open your object_removeTankTrap.sqf and find this code

    _nearTankTraps = nearestObjects [player, ["Hedgehog_DZ"], 1];
    
    

    and change it to 

    _nearTankTraps = nearestObjects [player, ["Hedgehog_DZ"], 3];

    This increases the range a little bit to help the action actually work a little easier. I wouldn't change it to anything higher than 3. Save and close our sqf. 

    Now open your object_removeNet.sqf and find this code

    _nearNets = nearestObjects [player, ["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5];
    

    and change it to

    _nearNets = nearestObjects [player, ["DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 10];
    

    What this does is increase the distance a little bit making the action happen a little easier and replaces the error in the code that had the large desert net referenced twice. Now all 4 of the nets can be removed with the toolbox. Don't change to anything higher than 10. Save and close your sqf. 

    Now open our custom compiles.sqf. Now find these lines. 

    player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf";
    player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf";
    

    Comment them out and call your custom file location like so

    //player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf";
    //player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf";
    
    player_removeNet = compile preprocessFileLineNumbers "custom\object_removeNet.sqf";
    player_removeTankTrap = compile preprocessFileLineNumbers "custom\object_removeTankTrap.sqf";
    

    Save your compiles and you're done. I don't think I did that bad for my very first tutorial lol. Have a good night and I hope I helped. I'm sure there are other people out there that noticed that the right clicking for the toolbox didn't work right. :)

  10. I have been trying to make a right click option for pistols, I want to be able to switch to the pistol by right clicking it. I have tried many different ways but nothing has worked. I could use some help. I thought that i could use this syntax.

    Private ["_Current","_Secondary"]
    _Current = currentWeapon player;
    _Secondary = secondaryWeapon player;
    if ((_Current) != _Secondary)
    then 
    {player selectWeapon _Secondary;} 
    else 
    { //Whatever else here }
    

    Any info on this subject is needed. Thanks in advance. I have looked and looked for workarounds for this but have came up short every time.

    FYI, I have all of the right click scripts installed on my server, I can get scripts to run via the right click menu, I just need help with this particular coding.

×
×
  • Create New...