• 0
NukeInMyPantz

CfgExileCustomCode

Question

Hi I'm trying to add a few fun scripts and the only issue I have ran into is when I place the bit of code under CfgExileCustomCode it say's "Member already defined" when I start up the server. I tried a few way's to kinda combine them both but no luck. Is there a way to use this (This being an example) "ExileServer_object_player_database_load = "something\location\at\some\where.sqf", "and\this\second\thing.sqf";  A few of the mods/scripts want to use the same tag but of course different locations.

Share this post


Link to post
Share on other sites

17 answers to this question

  • 0
15 minutes ago, NukeInMyPantz said:

Hi I'm trying to add a few fun scripts and the only issue I have ran into is when I place the bit of code under CfgExileCustomCode it say's "Member already defined" when I start up the server. I tried a few way's to kinda combine them both but no luck. Is there a way to use this (This being an example) "ExileServer_object_player_database_load = "something\location\at\some\where.sqf", "and\this\second\thing.sqf";  A few of the mods/scripts want to use the same tag but of course different locations.

When it says it is already defined, you already have it declared in your custom code. You must be running a mod that calls the same sqf file.

Share this post


Link to post
Share on other sites
  • 0

you likely have

CfgExileCustomCode

  defined in both your config.cpp and description.etc as an include "CfgExileCustomCode.hpp" or something like that.

Share this post


Link to post
Share on other sites
Advertisement
  • 0

@Beowulfv Yes I have MostWanted which is a Bounty thing and I just found a nice snow effect. Here is the code

ExileServer_object_player_database_load = "Snow\ExileServer_object_player_database_load.sqf";

ExileServer_object_player_database_load = "MostWanted_Client\overwrites\ExileServer_object_player_database_load.sqf";

I know I already have it declared :D I just need to know if there is a way to have "ExileServer_object_player_database_load" and then add "Snow\ExileServer_object_player_database_load.sqf" & "MostWanted_Client\overwrites\ExileServer_object_player_database_load.sqf" together on one line.

Share this post


Link to post
Share on other sites
  • 0

@tinboye I checked to see if that was the case but it wasn't. Is there really no way to just be able to have multiple paths for  ExileServer_object_player_database_load or any other ExileServer_ or ExileClient_ ? If not then that's a shame.

Share this post


Link to post
Share on other sites
  • 0

Ok found them myself,

Spoiler

/**
 * ExileServer_object_player_database_load
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 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["_data","_oldPlayerObject","_playerUID","_sessionID","_position","_direction","_player","_clanID","_clanName","_clanData","_clanGroup","_devFriendlyMode","_devs","_requestingPlayer","_bambiPlayer","_headgear","_goggles","_binocular","_primaryWeapon","_handgunWeapon","_secondaryWeapon","_currentWeapon","_uniform","_vest","_backpack","_uniformContainer","_vestContainer","_backpackContainer","_assignedItems"];
_data = _this select 0;
_goggles = _data select 20;
_plUID = _data select 2;
missionNamespace setVariable [format ["GGPDB%1", _plUID], _goggles, true];
diag_log format['GOGGLESW : %1 VARIABLE  %2  VAR ; %3',_goggles,  format ["GGPDB%1", _plUID] , missionNamespace getVariable (format ["GGPDB%1", _plUID])];
_oldPlayerObject = _this select 1;
_playerUID = _this select 2;
_sessionID = _this select 3;
_name = name _oldPlayerObject;
_position = [_data select 11, _data select 12, _data select 13];
_direction = _data select 10;
_player = (createGroup independent) createUnit ["Exile_Unit_Player", _position, [], 0, "CAN_COLLIDE"];
_player setDir _direction;
_player setPosATL _position;
_player disableAI "FSM";
_player disableAI "MOVE";
_player disableAI "AUTOTARGET";
_player disableAI "TARGET";
_player disableAI "CHECKVISIBLE";
_clanID = (_data select 42);
_clanName = (_data select 43);
if !((typeName _clanID) isEqualTo "SCALAR") then
{
	_clanID = -1;
	_clanData = [];
}
else
{
	_clanData = missionnamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
	if(isNull (_clanData select 5))then
	{
		_clanGroup = createGroup independent;
		_clanData set [5,_clanGroup];
		_clanGroup setGroupIdGlobal [_clanData select 0];
		missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
	}
	else
	{
		_clanGroup = (_clanData select 5);
	};
	[_player] joinSilent _clanGroup;
};
_player setDamage (_data select 3);
_player setName _name;

// Most-Wanted
private ["_bounty","_lock","_interval","_type","_immunity"];

_interval = getNumber(missionConfigFile >> "CfgMostWanted" >> "Database" >> "Immunity" >> "interval");
_immunity = format ["hasImmunity:%1:%2",_playerUID,_interval] call ExileServer_system_database_query_selectSingleField;
_player setVariable ["ExileBountyImmunity", _immunity, true];

_bounty = format["getBounty:%1",_playerUID] call ExileServer_system_database_query_selectSingle;
_player setVariable ["ExileBounty",_bounty select 0];
_lock = false;
if ((_bounty select 1) isEqualTo 1) then
{
	_lock = true;
};
_player setVariable ["ExileBountyLock",_lock,true];
_player setVariable ["ExileBountyContract",_bounty select 2,true];
_player setVariable ["ExileBountyCompletedContracts",_bounty select 3];
_player setVariable ["ExileBountyFriends",_bounty select 4,true];
// Most-Wanted

_player setVariable ["ExileMoney", (_data select 38), true];
_player setVariable ["ExileScore", (_data select 39)];
_player setVariable ["ExileKills", (_data select 40)];
_player setVariable ["ExileDeaths", (_data select 41)];
_player setVariable ["ExileClanID", _clanID];
_player setVariable ["ExileClanData", _clanData];
_player setVariable ["ExileName", _name];
_player setVariable ["ExileOwnerUID", _playerUID];
_player setVariable ["ExileDatabaseID", _data select 0];
_player setVariable ["ExileHunger", _data select 4];
_player setVariable ["ExileThirst", _data select 5];
_player setVariable ["ExileAlcohol", _data select 6];
_player setVariable ["ExileTemperature", _data select 44];
_player setVariable ["ExileWetness", _data select 45];
_player setVariable ["ExileIsBambi", false];
_player setVariable ["ExileXM8IsOnline", false, true];
_player setOxygenRemaining (_data select 7);
_player setBleedingRemaining (_data select 8);
_player setVariable ["ExileLocker", (_data select 46), true];
[_player, _data select 9] call ExileClient_util_player_applyHitPointMap;
_devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
if (_devFriendlyMode isEqualTo 1) then
{
	_devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
	{
		if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith
		{
			if((name _requestingPlayer) isEqualTo (_x select 1))then
			{
				_bambiPlayer setVariable ["ExileMoney", 500000, true];
				_bambiPlayer setVariable ["ExileScore", 100000];
			};
		};
	}
	forEach _devs;
};
_player call ExileClient_util_playerCargo_clear;
_headgear = _data select 23;
if (_headgear != "") then
{
	_player addHeadgear _headgear;
};

/*_goggles = _data select 20;
if (_goggles != "") then
{
	_player addGoggles _goggles;

};*/
_binocular = _data select 24;
if (_binocular != "") then
{
	_player addWeaponGlobal _binocular;
};
_primaryWeapon = _data select 26;
if (_primaryWeapon != "") then
{
	_player addWeaponGlobal _primaryWeapon;
	removeAllPrimaryWeaponItems _player;
	{
		if (_x != "") then
		{
			_player addPrimaryWeaponItem _x;
		};
	}
	forEach (_data select 27);
};
_handgunWeapon = _data select 22;
if (_handgunWeapon != "") then
{
	_player addWeaponGlobal _handgunWeapon;
	removeAllHandgunItems _player;
	{
		if (_x != "") then
		{
			_player addHandgunItem _x;
		};
	}
	forEach (_data select 21);
};
_secondaryWeapon = _data select 28;
if (_secondaryWeapon != "") then
{
	_player addWeaponGlobal _secondaryWeapon;
	{
		if (_x != "") then
		{
			_player addSecondaryWeaponItem _x;
		};
	}
	forEach (_data select 29);
};
 _currentWeapon = _data select 19;
if (_currentWeapon != "") then
{
	 _player selectWeapon _currentWeapon;
};
{
	_player addWeaponItem [_x select 0, [_x select 1, _x select 2, _x select 3]];
}
forEach (_data select 25);
_uniform = _data select 30;
_vest = _data select 34;
_backpack = _data select 15;
if (_uniform != "") then
{
	_player forceAddUniform _uniform;
};
if (_vest != "") then
{
	_player addVest _vest;
};
if (_backpack != "") then
{
	_player addBackpackGlobal _backpack;
};
_uniformContainer = uniformContainer _player;
if !(isNil "_uniformContainer") then
{
	{
		_uniformContainer addWeaponCargoGlobal _x;
	}
	forEach (_data select 33);
	{
		_uniformContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
	}
	forEach (_data select 32);
	{
		_uniformContainer addItemCargoGlobal _x;
	}
	forEach (_data select 31);
};
_vestContainer = vestContainer _player;
if !(isNil "_vestContainer") then
{
	{
		_vestContainer addWeaponCargoGlobal _x;
	}
	forEach (_data select 37);
	{
		_vestContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
	}
	forEach (_data select 36);
	{
		_vestContainer addItemCargoGlobal _x;
	}
	forEach (_data select 35);
};
_backpackContainer = backpackContainer _player;
if !(isNil "_backpackContainer") then
{
	{
		_backpackContainer addWeaponCargoGlobal _x;
	}
	forEach (_data select 18);
	{
		_backpackContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
	}
	forEach (_data select 17);
	{
		_backpackContainer addItemCargoGlobal _x;
	}
	forEach (_data select 16);
};
_assignedItems = _data select 14;
if !(_assignedItems isEqualTo []) then
{
	{
		_player linkItem _x;
	}
	forEach _assignedItems;
};
_player addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then
{
	_player addEventHandler ["WeaponAssembled", {(_this select 1) disableTIEquipment true;}];
};
[
	_sessionID,
	"loadPlayerResponse",
	[
		(netId _player),
		str (_player getVariable ["ExileScore", 0]),
		(_player getVariable ["ExileKills", 0]),
		(_player getVariable ["ExileDeaths", 0]),
		(_player getVariable ["ExileHunger", 100]),
		(_player getVariable ["ExileThirst", 100]),
		(_player getVariable ["ExileAlcohol", 0]),
		(_player getVariable ["ExileClanData", []]),
		(_player getVariable ["ExileTemperature", 0]),
		(_player getVariable ["ExileWetness", 0])
	]
]
call ExileServer_system_network_send_to;

// Most-Wanted
[
	_sessionID,
	"updateCompletedContracts",
	[
		(_player getVariable ["ExileBountyCompletedContracts",""])
	]
]
call ExileServer_system_network_send_to;
// Most-Wanted

[_sessionID, _player] call ExileServer_system_session_update;
true

 

so with this save the file as ExileServer_object_player_database_load.sqf  but place it under Overrides folder, then change your CfgCustomCode section to

Spoiler

class CfgExileCustomCode 
{
	
	// ExAd
	ExileClient_gui_xm8_slide = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_slide.sqf";
    ExileClient_gui_xm8_show = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_show.sqf";
    ExileServer_system_territory_database_load = "ExAdClient\VirtualGarage\CustomCode\ExileServer_system_territory_database_load.sqf";    

    // MostWanted - Bounties
	ExileClient_gui_xm8_showPartySlides = "MostWanted_Client\overwrites\ExileClient_gui_xm8_showPartySlides.sqf";
    ExileServer_object_player_createBambi = "MostWanted_Client\overwrites\ExileServer_object_player_createBambi.sqf";
    //ExileServer_object_player_database_load = "MostWanted_Client\overwrites\ExileServer_object_player_database_load.sqf";  //FILE COMBINED WITH SNOW EFFECTS
    ExileServer_object_player_event_onMpKilled = "MostWanted_Client\overwrites\ExileServer_object_player_event_onMpKilled.sqf";
    ExileServer_system_network_event_onPlayerConnected = "MostWanted_Client\overwrites\ExileServer_system_network_event_onPlayerConnected.sqf";

    // Override Stuff
    ExileClient_system_thread_initialize = "Overrides\ExileClient_system_thread_initialize.sqf";
    ExileClient_object_player_event_onEnterSafezon = "Overrides\ExileClient_object_player_event_onEnterSafezone.sqf";

    // Snow Effect
    //ExileServer_object_player_database_load = "Snow\ExileServer_object_player_database_load.sqf"; //FILE COMBINED WITH MOST WANTED
    ExileClient_system_snow_thread_update = "Snow\ExileClient_system_snow_thread_update.sqf"; 
    ExileClient_system_trading_network_purchaseVehicleResponse = "Snow\ExileClient_system_trading_network_purchaseVehicleResponse.sqf";

    // XM8 Stuff that I'm trying to get working...
    // ExileClient_gui_xm8_show = "XM8_apps\scripts\ExileClient_gui_xm8_show.sqf";
    // ExileClient_gui_xm8_slide_apps_onOpen = "XM8_apps\scripts\ExileClient_gui_xm8_slide_apps_onOpen.sqf";
	
	// Fix Vehicle Trader Spawns
	ExileServer_system_trading_network_purchaseVehicleRequest = "Fixes\TraderFixes\ExileServer_system_trading_network_purchaseVehicleRequest.sqf";
	
	// Snow and Most wanted combined
    ExileServer_object_player_database_load = "Overrides\ExileServer_object_player_database_load.sqf";
	
	// Arma 1.66 Fixes
	ExileClient_gui_postProcessing_initialize = "Fixes\A166Fixes\ExileClient_gui_postProcessing_initialize.sqf";
	ExileClient_gui_postProcessing_reset = "Fixes\A166Fixes\ExileClient_gui_postProcessing_reset.sqf";
	ExileClient_gui_postProcessing_toggleDialogBackgroundBlur = "Fixes\A166Fixes\ExileClient_gui_postProcessing_toggleDialogBackgroundBlur.sqf";
	ExileClient_object_player_death_startBleedingOut = "Fixes\A166Fixes\ExileClient_object_player_death_startBleedingOut.sqf";
	ExileClient_object_player_event_onKilled = "Fixes\A166Fixes\ExileClient_object_player_event_onKilled.sqf";
	ExileServer_system_network_event_onPlayerDisconnected = "Fixes\A166Fixes\ExileServer_system_network_event_onPlayerDisconnected.sqf";
	ExileServer_system_network_setupEventHandlers = "Fixes\A166Fixes\ExileServer_system_network_setupEventHandlers.sqf";
	ExileClient_system_radiation_thread_update = "Overrides\ExileClient_system_radiation_thread_update.sqf";
	
};

 

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

@tinboye Ok I did what you said, since that file is overwriten does that mean what the mod creator who said to put that piece of code under the CfgExileCustomCode should still work ? I started the server and everything seems fine, I'm gonna add / test some more and I'll let you know what happens. Thank you @tinboye @Beowulfv for helping me.

Share this post


Link to post
Share on other sites
  • 0

The two separate mods were just combined into the same file that they both were calling for. The only thing you changed was the directory the file is being called from. 

  • Like 2

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.