Jump to content
  • 0

Config traders shows rocket ammo as the launcher itself


DangerRuss

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";

 

Link to comment
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

Link to comment
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.

 

 

Link to comment
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.

Link to comment
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

 

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...