Jump to content
  • 0

Disable loot spawn in plotpole/safezone areas


Achmed

Question

On my server I have safe trader zones and also clear zombies from the plot pole area. To stop abuse of this i also want to stop loot from spawning in safezones and plot pole areas.

 

I can disable pick up of loot in the safe zone script but this also prevents loot from being picked up thats dropped. Ideally what im after is a way to stop it spawning all together in a safezone/plot pole area,

 

anyone know if its possible and if so how?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

In player_spawncheck.sqf find this section (should be around line 107-110):

if(_canLoot) then {

		_dis = _x distance player;

		//Loot
		if ((_dis < 120) && (_dis > 30) && !_inVehicle) then {
			_looted = (_x getVariable ["looted",-0.1]);
			_cleared = (_x getVariable ["cleared",true]);
			_dateNow = (DateToNumber date);
			_age = (_dateNow - _looted) * 525948;
			//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
			if ((_age > DZE_LootSpawnTimer) && (!_cleared)) then {
				_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)];
				{deleteVehicle _x} count _nearByObj;
				_x setVariable ["cleared",true,true];
				_x setVariable ["looted",_dateNow,true];
			};
			if ((_age > DZE_LootSpawnTimer) && (_cleared)) then {
				//Register
				_x setVariable ["looted",_dateNow,true];
				//cleanup
				_x call building_spawnLoot;
			};
		};

Then add under

if (_canloot) then

this:

_nearbyPole = (getPos _x) nearestObject  "Plastic_Pole_EP1_DZ";
    if (isNull _nearbyPole) then {

This should prevent the loot spawn for plot poles, for safezones too i think i should be "Plastic_Pole_EP1_DZ","Info_board_EP1" but i dont know it 100%.

 

Here is a default edited player_spawncheck.sqf http://pastebin.com/XNddFfWU

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...