Advertisement
Guest User

Untitled

a guest
Jun 30th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. /**
  2. * Bibliothèque de fonctions permettant la visualisation 3D d'objets
  3. *
  4. * Copyright (C) 2014 Team ~R3F~
  5. *
  6. * This program is free software under the terms of the GNU General Public License version 3.
  7. * You should have received a copy of the GNU General Public License
  8. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  9. */
  10.  
  11. /*
  12. File: fn_vehicleShop3DPreview.sqf
  13. Modified By: NiiRoZz
  14.  
  15. Description:
  16. Called when a new selection is made in the list box and
  17. displays the new vehicle selected.
  18. */
  19.  
  20.  
  21. private ["_classView","_object","_id"];
  22.  
  23. if (isNil "life_preview_3D_vehicle_cam") then
  24. {
  25. [] call life_fnc_vehicleShopInit3DPreview;
  26. };
  27.  
  28. _classView = _this select 0;
  29.  
  30. // Ignore non instantiable objects.
  31. if (_classView != "" && {isClass (configFile >> "CfgVehicles" >> _classView) && {getNumber (configFile >> "CfgVehicles" >> _classView >> "scope") > 0}}) then
  32. {
  33. // Skip if object view is the same as previous.
  34. if (isNull life_preview_3D_vehicle_object || {_classView != typeOf life_preview_3D_vehicle_object}) then
  35. {
  36. if (!isNull life_preview_3D_vehicle_object) then {detach life_preview_3D_vehicle_object; deleteVehicle life_preview_3D_vehicle_object;};
  37. // Create and place the object in the sky
  38. if (!life_pos_exist) then {
  39. life_pos_attach = [[2925.77,11415.8,966.563]];
  40. life_pos_exist = true;
  41. life_preview_light = "#lightpoint" createVehicleLocal life_pos_attach;
  42. life_preview_light setLightBrightness 0.5;
  43. life_preview_light setLightColor [1,1,1];
  44. life_preview_light setLightAmbient [1,1,1];
  45. };
  46. _object = _classView createVehicleLocal life_pos_attach;
  47. _id = player getVariable ["life_clientID",-1];
  48. [_object] call life_fnc_clearVehicleAmmo;
  49. _object attachTo [life_attachment_point, life_pos_attach];
  50.  
  51. life_preview_3D_vehicle_object = _object;
  52. };
  53. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement