Advertisement
infiSTAR23

ExileServer_world_spawnSpawnZoneVehicles.sqf

Oct 17th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. /**
  2.  * ExileServer_world_spawnSpawnZoneVehicles
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_spawnRadius","_vehiclesToSpawn","_markerName","_markerCenterPosition","_numberOfVehiclesToSpawn","_vehicleClassName","_i","_vehiclePosition","_vehicleDirection"];
  13. "Creating spawn zone vehicles..." call ExileServer_util_log;
  14. _spawnRadius = getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "spawnZoneRadius");
  15. _vehiclesToSpawn = getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "spawnZoneVehicles");
  16. {
  17.     _markerName = _x;
  18.     if (getMarkerType _markerName == "ExileSpawnZone") then
  19.     {
  20.         _markerCenterPosition = getMarkerPos _markerName;
  21.        
  22.         {
  23.             _x params [
  24.                 ['_numberOfVehiclesToSpawn',0,[0]],
  25.                 ['_vehicleClassName','Exile_Bike_OldBike',['']]
  26.             ];
  27.            
  28.             for "_i" from 1 to _numberOfVehiclesToSpawn do
  29.             {
  30.                 _vehiclePosition = [_markerCenterPosition, _spawnRadius] call ExileClient_util_world_findRoadPosition;
  31.                 if(_vehiclePosition isEqualTo [])exitWith{};
  32.                 _vehicleDirection = (random 360);
  33.                 [_vehicleClassName, _vehiclePosition, _vehicleDirection, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
  34.             };
  35.         } forEach _vehiclesToSpawn;
  36.     };
  37. } forEach allMapMarkers;
  38. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement