Jump to content
  • 0

[REQUEST] Remove every vehicle who is not near a plot ploe ?


StiflersM0M

Question

Hey hey,

Only a idea probably there is anyway a script out there if it is so, please send me a link :)

It would be nice to have a script which delete every vehicle which is not near a plot pole, i hate it if person play one time on a server and then let their vehicle everywhere, mostly theese vehicle got every day updated in the database cause anyone try to get in in this vehicle so the regualar abodened cleanup wont work.

How i said its just a request :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Something quicly written ( should work if no typo's)

 

Add it to your admin tools ot AH, ot tweak it to run server sided on restart? , idk what u want specific ^^

//execute this as an admin
//execVM "deleteVechicles.sqf";

_center = getMarkerPos "center";
_allVehicles = _center nearEntities [["AllVehicles"], 12000]; // increase size for other maps ofcoruse if needed
{
	if ( (!isNull _x) && !(_x isKindOf "CAManBase") && !(isPlayer _x) &&  !(isPlayer (driver _x)) ) then {		
		if( _x isKindOf "Air" || _x isKindOf "Land" || _x isKindOf "Ship" ) then {
				_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
				_IsNearPlot = count (_findNearestPoles);
				if(_IsNearPlot == 0)then{
				   deleteVehicle _x;
				}	
		};				
	};	    
} count _allVehicles;
Link to comment
Share on other sites

  • 0

after 2 months i got some scripting knowledge and modified zupa version a little bit :P

 

this here will work:

_center = getMarkerPos "center";
_allVehicles = _center nearEntities [["AllVehicles"], 20000];
{
	if ( (!isNull _x) && !(_x isKindOf "CAManBase") && !(isPlayer _x) &&  !(isPlayer (driver _x)) ) then {		
		if( _x isKindOf "Air" || _x isKindOf "Land" || _x isKindOf "Ship" ) then {
				_findNearestPoles = nearestObjects[_x, ["Plastic_Pole_EP1_DZ"],90];
				_IsNearPlot = count (_findNearestPoles);
				if(_IsNearPlot == 0)then{
				   _x setdamage 1;
				};	
		};				
	};	    
} count _allVehicles;

It will set the damage of vehicles who are not near a plot pole to 1; (destroyed) then just wait 1-2 minutes restart the server and everything is fine :)

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
  • Discord

×
×
  • Create New...