Sprache Deutsch Language English

Script Dokumentation LS 2015 - TreePlanterActivatable (Patch 1.3)

Script Dokumentation Übersicht

scripts/vehicles/specializations/TreePlanterActivatable.lua

Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1--
2-- TreePlanterActivatable
3-- This is the activable class for treeplanters
4--
5-- @author Manuel Leithner
6-- @date 24/09/14
7--
8-- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
9
10TreePlanterActivatable = {}
11local TreePlanterActivatable_mt = Class(TreePlanterActivatable);
12
13function TreePlanterActivatable:new(treePlanter)
14 local self = {};
15 setmetatable(self, TreePlanterActivatable_mt);
16
17 self.treePlanter = treePlanter;
18 self.activateText = string.format(g_i18n:getText("refill_OBJECT"), self.treePlanter.typeDesc)
19
20 return self;
21end;
22
23function TreePlanterActivatable:getIsActivatable()
24 if self.treePlanter:getRootAttacherVehicle() ~= g_currentMission.controlledVehicle then
25 return false;
26 end;
27
28 if self.treePlanter.mountedSaplingPallet == nil and self.treePlanter.nearestSaplingPallet ~= nil then
29 return true;
30 end
31 return false;
32end;
33
34function TreePlanterActivatable:onActivateObject()
35 self.treePlanter:loadPallet(networkGetObjectId(self.treePlanter.nearestSaplingPallet));
36end;
37
38function TreePlanterActivatable:drawActivate()
39end;
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
Script Dokumentation Übersicht