[NDS] F_the_What_1977/Max

xmas hats/headwear/headgear what ever...

13 posts in this topic

No reason to double post but since the devs are pretty busy and will most likely not see your question in time i'll leave this thread open and remove that one in ask devs.

Share this post


Link to post
Share on other sites
Advertisement
/**
 * ExileServer_object_player_network_createPlayerRequest
 *
 * 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["_sessionID","_parameters","_requestingPlayer","_spawnLocationMarkerName","_playerUID","_accountData","_bambiPlayer","_cargoType"];
_sessionID = _this select 0;
_parameters = _this select 1;
_requestingPlayer = _sessionID call ExileServer_system_session_getPlayerObject;
try
{
	if (isNull _requestingPlayer) then
	{
		throw format ["Session %1 requested a bambi character, but doesn't have a player object. Hacker or Monday?", _sessionID];
	};
	_spawnLocationMarkerName = _parameters select 0;
	_playerUID = getPlayerUID _requestingPlayer;
	if(_playerUID isEqualTo "")then
	{
		throw format ["Player: '%1' has no player UID. Arma/Steam Sucks!.",name _requestingPlayer];
	};
	_accountData = format["getAccountStats:%1", _playerUID] call ExileServer_system_database_query_selectSingle;
	_group = createGroup independent;
	_bambiPlayer = _group createUnit ["Exile_Unit_Player", [0,0,0], [], 0, "CAN_COLLIDE"];
	//_bambiPlayer addHeadgear "Exile_Headgear_SantaHat";
	{
		_cargoType = _x call ExileClient_util_cargo_getType;
		switch (_cargoType) do
		{
			case 1: 	{ _bambiPlayer addItem _x; };
			case 2: 	{ _bambiPlayer addWeaponGlobal _x; };
			case 3: 	{ _bambiPlayer addBackpackGlobal _x; };
			case 4:		{ _bambiPlayer linkItem _x; };
			default 					{ _bambiPlayer addItem _x; };
		};
	}
	forEach getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "loadOut");
	[_sessionID, _requestingPlayer, _spawnLocationMarkerName, _bambiPlayer, _accountData] call ExileServer_object_player_createBambi;
}
catch
{
	_exception call ExileServer_util_log;
};

 

Share this post


Link to post
Share on other sites

Override in your config.cpp 

ExileServer_object_player_network_createPlayerRequest

with the one I posted above

Share this post


Link to post
Share on other sites

hello,

ExileServer_object_player_network_createPlayerRequest

is placed in:

exile_server.pbo/code/

thats right?

we have override it with your posted info.

think this:

//_bambiPlayer addHeadgear "Exile_Headgear_SantaHat";

looks logic...... but..... dont work. Every respawn the santahat is on the Bambie  :-(.

 

any other idea?

Thx for the fast answer

 

PS: sorry for my english, if something is wrong

Share this post


Link to post
Share on other sites

Posted (edited)

does not work 100%

//_bambiPlayer addHeadgear "Exile_Headgear_SantaHat";

 

RPT error

13:43:40 "ExileServer - Loading territories from database..."
13:43:40 Error in expression <stem_database_query_selectSingle;
_id = _data select 0;
_owner = _data select 1;>

Edited by Scorpi

Share this post


Link to post
Share on other sites

I have none of these issues, been running with the above overwrite since the 5th.

Share this post


Link to post
Share on other sites
8 hours ago, Scorpi said:

//_bambiPlayer addHeadgear "Exile_Headgear_SantaHat";

100% correct :)

1 person likes this

Share this post


Link to post
Share on other sites

Overwrite ExileServer_system_lootManager_spawnLootForPlayer with the below

/**
 * ExileServer_system_lootManager_spawnLootForPlayer
 *
 * 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["_playerObject","_spawnRadius","_spawnChancePerPosition","_spawnChancePerBuilding","_maximumNumberOfLootSpotsPerBuilding","_maximumNumberOfItemsPerLootSpot","_spawnedLoot","_minimumDistanceToTraderZones","_minimumDistanceToTerritories","_playerPosition","_lastKnownPlayerPosition","_buildings","_building","_buildingType","_buildingConfig","_lootTableName","_localPositions","_spawnedItemClassNames","_lootWeaponHolderNetIDs","_spawnedLootInThisBuilding","_lootPosition","_numberOfItemsToSpawn","_lootHolder","_n","_itemClassName","_cargoType","_magazineClassNames","_magazineClassName","_numberOfMagazines"];
_playerObject = _this;
_spawnRadius = getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "spawnRadius");
_spawnChancePerPosition = (getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "spawnChancePerPosition") max 0) min 99;
_spawnChancePerBuilding = (getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "spawnChancePerBuilding") max 0) min 99;
_maximumNumberOfLootSpotsPerBuilding = getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "maximumNumberOfLootSpotsPerBuilding");
_maximumNumberOfItemsPerLootSpot = getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "maximumNumberOfItemsPerLootSpot");
_spawnedLoot = false;
_minimumDistanceToTraderZones = getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "minimumDistanceToTraderZones");
_minimumDistanceToTerritories = getNumber (configFile >> "CfgSettings" >> "LootSettings" >> "minimumDistanceToTerritories");

try
{
	if !(alive _playerObject) then
	{
		throw false;
	};
	if !(vehicle _playerObject isEqualTo _playerObject) then
	{
		throw false;
	};
	_playerPosition = getPosATL _playerObject;
	_lastKnownPlayerPosition = _playerObject getVariable["ExilePositionAtLastLootSpawnCircle", [0,0,0]];
	if (_lastKnownPlayerPosition distance2D _playerPosition < 11) then
	{
		throw false;
	};
	_playerObject setVariable["ExilePositionAtLastLootSpawnCircle", _playerPosition];
	_buildings = _playerObject nearObjects ["House", _spawnRadius];
//these next 6 lines add the wreck classes to the spawnable buildings array for the heliCrashes
  _truckWrecks = _playerObject nearObjects ["Land_Wreck_HMMWV_F", _spawnRadius];
  _buildings append _truckWrecks;
  _heliwrecks2 = _playerObject nearObjects ["Land_UWreck_Heli_Attack_02_F", _spawnRadius];
  _buildings append _heliwrecks2;
  _heliWrecks1 = _playerObject nearObjects ["Land_Wreck_Heli_Attack_01_F", _spawnRadius];
  _buildings append _heliWrecks1;
  //end
	{
		_building = _x;
		if !(isObjectHidden _building) then
		{
			_buildingType = typeOf _building;
			if (isClass(configFile >> "CfgBuildings" >> _buildingType)) then
			{
				if !(_building getVariable ["ExileHasLoot", false]) then
				{
					if ((floor (random 100)) <= _spawnChancePerBuilding) then
					{
						if (_minimumDistanceToTraderZones > 0) then
						{
							if ([_building, _minimumDistanceToTraderZones] call ExileClient_util_world_isTraderZoneInRange) then
							{
								throw false;
							};
						};
						if (_minimumDistanceToTerritories > 0) then
						{
							if ([_building, _minimumDistanceToTerritories] call ExileClient_util_world_isTerritoryInRange) then
							{
								throw false;
							};
						};
						_buildingConfig = configFile >> "CfgBuildings" >> _buildingType;
						_lootTableName = getText (_buildingConfig >> "table");
						_localPositions = getArray (_buildingConfig >> "positions");
						_spawnedItemClassNames = [];
						_lootWeaponHolderNetIDs = [];
						_spawnedLootInThisBuilding = false;
						_localPositions = _localPositions call ExileClient_util_array_shuffle;
						{
							if (_forEachIndex isEqualTo (_maximumNumberOfLootSpotsPerBuilding - 1)) exitWith {};
							if ((floor (random 100)) <= _spawnChancePerPosition) then
							{
								_lootPosition = ASLToATL (AGLToASL (_building modelToWorld _x));
								if (_lootPosition select 2 < 0.05) then
								{
									_lootPosition set [2, 0.05];
								};
								_numberOfItemsToSpawn = (floor (random _maximumNumberOfItemsPerLootSpot)) + 1;
								_lootHolder = objNull;
								for "_n" from 1 to _numberOfItemsToSpawn do
								{
									_itemClassName = _lootTableName call ExileServer_system_lootManager_dropItem;
									if !(_itemClassName in _spawnedItemClassNames) then
									{
										_cargoType = _itemClassName call ExileClient_util_cargo_getType;
										if (isNull _lootHolder) then
										{

											_lootHolder = createVehicle ["LootWeaponHolder", _lootPosition, [], 0, "CAN_COLLIDE"];

											_lootHolder setDir (random 360);
											_lootHolder setPosATL _lootPosition;
											_lootHolder setVariable ["ExileSpawnedAt", time];
											_lootWeaponHolderNetIDs pushBack (netId _lootHolder);
										};
										switch (_cargoType) do
										{
											case 1:
											{
												if (_itemClassName isEqualTo "Exile_Item_MountainDupe") then
												{
													_lootHolder addMagazineCargoGlobal [_itemClassName, 2];
												}
												else
												{
													_lootHolder addMagazineCargoGlobal [_itemClassName, 1];
												};
											};
											case 3:
											{
												_lootHolder addBackpackCargoGlobal [_itemClassName, 1];
											};
											case 2:
											{
												_lootHolder addWeaponCargoGlobal [_itemClassName, 1];
												if (_itemClassName != "Exile_Melee_Axe") then
												{
													_magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines");
													if (count(_magazineClassNames) > 0) then
													{
														_magazineClassName = _magazineClassNames select (floor(random (count _magazineClassNames)));
														_numberOfMagazines = 2 + floor(random 3);
														_lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines];
													};
												};
											};
											default { _lootHolder addItemCargoGlobal [_itemClassName,1]; };
										};
										_spawnedItemClassNames pushBack _itemClassName;
										_spawnedLoot = true;
										_spawnedLootInThisBuilding = true;
									};
								};
							};
						}
						forEach _localPositions;
						if (_spawnedLootInThisBuilding) then
						{
							ExileServerBuildingNetIdsWithLoot pushBack (netId _building);
							_building setVariable ["ExileLootSpawnedAt", time];
							_building setVariable ["ExileHasLoot", true];
							_building setVariable ["ExileLootWeaponHolderNetIDs", _lootWeaponHolderNetIDs];
						};
					};
				};
			};
		};
	}
	forEach _buildings;
}
catch
{
};
_spawnedLoot

 

Edited by Renegade2k6
1 person likes this

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.