marcheur

Custom Traders code problem... I need a littl hand :)

8 posts in this topic

Hey there,

I have no clue why I can get only the first of my custom traders working... Maybe a second pair of eyes can help !

Here is in my config.cpp custom traders,

Spoiler

    class Exile_Trader_CommunityCustoms
    {
        name = "Didier l'embrouille";
        showWeaponFilter = 0;
        categories[] =
        {
            "cuphelicos",
            "marcheurchars"
        };
    };

    class Exile_Trader_CommunityCustoms2
    {
        name = "Mike la banane";
        showWeaponFilter = 0;
        categories[] =
        {
            "marcheurconsommables",
            "marcheurutils",
            "marcheurfringues"
        };
    };

    class Exile_Trader_CommunityCustoms3
    {
        name = "Mich l'autre banane";
        showWeaponFilter = 1;
        categories[] =
        {
            "marcheurarmes"
        };
    };

first one sells vehicles, second ones food, meds and some clothes, and third one sells armory stuff (few guns, scopes, silences... that kind of stuff)

 

Here is in my initPlayerLocal sample code

Spoiler

_trader =
[
    "Exile_Trader_Vehicle",
    "WhiteHead_11",
    ["HubStandingUA_move1", "HubStandingUA_move2", "HubStandingUA_idle1", "HubStandingUA_idle2", "HubStandingUA_idle3"],
    [16789.2, 18206.7, 0.29113],
    90
]
call ExileClient_object_trader_create;

_trader forceAddUniform "U_B_CombatUniform_mcam_tshirt";
_trader addVest "V_PlateCarrierSpec_mtp";
_trader addHeadgear "H_Bandanna_mcamo";
_trader addGoggles "G_Bandanna_khk";
_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms"];

_trader =
[
    "Exile_Trader_CommunityCustoms2",
    "PersianHead_A3_02",
    ["HubStanding_idle1", "HubStanding_idle2", "HubStanding_idle2"],
    [16794.2, 18210.7, 0.501631],100,
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms2"];

_trader =
[
    "Exile_Trader_CommunityCustoms3",
    "GreekHead_A3_07",
    ["HubStanding_idle1", "HubStanding_idle3", "HubStanding_idle3"],
    [16799.2, 18214.7, 0.701631],110,
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms3"];

And... Only first one works :D

Of course, all the categories exists and have stuff in it...

Any idea ?

Share this post


Link to post
Share on other sites

Posted (edited)

_trader =
[
    "Exile_Trader_Vehicle",
    "WhiteHead_11",
    ["HubStandingUA_move1", "HubStandingUA_move2", "HubStandingUA_idle1", "HubStandingUA_idle2", "HubStandingUA_idle3"],
    [16789.2, 18206.7, 0.29113],
    90
]
call ExileClient_object_trader_create;

_trader forceAddUniform "U_B_CombatUniform_mcam_tshirt";
_trader addVest "V_PlateCarrierSpec_mtp";
_trader addHeadgear "H_Bandanna_mcamo";
_trader addGoggles "G_Bandanna_khk";
_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms"];

_trader =
[
    "Exile_Trader_CommunityCustoms2",
    "PersianHead_A3_02",
    ["HubStanding_idle1", "HubStanding_idle2", "HubStanding_idle2"],
    [16794.2, 18210.7, 0.501631],
	100
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms2"];

_trader =
[
    "Exile_Trader_CommunityCustoms3",
    "GreekHead_A3_07",
    ["HubStanding_idle1", "HubStanding_idle3", "HubStanding_idle3"],
    [16799.2, 18214.7, 0.701631],
	110
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms3"];

There ya go. :)

EDIT: Not sure why it's broken some of the formatting, the spacing and tabs are correct.

Edited by kuplion

Share this post


Link to post
Share on other sites
Advertisement

thx ! Ill test it ! I have no clue what's wrong with my code lol

Share this post


Link to post
Share on other sites
6 minutes ago, marcheur said:

thx ! Ill test it ! I have no clue what's wrong with my code lol

My apologies, I should have explained. (I've added comments next to the mistakes)

_trader =
[
    "Exile_Trader_Vehicle",
    "WhiteHead_11",
    ["HubStandingUA_move1", "HubStandingUA_move2", "HubStandingUA_idle1", "HubStandingUA_idle2", "HubStandingUA_idle3"],
    [16789.2, 18206.7, 0.29113],
    90
]
call ExileClient_object_trader_create;

_trader forceAddUniform "U_B_CombatUniform_mcam_tshirt";
_trader addVest "V_PlateCarrierSpec_mtp";
_trader addHeadgear "H_Bandanna_mcamo";
_trader addGoggles "G_Bandanna_khk";
_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms"];

_trader =
[
    "Exile_Trader_CommunityCustoms2",
    "PersianHead_A3_02",
    ["HubStanding_idle1", "HubStanding_idle2", "HubStanding_idle2"],
    [16794.2, 18210.7, 0.501631],
	100, //You have an extra comma here
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms2"];

_trader =
[
    "Exile_Trader_CommunityCustoms3",
    "GreekHead_A3_07",
    ["HubStanding_idle1", "HubStanding_idle3", "HubStanding_idle3"],
    [16799.2, 18214.7, 0.701631],
	110, //You have an extra comma here
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms3"];

 

Share this post


Link to post
Share on other sites

damn commas ! Thanks a lot. Ill finally have all my secret traders... Hidden in a house which have 5 code locked doors. :D

Share this post


Link to post
Share on other sites
4 minutes ago, marcheur said:

damn commas ! Thanks a lot. Ill finally have all my secret traders... Hidden in a house which have 5 code locked doors. :D

Haha. Happy to help. :)

Share this post


Link to post
Share on other sites

any idea if i can use the 

Exile_Trader_CommunityCustoms2

just for cup vehicles and use the normal exile vehicle trader for all other arma cars ?

ive tried doing this but the menu comes up like an item trader and not a vehicle trader. and i cant buy the vehicles 

Share this post


Link to post
Share on other sites
1 hour ago, blaez said:

any idea if i can use the 


Exile_Trader_CommunityCustoms2

just for cup vehicles and use the normal exile vehicle trader for all other arma cars ?

ive tried doing this but the menu comes up like an item trader and not a vehicle trader. and i cant buy the vehicles 

I would imagine you have to do it like this:

_trader =
[
    "Exile_Trader_Vehicle", //Trader type..
    "WhiteHead_11",
    ["HubStandingUA_move1", "HubStandingUA_move2", "HubStandingUA_idle1", "HubStandingUA_idle2", "HubStandingUA_idle3"],
    [16789.2, 18206.7, 0.29113],
    90
]
call ExileClient_object_trader_create;

_trader setVariable ["ExileTraderType", "Exile_Trader_CommunityCustoms"]; //Items for sale..

 

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.