Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. //Switch on type of loot
  2. switch (_lootInfo select 0) do
  3. {
  4. //Spawn a single weapon with [0,MAX_WEAPON_MAGAZINES] magazines.
  5. case Loot_WEAPON:
  6. {
  7. _vehicle = createVehicle ["WeaponHolder", _this select 1, [], 0, "CAN_COLLIDE"];
  8. _vehicle addWeaponCargoGlobal [_lootInfo select 1, 1];
  9.  
  10. Debug_Assert(typeName (_lootInfo select 1) == typeName "" && { (_lootInfo select 1) != "" });
  11. //Debug_Log(String_Format2("DEBUG: Loot_Spawn Weapon: %1 Position: %2", _lootInfo select 1, _this select 1));
  12.  
  13. if (surfaceIsWater (_this select 1)) then {
  14. _vehicle setPos (_this select 1);
  15. } else {
  16. _vehicle setPosATL (_this select 1);
  17. };
  18.  
  19. INCREMENT_WEAPON_HOLDERS();
  20.  
  21. _magazines = getArray (configFile >> "CfgWeapons" >> _lootInfo select 1 >> "magazines");
  22.  
  23. if (count _magazines > 0 && {getNumber (configFile >> "CfgWeapons" >> _lootInfo select 1 >> "melee") != 1}) then
  24. {
  25. #ifdef COMPLEX_WEAPON_MAGAZINES
  26. for "_i" from 1 to (floor random (MAX_WEAPON_MAGAZINES + 1)) do
  27. {
  28. _vehicle addMagazineCargoGlobal [_magazines select floor random count _magazines, 1];
  29. };
  30. #else
  31. _vehicle addMagazineCargoGlobal [_magazines select 0, floor random (MAX_WEAPON_MAGAZINES + 1)];
  32. #endif
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement