Jump to content
  • 0

Disable Dynamic Vehicle spawns in a Certain area?


DeltaRecon

Question

1 answer to this question

Recommended Posts

  • 0

I might be wrong but I think you can do it like this... (assuming you know a little about scripting)

 

 

You will need to make changes to your server_functions.sqf file (in the server\init folder).

 

- Find this line

spawn_vehicles = {
    private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];

- Change it to this

spawn_vehicles = {
    private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots","_devilsCastlePosition","_findNewPosition","_devilsCastleDistance"];

- Then get the x,y coordinates of devils castle.

= To do so.. simply stand in the middle of it (on the ground), log off, and look in your database. The database coordinates you need is the first two values of the inner square brackets ([x,y,z]) and not the entire value which would be [a,[x,y,z]].

E.g. DB Coordinates = [142,[11633,15379,0]]

Coordinates You need = 11633,15379

 

- Find this line

if (count AllowedVehiclesList == 0) then {
    diag_log("DEBUG: unable to find suitable vehicle to spawn");
} else {

- Below that 'else {' add this

_devilsCastlePosition = [x,y]; 

where x,y is the coordinates you copied from the database.

 

- And below that add

_findNewPosition = true;
_devilsCastleDistance = 0;

- (1*) Now find this

if((random 1) > 0.5) then {

- (2*) wrap the entire contents of that if's inner code block in a while loop like so

if((random 1) > 0.5) then {
    while {_findNewPosition == true} do { 
        CONTENTS
    };
} else {

(note the closing }; before the '} else {' line)

 

 

- At the end after the 'CONTENTS' of that block add this 

_devilsCastleDistance = _position distance _devilsCastlePosition;

- Followed by

// If spawn position's distance is greater than 100m... spawn vehicle. Else rerun loop to find new location.
if (_devilsCastleDistance > 100) then {
    _findNewPosition = false; 
}
else {
    _findNewPosition = true;
};

- As you can tell from the last part you are checking the distance (more than 100m) the vehicle's spawn position is from devils castle's coordinates and then specifying if a new position should be searched for or not.

 

Now... you have to do the process again for the else block right under (1*). Follow the same instructions starting at the (2*) above.

 

A few points -

1 - This is all not tested just what I think should work. Thus, use at your own risk :P

2 - I believe I have dotted all the i's and crossed all the t's but aplogize if something slipped by me or I haven't realized that some other files might need changing.

3 - If it works.. post back if it fails post back.. that way others can decide to use/ignore this.

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