Jump to content
  • 0
DangerRuss

Config traders shows rocket ammo as the launcher itself

Question

So I guess because the classnames are exactly the same, you can't sell rockets at the traders. When you go to sell your rocket (ammunition) it thinks it is the rocket launcher (Weapon) ,even though I've clearly defined it as a magazine in the config traders, It won't actually let you sell the rocket.

For example

class Igla {
        type = "trade_weapons";

class Igla {
		type = "trade_weapons";

and

class Igla {
		type = "trade_items";

 

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

 a few time ago i was try to make it, and yes, all  magazines and launcher have the same name.

Maybe u can make an special Trader to sell and bougth it. for example a trader who spawn a custom crate when you buy an launcher,  and delete plaeyer weapon and magazines.

if ure using gold system try:

Firts u needs to crate a new trader trought arma2oa editor and call this addon by init.sqf  or take an id of deafault trader (more easy) for example Black Market trader.

then create:

roketsbuy.sqf (must be into custom\rockets\):

Spoiler

private ["_playerPos","_neartrade","_cost"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, [TRADER ID HERE], 3] > 0;
_cost = "ItemGoldBar" in magazines player;  //change for another if u want

if (!_cost) exitWith {cutText [format["Needs 1x ItemGoldBar to buy a roket launcher package"], "PLAIN DOWN"];};

if (_neartrader && _cost)  then {

titleText ["Bought Roket Launcher Package", "PLAIN DOWN"];titleFadeOut 5;

player removeMagazine "ItemGoldBar";

player addMagazine "ROKETLAUNCHER AMMOID HERE";

player addWeapon "ROKETLAUNCHER WEAPON ID HERE";

sleep 2;

};

 

or make it trougth crates.

Spoiler

private ["_playerPos","_neartrade","_cost"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, [TRADER ID HERE], 3] > 0;
_cost = "ItemGoldBar" in magazines player;  //change for another if u want

if (!_cost) exitWith {cutText [format["Needs 1x ItemGoldBar to buy a roket launcher package"], "PLAIN DOWN"];};

if (_neartrader && _cost)  then {

titleText ["Bought Roket Launcher Package", "PLAIN DOWN"];titleFadeOut 5;

player removeMagazine "ItemGoldBar";

_crate12 = objNull;
                if (true) then
                {
                _this = createVehicle ["USBasicWeapons_EP1", _playerPos, [], 0, "CAN_COLLIDE"];
                _crate12 = _this;
                 clearWeaponCargoGlobal _crate12;
                 clearMagazineCargoGlobal _crate12;  
                _crate12 addWeaponCargoGlobal   ["ROKETLAUNCHER ID HERE", 1];                  
                _crate12 addmagazinecargoglobal  ["ROKETLAUNCHER AMMO HERE", 2];    
                                
            };
             sleep 60;
                deleteVehicle _crate12; 

};

 

 

then go to the bottom of your fn_selfaction.sqf and add

Spoiler

////////////rokets//
private["_playerPos","_neartrade"];


_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, ["TRADERID HERE"], 3] > 0;
 
if (_neartrade) then {
        if (s_player_buyy < 0) then {
            s_player_buyy = player addaction[("<t color=""#3399cc"">" + ("BuyRocketPackage") +"</t>"),"custom\rockets\rocketsbuy.sqf"];
        };
    } else {
        player removeAction s_player_buyy;
        s_player_buyy = -1;
    };
////////////////

***This add a new option on scroll menu to buy rockets when youre infront of this special trader.

***its not tested

Share this post


Link to post
Share on other sites
  • 0
On 5/23/2016 at 5:08 PM, Shawn said:

Is it advanced trader not letting you, or the actual epoch trader menu?

It's both

 
On 5/23/2016 at 0:21 PM, juandayz said:

 a few time ago i was try to make it, and yes, all  magazines and launcher have the same name.

Maybe u can make an special Trader to sell and bougth it. for example a trader who spawn a custom crate when you buy an launcher,  and delete plaeyer weapon and magazines.

if ure using gold system try:

Firts u needs to crate a new trader trought arma2oa editor and call this addon by init.sqf  or take an id of deafault trader (more easy) for example Black Market trader.

then create:

roketsbuy.sqf (must be into custom\rockets\):

  Reveal hidden contents

private ["_playerPos","_neartrade","_cost"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, [TRADER ID HERE], 3] > 0;
_cost = "ItemGoldBar" in magazines player;  //change for another if u want

if (!_cost) exitWith {cutText [format["Needs 1x ItemGoldBar to buy a roket launcher package"], "PLAIN DOWN"];};

if (_neartrader && _cost)  then {

titleText ["Bought Roket Launcher Package", "PLAIN DOWN"];titleFadeOut 5;

player removeMagazine "ItemGoldBar";

player addMagazine "ROKETLAUNCHER AMMOID HERE";

player addWeapon "ROKETLAUNCHER WEAPON ID HERE";

sleep 2;

};

 

or make it trougth crates.

  Reveal hidden contents

private ["_playerPos","_neartrade","_cost"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, [TRADER ID HERE], 3] > 0;
_cost = "ItemGoldBar" in magazines player;  //change for another if u want

if (!_cost) exitWith {cutText [format["Needs 1x ItemGoldBar to buy a roket launcher package"], "PLAIN DOWN"];};

if (_neartrader && _cost)  then {

titleText ["Bought Roket Launcher Package", "PLAIN DOWN"];titleFadeOut 5;

player removeMagazine "ItemGoldBar";

_crate12 = objNull;
                if (true) then
                {
                _this = createVehicle ["USBasicWeapons_EP1", _playerPos, [], 0, "CAN_COLLIDE"];
                _crate12 = _this;
                 clearWeaponCargoGlobal _crate12;
                 clearMagazineCargoGlobal _crate12;  
                _crate12 addWeaponCargoGlobal   ["ROKETLAUNCHER ID HERE", 1];                  
                _crate12 addmagazinecargoglobal  ["ROKETLAUNCHER AMMO HERE", 2];    
                                
            };
             sleep 60;
                deleteVehicle _crate12; 

};

 

 

then go to the bottom of your fn_selfaction.sqf and add

  Reveal hidden contents

////////////rokets//
private["_playerPos","_neartrade"];


_playerPos = getPosATL player;
_neartrade = count nearestObjects [_playerPos, ["TRADERID HERE"], 3] > 0;
 
if (_neartrade) then {
        if (s_player_buyy < 0) then {
            s_player_buyy = player addaction[("<t color=""#3399cc"">" + ("BuyRocketPackage") +"</t>"),"custom\rockets\rocketsbuy.sqf"];
        };
    } else {
        player removeAction s_player_buyy;
        s_player_buyy = -1;
    };
////////////////

***This add a new option on scroll menu to buy rockets when youre infront of this special trader.

***its not tested

Thank you for the suggestion but it's a bit much honestly. Also the problem is only when the player wishes to sell the rockets, not purchase. You can purchase fine.

 

 

Share this post


Link to post
Share on other sites
  • 0
On 5/23/2016 at 5:08 PM, Shawn said:

Is it advanced trader not letting you, or the actual epoch trader menu?

It's both.

Quote

Maybe u can make an special Trader to sell and bougth it. for example a trader who spawn a custom crate when you buy an launcher,  and delete plaeyer weapon and magazines.

Thank you for the suggestion but thats a bit much for me. Also, the problem is only with selling, not purchasing.

Share this post


Link to post
Share on other sites
  • 0

I saw Ebay make this commit on the github:

 

in your advanced trading folder\functions\z_at_sellitems.sqf

 

replace:

_localResult = [player,(_x select 0),1] call BIS_fnc_invRemove;

 

with:

 

				_name = _x select 0;
				_type = _x select 1;
				if (_type == "trade_items") then {_name = configFile >> "CfgMagazines" >> _name;};
				if (_type == "trade_weapons") then {_name = configFile >> "CfgWeapons" >> _name;};
				_localResult = [player,_name,1] call BIS_fnc_invRemove; // Use config for BIS_fnc_invRemove

 

Share this post


Link to post
Share on other sites
  • 0

Yes first and foremost thanks to Ebay for being one of the last Arma Guru's to still work on arma 2. Your DZGM and ESSv2 are basically apart of the mod now. Almost every server uses your mods! 

Back on topic. This appears to fix the issue for regular trading, but not for advanced trading. Advanced trading still shows the weapon instead of the magazine. When you try and sell more than one of those weapon, only the actual weapon sells so you can't exploit this but you still cant sell rockets with advanced trading. Regular trading seems to work fine.

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, DangerRuss said:

yea really strange, making that edit gets it working with regular trade but not advanced. At least not with the IGLA I was testing it with. 

 

that doesn't make sense as you are making the change to advanced trading?!

Share this post


Link to post
Share on other sites
  • 0

	if(Z_SellingFrom == 2)then{
        _wA = [];
        _mA = [];
        {
            //_localResult = [player,(_x select 0),1] call BIS_fnc_invRemove;
            //Fix so rocket mags and weapons can be sold
            _name = _x select 0;
                _type = _x select 1;
                if (_type == "trade_items") then {_name = configFile >> "CfgMagazines" >> _name;};
                if (_type == "trade_weapons") then {_name = configFile >> "CfgWeapons" >> _name;};
                _localResult = [player,_name,1] call BIS_fnc_invRemove; // Use config for BIS_fnc_invRemove
	            if( _localResult != 1)then{
                if(_x select 1 == "trade_items")then{
                    _mA set [count(_mA),0];
                }else{
                    _wA set [count(_wA),0];
                };
            }else{
                if(_x select 1 == "trade_items")then{
                    _mA set [count(_mA),1];
                }else{
                    _wA set [count(_wA),1];
                };
            };
	        }count Z_SellArray;
	        _outcome set [0,_mA];
        _outcome set [1,_wA];
        _outcome set [2,[]];
    };
	

20160529003314_1.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...