Jump to content
  • 0

vehicles unlock in S.Z. every restart


rentiger1112

Question

private ["_safeZones","_center","_radius","_vehicles"];
_safeZones = [
 [[4069.86,11661.6,0.00158691],100],
 [[6326.4805,7809.4888],100], 
 [[4361.4937,2259.9526],35],
 [[13532.614,6355.9497],35],
 [[7989.3354,2900.9946],35],
 [[12060.471,12638.533],75],
 [[1606.6443,7803.5156],50],
 [[11447.91,11364.536],100],
 [[13441.16,5429.3013],35],
 [[12944.227,12766.889],50],
 [[10066.4,5434.24],50],
 [[2306.17,9633.46],50],
 [[4065.87,10818.9],75],
 [[3332.07,3923.91],50],
 [[1704.5732,12841.845],50]
];

{
 _center = _x select 0;
 _radius = _x select 1;
 _vehicles = nearestObjects [_center,["LandVehicle","Air","Ship"],_radius];
 {
  if (_x isKindOf "LandVehicle" || _x isKindOf "Air" || _x isKindOf "Ship") then {

   {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
   s_player_lockUnlock_crtl = 1;

   PVDZE_veh_Lock = [_x,false];
   
   if (local _x) then {
    PVDZE_veh_Lock spawn local_lockUnlock
   } else {
    publicVariable "PVDZE_veh_Lock";
   };

   s_player_lockUnlock_crtl = -1;
  };
 } forEach _vehicles;
} forEach _safeZones;

 

 

I found this code somewhere on the forums and it is working except it runs always so when people drive into the safe-zones their shit gets unlocked, I was wondering if there is a way to make it only run once.  
Edited by rentiger1112
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

copy the code into a file and name it then put the file in your server pbo / modules folder then add it to Epoch events in your mission files init.sqf

EpochEvents = [["any","any","any","any",30,"abandonedvaults"],["any","any","any","any",30,"convoy"],["any","any","any","any",30,"animated_crash_spawner"],["any","any","any","any",40,"drop_bombs"],["any","any","any","any",15,"supply_drop"], ["any","any","any","any",55,"construction"], ["any","any","any","any",10,"military"], ["any","any","any","any",25,"treasure"], ["any","any","any","any",40,"supplyitems"]];

 

or try edit a sql event i use a sql event that deletes vehicles from safe zones every restart

 

Link to comment
Share on other sites

  • 0

copy the code into a file and name it then put the file in your server pbo / modules folder then add it to Epoch events in your mission files init.sqf

EpochEvents = [["any","any","any","any",30,"abandonedvaults"],["any","any","any","any",30,"convoy"],["any","any","any","any",30,"animated_crash_spawner"],["any","any","any","any",40,"drop_bombs"],["any","any","any","any",15,"supply_drop"], ["any","any","any","any",55,"construction"], ["any","any","any","any",10,"military"], ["any","any","any","any",25,"treasure"], ["any","any","any","any",40,"supplyitems"]];

 

or try edit a sql event i use a sql event that deletes vehicles from safe zones every restart

 

I dont want cars deleted just simply unlocked, how can I do this using sql?

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