Darihon

Restart cars

Jul 13th, 2014
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. /*
  2. Script that spawns vehicles random over the map.
  3. Made by Darihon.
  4.  
  5. How to add a new vehicle:
  6. 1. Copy one of the lines (_vehicle# = ...)
  7. 2. Change the _vehicle# to a number u like.
  8. 3. Do the same with _spot#
  9. 4. Same with _veh# but edit the "_vehicle#" & _spot# into the new number defined above (i.e _vehicle5 & _spot5)
  10. 5. Add _veh# into the arrays of setVariable.
  11. */
  12.  
  13. // Locations
  14. locations = [
  15. []
  16. ];
  17.  
  18. // Array of Vehicles
  19. rvehicles = [
  20. "HMMWV_Ambulance",
  21. "HMMWV_Ambulance_CZ_DES_EP1",
  22. "HMMWV_DES_EP1",
  23. "HMMWV_DZ",
  24. "HMMWV_M1035_DES_EP1",
  25. "LandRover_CZ_EP1",
  26. "LandRover_TK_CIV_EP1",
  27. "UAZ_CDF",
  28. "UAZ_INS",
  29. "UAZ_RU",
  30. "UAZ_Unarmed_TK_CIV_EP1",
  31. "UAZ_Unarmed_TK_EP1",
  32. "UAZ_Unarmed_UN_EP1"
  33. ];
  34.  
  35. // Choses a random vehicle in the 'rvehicles' array.
  36. _vehicle1 = rvehicles call BIS_fnc_SelectRandom;
  37. _vehicle2 = rvehicles call BIS_fnc_SelectRandom;
  38. _vehicle3 = rvehicles call BIS_fnc_SelectRandom;
  39.  
  40. // Choses a random location from 'locations' array.
  41. _spot1 = locations call BIS_fnc_SelectRandom;
  42. _spot2 = rvehicles call BIS_fnc_SelectRandom;
  43. _spot3 = rvehicles call BIS_fnc_SelectRandom;
  44.  
  45. // Creates a vehicle at the spot
  46. _veh = createVehicle [_vehicle1, _spot1, [], 0, "CAN_COLLIDE"];
  47. _veh2 = createVehicle [_vehicle2, _spot2, [], 0, "CAN_COLLIDE"];
  48. _veh3 = createVehicle [_vehicle3, _spot3, [], 0, "CAN_COLLIDE"];
  49. // Makes sure they dissapear after restart.
  50. [_veh,_veh2,_veh3] setVariable ["ObjectID", "1", true];
  51. [_veh,_veh2,_veh3] setVariable ["ObjectUID", "1", true];
Advertisement
Add Comment
Please, Sign In to add comment