Guest User

Untitled

a guest
May 20th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. //Last modified 2/19/8
  2. //Run any common initialization on a unit including cleanup routines after death.
  3. Private["_side","_unit","_unitType"];
  4.  
  5. _unit = _this Select 0;
  6. _side = _this Select 1;
  7.  
  8. Call Compile Format["_unit AddEventHandler [""killed"",{[_this,""%1""] Exec ""Common\Common_UnitKilled.sqs""}]",_side];
  9.  
  10. _unitType = TypeOf _unit;
  11.  
  12. if (_unitType In soldierUnits) then
  13. {
  14. if (time > 15) then
  15. {
  16. if (Call Compile Format["!IsNil ""%1UnitsCreated""",Str _side]) then
  17. {
  18. Call Compile Format["%1UnitsCreated = %1UnitsCreated + 1;PublicVariable ""%1UnitsCreated""",Str _side];
  19. };
  20. };
  21. }
  22. else
  23. {
  24. if (_unitType In (lightUnits + heavyUnits + aircraftUnits + wingedAircraftUnits)) then
  25. {
  26. _unit SetVehicleInit "this ExecVM ""Common\Init\Init_Vehicle.sqf""";
  27. ProcessInitCommands;
  28.  
  29. if (time > 15) then
  30. {
  31. if (Call Compile Format["!IsNil ""%1VehiclesCreated""",Str _side]) then
  32. {
  33. Call Compile Format["%1VehiclesCreated = %1VehiclesCreated + 1;PublicVariable ""%1VehiclesCreated""",Str _side];
  34. };
  35. };
  36.  
  37. if (ABANDONEDVEHICLETIME > 0) then
  38. {
  39. _unit AddEventHandler ["GetOut",{_this Spawn UpdateEmptyVehicle}];
  40. };
  41.  
  42. ## DoB Warfare Mod -- Knock back engage stats of BRDM-2s and BMP-2s -- 7/26/08 RP
  43. if (_unitType In ["BRDM2","BMP2"]) then
  44. {
  45. _unit setSkill ["spotDistance",0.25];
  46. };
  47. };
  48. };
  49.  
  50. //2/22/7 MM - Created file.
Add Comment
Please, Sign In to add comment