DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
StaticFlagPole.c
См. документацию.
1/*
2For use in events/by modders, not part of standard gameplay
3Example object spawner json use:
4
5{
6 "Objects": [
7 {
8 "name": "StaticFlagPole",
9 "pos": [
10 3000,
11 57,
12 3000
13 ],
14 "ypr": [
15 0.0,
16 0.0,
17 0.0
18 ],
19 "scale": 1,
20 "customString": "Flag_Bohemia"
21 }
22 ]
23}
24
25*/
26
27class StaticFlagPole extends TerritoryFlag
28{
29 override void OnPartDismantledServer( notnull Man player, string part_name, int action_id )
30 {
31 }
32
33 override void OnPartDestroyedServer( Man player, string part_name, int action_id, bool destroyed_by_connected_part = false )
34 {
35 }
36
38 {
39 FullyBuild();
40
41 if (item.customString != string.Empty)
42 {
43 EntityAI flag = GetInventory().CreateInInventory(item.customString);
44 if (flag)
45 {
46 AnimateFlagEx(0);
47 AddRefresherTime01(1);
48 }
49 }
50 }
51
52 // version of FullyBuild which does not require a player
53 override void FullyBuild()
54 {
55 array<ConstructionPart> parts = GetConstruction().GetConstructionParts().GetValueArray();
56
57 foreach (ConstructionPart part : parts)
58 {
59 ConstructionPart construtionPart = GetConstruction().GetConstructionPart(part.GetPartName());
60
61 if (construtionPart.IsBase())
62 {
63 SetBaseState(true);
65 }
66
67 RegisterPartForSync(construtionPart.GetId());
68 RegisterActionForSync(construtionPart.GetId(), AT_BUILD_PART);
70 SetPartFromSyncData(construtionPart); // server part of sync, client will be synced from SetPartsFromSyncData
74 }
75
76 GetConstruction().UpdateVisuals();
77 }
78}
const int AT_BUILD_PART
Определения _constants.c:6
void UpdateNavmesh()
Определения BaseBuildingBase.c:2174
void RegisterPartForSync(int part_id)
Определения BaseBuildingBase.c:1413
void RegisterActionForSync(int part_id, int action_id)
Определения BaseBuildingBase.c:1511
void ResetActionSyncData()
Определения BaseBuildingBase.c:1517
Construction GetConstruction()
Определения BaseBuildingBase.c:2244
void SetPartFromSyncData(ConstructionPart part)
Определения BaseBuildingBase.c:1541
ItemBase CreateConstructionKit()
Определения BaseBuildingBase.c:1641
void SynchronizeBaseState()
Определения BaseBuildingBase.c:1384
void SetBaseState(bool has_base)
Определения BaseBuildingBase.c:1625
void UpdateVisuals()
Определения Construction.c:188
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
int GetId()
Определения ConstructionPart.c:40
bool IsBase()
Определения ConstructionPart.c:65
Определения Building.c:6
string customString
Определения ObjectSpawner.c:107
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
override void OnPartDismantledServer(notnull Man player, string part_name, int action_id)
Определения StaticFlagPole.c:29
override void OnPartDestroyedServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
Определения StaticFlagPole.c:33
override void OnSpawnByObjectSpawner(ITEM_SpawnerObject item)
Определения StaticFlagPole.c:37
override void FullyBuild()
Определения StaticFlagPole.c:53
Определения StaticFlagPole.c:28
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static const string Empty
Определения EnString.c:7
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10