Monkeynutz

Vehicle Textures by UID

13 posts in this topic

I would like certain vehicle skins to be purchased at the customs trader to only be available to certain members of my community, for example, i want admins to be able to purchase the GADD skin for their vehicle but nobody else should be able to buy this skin. And i want Donators to be able to use their clans custom created skins to be available to them and nobody else as this makes them unique. 

Since there is already a way to do this with Exile Flags... 

class CfgFlags 
{
	class GADD
	{
		name = "GADD";
		texture = "custom\Flags\flag_gadd_co.paa";
		//		me			admin
		uids[] = {"12345678987654321","12345678987654321"};
	};
};

Would there be a way to implement this with Vehicle textures so admins can only access the GADD skin? 

class MRAP_03_hmg_base_F
	{
		skins[] =
		{
			{"I_MRAP_03_hmg_F",			300, "Carbon", {"custom\vehicletextures\carbon.paa","\A3\data_f\vehicles\turret_co.paa"};},
			{"I_MRAP_03_hmg_F",			300, "GADD", {"custom\vehicletextures\GADD.paa","\A3\data_f\vehicles\turret_co.paa"};}
		};
	};

Maybe something like this: 

class MRAP_03_hmg_base_F
	{
		skins[] =
		{
			{"I_MRAP_03_hmg_F",			300, "Carbon", {"custom\vehicletextures\carbon.paa","\A3\data_f\vehicles\turret_co.paa"};},
			uids[] = {12345678987654321} {"I_MRAP_03_hmg_F",			300, "GADD", {"custom\vehicletextures\GADD.paa","\A3\data_f\vehicles\turret_co.paa"};}
		};
	};

Does anybody know? 

Edited by GamingAtDeathsDoor
1 person likes this

Share this post


Link to post
Share on other sites
On 12/18/2016 at 0:10 PM, GamingAtDeathsDoor said:

I would like certain vehicle skins to be purchased at the customs trader to only be available to certain members of my community, for example, i want admins to be able to purchase the GADD skin for their vehicle but nobody else should be able to buy this skin. And i want Donators to be able to use their clans custom created skins to be available to them and nobody else as this makes them unique. 

Since there is already a way to do this with Exile Flags... 


class CfgFlags 
{
	class GADD
	{
		name = "GADD";
		texture = "custom\Flags\flag_gadd_co.paa";
		//		me			admin
		uids[] = {"12345678987654321","12345678987654321"};
	};
};

Would there be a way to implement this with Vehicle textures so admins can only access the GADD skin? 


class MRAP_03_hmg_base_F
	{
		skins[] =
		{
			{"I_MRAP_03_hmg_F",			300, "Carbon", {"custom\vehicletextures\carbon.paa","\A3\data_f\vehicles\turret_co.paa"};},
			{"I_MRAP_03_hmg_F",			300, "GADD", {"custom\vehicletextures\GADD.paa","\A3\data_f\vehicles\turret_co.paa"};}
		};
	};

Maybe something like this: 


class MRAP_03_hmg_base_F
	{
		skins[] =
		{
			{"I_MRAP_03_hmg_F",			300, "Carbon", {"custom\vehicletextures\carbon.paa","\A3\data_f\vehicles\turret_co.paa"};},
			uids[] = {12345678987654321} {"I_MRAP_03_hmg_F",			300, "GADD", {"custom\vehicletextures\GADD.paa","\A3\data_f\vehicles\turret_co.paa"};}
		};
	};

Does anybody know? 

oh wow lol i didnt know the flags were capable of doing this. lol

I've been trying for weeks to do the same thing you are doing, but i was taking a much more complicated approach lol

I was trying to to add a button on the xm8, that would have a UID array, that would open the custom skin GUI and instead of pulling from CfgVehicleCustoms in the config.cpp. I created a second CfgVehicleCustomsVIP with the custom skins.

I managed to get the button on the xm8, it opens the skin gui and shows your vehicles, but does not populate the custom skins..

So after seeing this...looking at the file the flags use ExileClient_gui_setupTerritoryDialog_show, it would be as easy as looking how they did it there...

wondering if you have figured it out?

Share this post


Link to post
Share on other sites
Advertisement

I have unfortunately not figure this one out... I know someone who might know but it's best not to harass people :) 

Share this post


Link to post
Share on other sites

hmmm this is the flag code

Spoiler

/**
 * ExileClient_gui_setupTerritoryDialog_show
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display","_listBox","_myUID","_flags","_restrictToUID","_flagEntry"];
disableSerialization;
createDialog "RscExileSetupTerritoryDialog";
_display = uiNameSpace getVariable ["RscExileSetupTerritoryDialog", displayNull];
_listBox = _display displayCtrl 4001;
lbClear _listBox;
_myUID = getPlayerUID player;
_flags = [];
if(isClass (missionConfigFile >> "CfgFlags"))then
{
    _flags = _flags + ("true" configClasses (missionConfigFile >> "CfgFlags"));
};
_flags = _flags + ("true" configClasses (configFile >> "CfgFlagsNative"));
{
    _restrictToUID = getArray (_x >> "uids");
    if ((_myUID in _restrictToUID) || (_restrictToUID isEqualTo [])) then
    {
        _flagEntry = _listBox lbAdd (getText (_x >> "name"));
        _listBox lbSetData [_flagEntry,configName _x];
        _listBox lbSetPicture [_flagEntry,(getText (_x >> "texture"))];
    };
}
forEach _flags;
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
true

and the ExileClient_gui_vehicleCustomsDialog_show.sqf

Spoiler

/**
 * ExileClient_gui_vehicleCustomsDialog_show
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_traderObject","_localVehicles","_nearVehicles","_customizableVehicles","_parentClassName","_dialog","_vehicleDropDown","_vehicleObject","_vehicleIndex"];
disableSerialization;
_traderObject = _this;
_localVehicles = [];
_nearVehicles = [];
switch (typeOf _traderObject) do
{
    case "Exile_Trader_VehicleCustoms":
    {
        _nearVehicles = nearestObjects [player, ["LandVehicle"], 50];
    };
    case "Exile_Trader_AircraftCustoms":
    {
        _nearVehicles = nearestObjects [player, ["Air"], 80];
    };
    case "Exile_Trader_BoatCustoms":
    {
        _nearVehicles = nearestObjects [player, ["Ship"], 50];
    };
    default { format["Invalid trader type: %1", (typeOf _traderObject)] call ExileClient_util_log; };
};
_customizableVehicles = [];
{
    if (local _x) then
    {
        if (alive _x) then
        {
            _localVehicles pushBack _x;
        };
    };
}
forEach _nearVehicles;
if (_localVehicles isEqualTo []) exitWith
{
    ["ErrorTitleAndText", ["Whoops!", "Park within 50m and get in as driver first."]] call ExileClient_gui_toaster_addTemplateToast;
};
{
    _parentClassName = configName (inheritsFrom (configFile >> "CfgVehicles" >> (typeOf _x)));
    if (isClass (missionConfigFile >> "CfgVehicleCustoms" >> _parentClassName) ) then
    {
        _customizableVehicles pushBack _x;
    };
}
forEach _localVehicles;
if (_customizableVehicles isEqualTo []) exitWith
{
    ["ErrorTitleAndText", ["Whoops!", "None of your vehicles can be customized."]] call ExileClient_gui_toaster_addTemplateToast;
};
ExileClientMoonLight setLightBrightness 5;
createDialog "RscExileVehicleCustomsDialog";
_dialog = uiNameSpace getVariable ["RscExileVehicleCustomsDialog", displayNull];
uiNamespace setVariable["ExileCurrentTrader", _traderObject];
_vehicleDropDown = _dialog displayCtrl 4000;
lbClear _vehicleDropDown;
{
    _vehicleObject = _x;
    _vehicleIndex = _vehicleDropDown lbAdd getText(configFile >> "CfgVehicles" >> (typeOf _vehicleObject) >> "displayName");
    _vehicleDropDown lbSetData [_vehicleIndex, netId _vehicleObject];
}
forEach _customizableVehicles;
call ExileClient_gui_modelBox_create;
(typeOf (_customizableVehicles select 0)) call ExileClient_gui_modelBox_update;
_vehicleDropDown lbSetCurSel 0;

It would be a matter of taking the myuid part and merging it with the above...but thats above my knowledge lol...

im trying a few things out see if it works

Share this post


Link to post
Share on other sites

well i've tried everything that was within my knowledge lol.  Nothing worked sadly

Share this post


Link to post
Share on other sites

I figured id relax and wait till someone with knowledge can chime in and send us in the right direction lol

Heres something i've been working on....something i KNOW what im doing haha

 

20161231142125_1.jpg

Share this post


Link to post
Share on other sites

no... But i think we were editing the wrong file.

I had someone with knowledge help me out a bit. Sadly the script doesnt work, but by reading it, it should....

Essentially this is the file that needs editing.

ExileClient_gui_vehicleCustomsDialog_updateVehicle.sqf

The part in light grey is what was added...but sadly doesnt work

Spoiler
  1. /**
  2.  * ExileClient_gui_vehicleCustomsDialog_updateVehicle
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_admins","_vehcileSkinArray","_originalVehicleObject","_dialog","_skinListBox","_parentClassName","_vehicleCustomsConfig","_availableSkins","_skinPrice","_skinName","_indexEntryIndex","_purchaseButton"];
  13. disableSerialization;
  14. _originalVehicleObject = _this;
  15. ExileClientVehicleCustomsOriginalVehicle = _originalVehicleObject;
  16. ExileClientVehicleCustomsOriginalClass = typeOf _originalVehicleObject;
  17. _dialog = uiNameSpace getVariable ["RscExileVehicleCustomsDialog", displayNull];
  18. _skinListBox = _dialog displayCtrl 4001;
  19. ExileClientVehicleCustomsOriginalClass call ExileClient_gui_modelBox_update;
  20. lbClear _skinListBox;
  21. _parentClassName = configName (inheritsFrom (configFile >> "CfgVehicles" >> ExileClientVehicleCustomsOriginalClass));
  22. if (isClass (missionConfigFile >> "CfgVehicleCustoms" >> _parentClassName) ) then
  23. {
  24.     _vehicleCustomsConfig = (missionConfigFile >> "CfgVehicleCustoms" >> _parentClassName);
  25.     _availableSkins = getArray(_vehicleCustomsConfig >> "skins");
  26.  
  27.     _admins = getArray (missionConfigFile >> "admins" >> "UIDS");
  28.     if (getPlayerUID player in _admins) then {
  29.         _vehcileSkinArray = getArray (missionConfigFile >> "adminskins" >> ExileClientVehicleCustomsOriginalClass >> "Skins");
  30.         {
  31.             _availableSkins pushBackUnique _x;
  32.         } forEach _vehcileSkinArray;
  33.     };
  34.  
  35.     {
  36.         _skinPrice = _x select 1;
  37.         _skinName = _x select 2;
  38.         _indexEntryIndex = _skinListBox lbAdd _skinName;
  39.         _skinListBox lbSetData [_indexEntryIndex, _skinName];
  40.         _skinListBox lbSetTextRight [_indexEntryIndex, format["%1", _skinPrice]];
  41.         _skinListBox lbSetPictureRight [_indexEntryIndex, "exile_assets\texture\ui\poptab_trader_ca.paa"];
  42.         if (_skinPrice > (player getVariable ["ExileMoney", 0])) then
  43.         {
  44.             _skinListBox lbSetColorRight [_indexEntryIndex, [0.91, 0, 0, 0.6]];
  45.         };
  46.     }
  47.     forEach _availableSkins;
  48.     _purchaseButton = _dialog displayCtrl 4002;
  49.     _purchaseButton ctrlEnable true;
  50. };

and in the config.cpp

Spoiler

class admins
{
    UIDS[]=
    {
        "1234567890"
    };
};

class adminskins
{

    class Exile_Car_Strider_abstract
    {

        skins[] = 
        {
            {"Exile_Car_Strider",   100, "TMNT", {"textures\stridertmnt.paa"};},
            {"Exile_Car_Strider",   100, "CAMO", {"textures\stridercamo.paa"};}
        };
    };
    class Exile_Car_Offroad_Abstract
    {
        skins[] = 
        {
            {"Exile_Car_Offroad_red",            700, "Camo Stripes",{"textures\offroadcamostripes.paa"};},
            {"Exile_Car_Offroad_red",            700, "Toyota Rally",{"textures\toyotaoffroad.paa"};}
        };
    };
};

 

Edited by theduke

Share this post


Link to post
Share on other sites

Is there anyone with a bit of knowledge that can chime in and help us? Id really appreciate it.

Thanks

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.