DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
PluginDeveloper.c
Go to the documentation of this file.
1class PluginDeveloper extends PluginBase
2{
3 protected bool m_IsWinHolding;
4 protected int m_FeaturesMask;
6
7 #ifdef DEVELOPER
8 ref PresetSpawnBase m_PresetObj;
9 #endif
10
11
12 static PluginDeveloper GetInstance()
13 {
14 return PluginDeveloper.Cast( GetPlugin( PluginDeveloper ) );
15 }
16
19 {
21 }
22
24 void Teleport(PlayerBase player, vector position)
25 {
26 DeveloperTeleport.SetPlayerPosition(player, position);
27 }
28
31 {
33 }
34
37 {
39 }
40
42 {
44 }
45
46 // System Public Events
48 {
49
50 }
51
52 override void OnInit()
53 {
54 super.OnInit();
55
57 }
58
59 void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
60 {
61 #ifdef DIAG_DEVELOPER
62 switch (rpc_type)
63 {
64 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND:
65 {
66 OnRPCSpawnEntityOnGround(player, ctx); break;
67 }
68 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID:
69 {
70 OnRPCSpawnEntityOnGroundPatternGrid(player, ctx); break;
71 }
72 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR:
73 {
74 OnRPCSpawnEntityOnCursorDir(player, ctx); break;
75 }
76 case ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY:
77 {
78 OnRPCSpawnEntity(player, ctx); break;
79 }
80 case ERPCs.DEV_RPC_CLEAR_INV:
81 {
82 OnRPCClearInventory(player); break;
83 }
84 case ERPCs.DEV_RPC_SEND_SERVER_LOG:
85 {
86 OnRPCServerLogRecieved( ctx ); break;
87 }
88 case ERPCs.RPC_SYNC_SCENE_OBJECT:
89 {
90 OnRPCSyncSceneObject( ctx ); break;
91 }
92 case ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG:
93 {
94 OnRPCPluginDayzCreatureDebug(player, rpc_type, ctx); break;
95 }
96 case ERPCs.DEV_RPC_SPAWN_PRESET:
97 {
98 HandlePresetSpawn(player,ctx); break;
99 }
100 case ERPCs.DEV_RPC_SET_TIME:
101 {
102 HandleSetTime(player,ctx); break;
103 }
104 }
105
106 DeveloperTeleport.OnRPC(player, rpc_type, ctx);
107 #endif
108 }
109
110 // Public API
111 // Send Print to scripted console
112 void PrintLogClient(string msg_log)
113 {
114 if ( g_Game.GetUIManager().IsMenuOpen(MENU_SCRIPTCONSOLE) )
115 {
116 Param1<string> msg_p = new Param1<string>(msg_log);
118 }
119 }
120
121 // Server Log Synch: Server Side
122 void SendServerLogToClient(string msg)
123 {
124 if ( GetGame() )
125 {
126 array<Man> players = new array<Man>;
127 GetGame().GetPlayers( players );
128
129 for ( int i = 0; i < players.Count(); ++i )
130 {
131 Param1<string> param = new Param1<string>( msg );
132 Man player = players.Get(i);
133
134 if ( player && player.HasNetworkID() )
135 {
136 player.RPCSingleParam(ERPCs.DEV_RPC_SEND_SERVER_LOG, param, true, player.GetIdentity());
137 }
138 }
139 }
140 }
141
143 {
144 Param3<string, EntityAI, Param> par = new Param3<string, EntityAI, Param>( "", NULL, new Param );
145
146 if ( ctx.Read( par ) )
147 {
148 PluginSceneManager module_scene_editor = PluginSceneManager.Cast( GetPlugin( PluginSceneManager ) );
149 SceneData scene_data = module_scene_editor.GetLoadedScene();
150 SceneObject scene_object = scene_data.GetSceneObjectByEntityAI( par.param2 );
151
152 GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallByName( scene_object, par.param1, par.param3 );
153 }
154 }
155
157 {
159 if (pluginDZCreatureDebug)
160 {
161 pluginDZCreatureDebug.OnRpc(player, rpc_type, ctx);
162 }
163 }
164
166 {
167 #ifdef DEVELOPER
168
169 Param5<int,int,int,int,int> p5 = new Param5<int,int,int,int,int>(0,0,0,0,0);
170
171 if ( ctx.Read( p5 ) )
172 {
173 //float time01 = p5.param4 / 100;
174 //int time_minutes = Math.Lerp(0, 24*60, time01 );
175
176 int year = p5.param1;
177 int month = p5.param2;
178 int day = p5.param3;
179 int hour = p5.param4;
180 int minute = p5.param5;
181
182
183
184 GetGame().GetWorld().SetDate(year,month, day, hour, minute);
185 /*
186 Debug.Log("year:" + year);
187 Debug.Log("month:" + month);
188 Debug.Log("day:" + day);
189 Debug.Log("hour:" + hour);
190 Debug.Log("minute:" + minute);
191 */
192 }
193
194 #endif
195 }
196
198 {
199 #ifdef DEVELOPER
201 {
202 player.m_PresetSpawned = true;
203 string preset_name = CachedObjectsParams.PARAM1_STRING.param1;
204 string class_name = preset_name + "_Preset";
205 typename type = class_name.ToType();
206
207 if (type)
208 {
209 m_PresetObj = PresetSpawnBase.Cast(type.Spawn());
210 }
211
212 if (m_PresetObj)
213 {
214 m_PresetObj.Init(player);
215 }
216
217 }
218 #endif
219 }
220
221 // RPC Events
222 // Server Log Synch: Client Side
224 {
225 Param1<string> param = new Param1<string>( "" );
226
227 if ( ctx.Read(param) && param.param1 != "" )
228 {
230 }
231 }
232
234 {
235 ClearInventory(player);
236 }
237
238 // Client -> Server Spawning: Server Side
240 {
241 Param6<string, float, float, float, bool, string> p = new Param6<string, float, float, float, bool, string>("", 0, 0, 0, false, "");
242 if ( ctx.Read(p) )
243 {
244 SpawnEntityOnCursorDir(player, p.param1, p.param2, p.param3, p.param4, p.param5, p.param6);
245 }
246 }
247
249 {
250 Param4<string, float, float, vector> p = new Param4<string, float, float, vector>("", 0, 0, "0 0 0");
251 if ( ctx.Read(p) )
252 {
253 SpawnEntityOnGroundPos(player, p.param1, p.param2, p.param3, p.param4);
254 }
255 }
256
258 {
259 auto p = new Param8<string,int, float, float, int, int, float, float>("",0,0,0,0,0,0,0);
260 if ( ctx.Read(p) )
261 {
262 SpawnEntityOnGroundPatternGrid(player, p.param1, p.param2, p.param3, p.param4, p.param5, p.param6, p.param7, p.param8);
263 }
264 }
266 {
267 #ifdef DEVELOPER
268 Param5<string, float, float,bool, string> p = new Param5<string, float, float, bool, string>("", 0, 0, false, "");
269 if ( ctx.Read(p) )
270 {
271 EntityAI ent = SpawnEntityInInventory(player, p.param1, p.param2, p.param3, p.param4);
272 if (p.param5)
273 {
274 if (player.m_PresetSpawned)
275 {
276 player.m_PresetSpawned = false;
277 player.m_PresetItems.Clear();
278 }
279 if (ent)
280 {
281 player.m_PresetItems.Insert(ent);
282 }
283 }
284 }
285 #endif
286 }
287
288
289 void OnSetFreeCameraEvent( PlayerBase player, FreeDebugCamera camera )
290 {
292 }
293
295 {
296 PrintString("PluginDeveloper.SpawnEntity() Warning- Cant spawn object: " + name);
297 //DumpStack();
298 PrintString("PluginDeveloper.SpawnEntity() Warning END");
299 }
300
301 void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity = -1, bool special = false, string presetName = "")
302 {
303 #ifdef DEVELOPER
304 if (presetName && player.m_PresetSpawned)//this is how we ascertain this is the first item being spawned from a new preset after a previous preset was already spawned in
305 {
306 player.m_PresetItems.Clear();
307 player.m_PresetSpawned = false;//is set to 'true' elsewhere after all the items have been spawned in
308 }
309 if ( entity.IsInherited( PlayerBase ) )
310 {
311 PlayerBase plr = PlayerBase.Cast( entity );
312 plr.OnSpawnedFromConsole();
313 }
314 else if ( entity.IsInherited(ItemBase) )
315 {
316 ItemBase item = ItemBase.Cast( entity );
317 SetupSpawnedItem(item, health, quantity);
318 }
319 else if (entity.IsInherited(House))
320 {
321 entity.PlaceOnSurface();
322 vector pos = entity.GetPosition();
323 vector ori = GetGame().GetSurfaceOrientation(pos[0], pos[2]);
324 entity.SetOrientation(ori);
325 }
326 if (presetName)
327 {
328 player.m_PresetItems.Insert(entity);
329 }
330 if ( special )
331 entity.OnDebugSpawn();
332 #endif
333 }
334
335
336 void SpawnEntityOnGroundPatternGrid( PlayerBase player, string item_name, int count, float health, float quantity, int rows, int columns, float gapRow = 1, float gapColumn = 1)
337 {
338 if (!item_name)
339 {
340 return;
341 }
342 if ( GetGame().IsServer() )
343 {
344 float rowDist = 0;
345 float columnDist = 0;
346
347 vector playerPos = player.GetPosition();
348 vector camDirForward = player.GetDirection();
349 vector camDirRight = camDirForward.Perpend() * -1;
350 int countLoop = 0;
351 for (int i = 0; i < rows; i++)
352 {
353 vector posRow = playerPos + camDirForward * rowDist;
354 vector offsetSide;
355 columnDist = 0;
356 for (int j = 0; j < columns; j++)
357 {
358 offsetSide = camDirRight * columnDist;
359 vector placement = posRow + offsetSide;
360 float hlth = health * MiscGameplayFunctions.GetTypeMaxGlobalHealth( item_name );
361 EntityAI ent = SpawnEntityOnGroundPos(player, item_name, hlth, quantity, placement );
362 ent.PlaceOnSurface();
363 countLoop++;
364 if (countLoop == count)
365 {
366 return;
367 }
368 columnDist += gapColumn;
369 }
370 rowDist += gapRow;
371 }
372 }
373 else
374 {
375 auto params = new Param8<string, int, float, float, int, int, float, float>(item_name, count, health, quantity, rows, columns, gapRow, gapColumn);
376 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID, params, true);
377 }
378 }
379
380
381
390 EntityAI SpawnEntityOnGroundPos( PlayerBase player, string item_name, float health, float quantity, vector pos)
391 {
392 if ( GetGame().IsServer() )
393 {
394 EntityAI entity = player.SpawnEntityOnGroundPos(item_name, pos);
395 if (entity)
396 SetupSpawnedEntity(player, entity, health, quantity);
397 else
398 OnSpawnErrorReport(item_name);
399 return entity;
400 }
401 else
402 {
403 Param4<string, float, float, vector> params = new Param4<string, float, float, vector>(item_name, health, quantity, pos);
404 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND, params, true);
405 }
406 return NULL;
407 }
416 EntityAI SpawnEntityOnCursorDir( PlayerBase player, string item_name, float quantity, float distance, float health = -1, bool special = false, string presetName = "")
417 {
418
419 if ( GetGame().IsServer() )
420 {
421 // Client -> Server Spawning: Server Side
422 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
423
424 if ( entity )
425 {
426 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)//check for default (-1)
427 {
428 health = entity.GetMaxHealth();
429 }
430 SetupSpawnedEntity( player,entity, health, quantity, special, presetName );
431 }
432 else
433 OnSpawnErrorReport( item_name );
434 return entity;
435 }
436 else
437 {
438 // Client -> Server Spawning: Client Side
439 Param6<string, float, float, float, bool, string> params = new Param6<string, float, float, float, bool, string>(item_name, quantity, distance, health, special, presetName);
440 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params, true);
441 }
442 return NULL;
443 }
454 EntityAI SpawnEntityInInventory( PlayerBase player, string item_name, float health, float quantity, bool special = false, string presetName = "")
455 {
456 if ( player )
457 {
458 if ( GetGame().IsServer() )
459 {
460 #ifdef DEVELOPER
461 if (GetGame().IsKindOf(item_name, "Transport"))
462 {
463 EntityAI car = SpawnEntityOnGroundPos(player, item_name, 1, quantity, player.GetPosition());
464 car.OnDebugSpawn();
465
466 if (GetGame().IsMultiplayer())
467 {
468 DayZPlayerSyncJunctures.SendGetInCar(player, car);
469 }
470 else
471 {
472 player.SetGetInVehicleDebug(car);
473 }
474
475 return car;
476 }
477 #endif
478
480 if (player.GetInventory() && player.GetInventory().FindFirstFreeLocationForNewEntity(item_name, FindInventoryLocationType.ANY, il))
481 {
482 Weapon_Base wpn = Weapon_Base.Cast(il.GetParent());
483 bool is_mag = il.GetSlot() == InventorySlots.MAGAZINE || il.GetSlot() == InventorySlots.MAGAZINE2 || il.GetSlot() == InventorySlots.MAGAZINE3;
484 if (wpn && is_mag)
485 {
486 vector pos = player.GetPosition();
487 EntityAI eai_gnd = SpawnEntityOnGroundPos(player, item_name, health, quantity, pos);
488 Magazine mag_gnd = Magazine.Cast(eai_gnd);
489 if (mag_gnd && player.GetWeaponManager().CanAttachMagazine(wpn, mag_gnd))
490 {
491 player.GetWeaponManager().AttachMagazine(mag_gnd);
492 }
493 return eai_gnd;
494 }
495 else
496 {
497 EntityAI eai = GetGame().SpawnEntity(item_name, il, ECE_IN_INVENTORY, RF_DEFAULT);
498 if ( eai && eai.IsInherited(ItemBase) )
499 {
500 if ( health < 0 )//check for default (-1)
501 {
502 health = eai.GetMaxHealth();
503 }
504 ItemBase i = ItemBase.Cast( eai );
505 SetupSpawnedItem(i, health, quantity);
506 if ( special )
507 eai.OnDebugSpawn();
508 }
509 return eai;
510 }
511 }
512 else
513 OnSpawnErrorReport(item_name);
514 return NULL;
515 }
516 else
517 {
518 // Client -> Server Spawning: Client Side
519 Param5<string, float, float, bool, string> params = new Param5<string, float, float, bool, string>(item_name, health, quantity, special, presetName );
520 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params, true);
521 }
522 }
523 return NULL;
524 }
532 EntityAI SpawnEntityAsAttachment (PlayerBase player, EntityAI parent, string att_name, float health, float quantity)
533 {
534 if ( GetGame().IsServer() )
535 {
536 Weapon_Base wpn = Weapon_Base.Cast(parent);
537 if (wpn)
538 {
539 GameInventory inventory = parent.GetInventory();
540 return inventory.CreateInInventory(att_name);
541 /*
542 vector pos = player.GetPosition();
543 EntityAI eai_gnd = SpawnEntityOnGroundPos(player, att_name, health, quantity, pos);
544 Magazine mag_gnd = Magazine.Cast(eai_gnd);
545 if (mag_gnd && player.GetWeaponManager().CanAttachMagazine(wpn, mag_gnd))
546 {
547 player.GetWeaponManager().AttachMagazine(mag_gnd);
548 }
549 return eai_gnd;
550 */
551 }
552 else
553 {
554 EntityAI eai = parent.GetInventory().CreateAttachment(att_name);
555 if (eai)
556 {
557 if ( eai.IsInherited(ItemBase) )
558 {
559 ItemBase i = ItemBase.Cast( eai );
560 SetupSpawnedItem(ItemBase.Cast( eai ), health, quantity);
561 }
562 return eai;
563 }
564 else
565 OnSpawnErrorReport(att_name);
566 }
567 return NULL;
568 }
569 else
570 {
571 // Client -> Server Spawning: Client Side
572 Param3<string, float, float> params = new Param3<string, float, float>(att_name, health, quantity);
573 player.RPCSingleParam(ERPCs.DEV_RPC_SPAWN_ITEM_AS_ATTACHMENT, params, true);
574 }
575 return NULL;
576 }
577
579 {
580 UIScriptedMenu menu_curr = GetGame().GetUIManager().GetMenu();
581
582 if ( menu_curr == NULL )
583 {
584 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
585 if ( player )
586 {
587 if ( !GetGame().GetWorld().Is3rdPersonDisabled() )
588 {
589 player.SetIsInThirdPerson(!player.IsInThirdPerson());//this counters the effect of switching camera through pressing the 'V' key
590 }
591
592 vector pos_player = player.GetPosition();
593
594 // Get item from clipboard
595 string clipboard;
596 GetGame().CopyFromClipboard(clipboard);
597
598 if (!clipboard.Contains(","))
599 {
600 //single item
601 EntityAI object_spawned_from_clipboard = SpawnEntityOnCursorDir(player, clipboard, -1, 1);
602 //Print(object_spawned_from_clipboard);
603 }
604 else
605 {
606 TStringArray items = new TStringArray;
607 clipboard.Split( ",", items );
608
609 foreach(string item:items)
610 {
611 SpawnEntityOnCursorDir(player, item.Trim(), -1, 1);
612 }
613 }
614 }
615 }
616
617 return NULL;
618 }
619
620 // Clear Player Inventory
622 {
623 if ( GetGame().IsServer() )
624 {
625 player.ClearInventory();
626 }
627 else
628 {
629 Param1<int> params = new Param1<int>(0);
630 player.RPCSingleParam(ERPCs.DEV_RPC_CLEAR_INV, params, true);
631 }
632 }
633
635 {
636 if ( g_Game.GetUIManager().GetMenu() == NULL )
637 {
638 g_Game.GetUIManager().EnterScriptedMenu(MENU_HELP_SCREEN, NULL);
639 }
640 else if ( g_Game.GetUIManager().IsMenuOpen(MENU_HELP_SCREEN) )
641 {
642 g_Game.GetUIManager().Back();
643 }
644 }
645
647 {
648 if ( GetGame() != null && GetGame().GetPlayer() != null )
649 {
650 if ( g_Game.GetUIManager().GetMenu() == NULL )
651 {
652 m_ScriptConsole = g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE, NULL);
654 }
655 else if ( g_Game.GetUIManager().IsMenuOpen(MENU_SCRIPTCONSOLE) )
656 {
657 g_Game.GetUIManager().Back();
659 }
660 }
661 }
662
663 // Mission Editor
665 {
666 g_Game.GetUIManager().OpenWindow( GUI_WINDOW_MISSION_LOADER );
667 }
668
669 // Script Editor History
670 private void ScriptHistoryNext()
671 {
672 // Console key press
673 if ( g_Game.GetUIManager().IsMenuOpen(MENU_SCRIPTCONSOLE) )
674 {
676 }
677 }
678
679 private void ScriptHistoryBack()
680 {
681 // Console key press
682 if ( g_Game.GetUIManager().IsMenuOpen(MENU_SCRIPTCONSOLE) )
683 {
685 }
686 }
687
688 private bool IsIngame()
689 {
690 UIScriptedMenu menu_curr = GetGame().GetUIManager().GetMenu();
691
692 if ( menu_curr == NULL )
693 {
694 return true;
695 }
696
697 return false;
698 }
699
700 private bool IsInConsole()
701 {
702 UIScriptedMenu menu_curr = GetGame().GetUIManager().GetMenu();
703
704 if ( menu_curr != NULL && menu_curr.GetID() == MENU_SCRIPTCONSOLE )
705 {
706 return true;
707 }
708
709 return false;
710 }
711
712 // Tools
713 int QuickSortPartition( TStringArray arr, int left, int right )
714 {
715 string pivot = arr.Get( left );
716 int i = left;
717 int j = right + 1;
718 string temp;
719
720 while ( true )
721 {
722 while ( true )
723 {
724 i++;
725 if ( i > right || arr.Get(i) > pivot )
726 {
727 break;
728 }
729 }
730
731 while ( true )
732 {
733 j--;
734 if ( arr.Get(j) <= pivot )
735 {
736 break;
737 }
738 }
739
740 if ( i >= j )
741 {
742 break;
743 }
744
745 temp = arr.Get( i );
746 arr.Set( i, arr.Get(j) );
747 arr.Set( j, temp );
748 }
749
750 temp = arr.Get( left );
751 arr.Set( left, arr.Get(j) );
752 arr.Set( j, temp );
753
754 return j;
755 }
756
757 void QuickSort( TStringArray arr, int left, int right )
758 {
759 int j;
760
761 if ( left < right )
762 {
763 j = QuickSortPartition( arr, left, right );
764 QuickSort( arr, left, j - 1 );
765 QuickSort( arr, j + 1, right );
766 }
767 }
768
770 {
771 QuickSort( arr, 0, arr.Count() - 1 );
772 }
773
774 void ResetGUI()
775 {
776 if ( GetGame() && GetGame().GetMission() )
777 {
779 }
780 }
781
782 static void SetDeveloperItemClientEx(notnull Object entity, bool getFocus = false)
783 {
784 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
785
786 if (getFocus)
787 {
790 }
791
792 if (GetGame().IsMultiplayer())
793 {
794 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_SET_DEV_ITEM, new Param1<Object>(entity), true, GetGame().GetPlayer().GetIdentity());
795 }
796 else
797 {
799 mid2.RegisterDebugItem(entity, player);
800 }
801 #ifdef DEVELOPER
802 SetDebugDeveloper_item(entity);
803 #endif
804 }
805
807 {
808 #ifdef DEVELOPER
809 Object entity;
810 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
811
812 FreeDebugCamera debugCam = FreeDebugCamera.GetInstance();
813 if (debugCam && debugCam.GetCurrentCamera())
814 {
815 entity = debugCam.GetCrosshairObject();
816 }
817 else
818 {
819
820 if (player && player.GetActionManager())
821 {
822 ActionTarget at = player.GetActionManager().FindActionTarget();
823 entity = at.GetObject();
824 }
825 }
826
827 if (entity)
828 {
829 SetDeveloperItemClientEx(entity, true);
830 }
831 #endif
832 }
833}
class ActionTargets ActionTarget
const int ECE_IN_INVENTORY
const int RF_DEFAULT
DayZGame g_Game
Definition DayZGame.c:3654
const CallID CALL_ID_SCR_CNSL_HISTORY_NEXT
Definition Dispatcher.c:5
const CallID CALL_ID_SCR_CNSL_HISTORY_BACK
Definition Dispatcher.c:4
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Definition Dispatcher.c:6
Param CallMethod(CallID call_id, Param params)
Definition Dispatcher.c:36
ERPCs
Definition ERPCs.c:2
FindInventoryLocationType
flags for searching locations in inventory
void SetupSpawnedItem(ItemBase item, float health, float quantity)
Definition ItemBase.c:4656
PlayerBase GetPlayer()
class OptionSelectorMultistate extends OptionSelector class_name
void PluginDayZCreatureAIDebug()
string name
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
proto native Mission GetMission()
proto void CopyFromClipboard(out string text)
proto native Input GetInput()
proto native void GetPlayers(out array< Man > players)
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
proto native World GetWorld()
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:882
proto native UIManager GetUIManager()
vector GetSurfaceOrientation(float x, float z)
Returns tilt of the ground on the given position in degrees, so you can use this value to rotate any ...
Definition Game.c:1074
static ref Param1< string > PARAM1_STRING
Definition Debug.c:14
static void ReceivedLogMessageFromServer(string message)
Definition Debug.c:262
static bool IsFreeCameraEnabled()
static void FreeCameraToggle(PlayerBase player, bool teleport_player=false)
Enable / Disable Free camera (Fly mod) - disable of camera will teleport player at current free camer...
static void OnInit()
static void OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
static void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
static void TeleportAtCursorEx()
static void SetPlayerPosition(PlayerBase player, vector position, bool breakSync=false)
override bool IsBuilding()
Definition Building.c:18
script counterpart to engine's class Inventory
Definition Inventory.c:77
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
Definition Inventory.c:844
proto native void ChangeGameFocus(int add, int input_device=-1)
Change game focus number.
InventoryLocation.
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
provides access to slot configuration
void ResetGUI()
Definition gameplay.c:694
void AddActiveInputExcludes(array< string > excludes)
void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
deprecated
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
override void OnInit()
int QuickSortPartition(TStringArray arr, int left, int right)
UIScriptedMenu m_ScriptConsole
bool IsEnabledFreeCamera()
void ToggleMissionLoader()
void HandleSetTime(PlayerBase player, ParamsReadContext ctx)
void OnRPCClearInventory(PlayerBase player)
void OnRPCSpawnEntityOnCursorDir(PlayerBase player, ParamsReadContext ctx)
void OnRPCSpawnEntity(PlayerBase player, ParamsReadContext ctx)
static PluginDeveloper GetInstance()
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string item_name, float health, float quantity, vector pos)
spawns entity on exact position
EntityAI SpawnEntityOnCursorDir(PlayerBase player, string item_name, float quantity, float distance, float health=-1, bool special=false, string presetName="")
spawns entity in direction of cursor at specified distance
void SortStringArray(TStringArray arr)
void OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
private bool IsInConsole()
private void ScriptHistoryBack()
void TeleportAtCursor()
Set Player position at his cursor position in the world.
void OnRPCSpawnEntityOnGroundPatternGrid(PlayerBase player, ParamsReadContext ctx)
void ToggleHelpScreen()
void QuickSort(TStringArray arr, int left, int right)
void PrintLogClient(string msg_log)
EntityAI SpawnEntityAsAttachment(PlayerBase player, EntityAI parent, string att_name, float health, float quantity)
tries to spawn item as attachment
void OnRPCSpawnEntityOnGround(PlayerBase player, ParamsReadContext ctx)
void Teleport(PlayerBase player, vector position)
Teleport player at position.
void ToggleScriptConsole()
void OnRPCServerLogRecieved(ParamsReadContext ctx)
void ClearInventory(PlayerBase player)
void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
protected int m_FeaturesMask
void HandlePresetSpawn(PlayerBase player, ParamsReadContext ctx)
void PluginDeveloper()
static void SetDeveloperItemClientEx(notnull Object entity, bool getFocus=false)
void ToggleFreeCameraBackPos()
Enable / Disable Free camera (Fly mod)
void SendServerLogToClient(string msg)
protected bool m_IsWinHolding
void OnSpawnErrorReport(string name)
void ToggleFreeCamera()
Enable / Disable Free camera (Fly mod) - disable of camera will teleport player at current free camer...
void SpawnEntityOnGroundPatternGrid(PlayerBase player, string item_name, int count, float health, float quantity, int rows, int columns, float gapRow=1, float gapColumn=1)
private bool IsIngame()
void SetDeveloperItemClient()
EntityAI SpawnFromClipboard()
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
EntityAI SpawnEntityInInventory(PlayerBase player, string item_name, float health, float quantity, bool special=false, string presetName="")
tries to spawn item somewhere in inventory
void OnRPCSyncSceneObject(ParamsReadContext ctx)
private void ScriptHistoryNext()
void OnRPCPluginDayzCreatureDebug(PlayerBase player, int rpc_type, ParamsReadContext ctx)
SceneObject GetSceneObjectByEntityAI(EntityAI e)
Definition SceneData.c:348
proto void CallByName(Class obj, string fnName, Param params=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto bool Read(void value_in)
void ShowUICursor(bool visible)
Definition UIManager.c:246
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native void SetDate(int year, int month, int day, int hour, int minute)
Sets actual ingame world time.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
vector Perpend()
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector ...
Definition EnConvert.c:209
proto native CGame GetGame()
array< string > TStringArray
Definition EnScript.c:685
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Definition EnScript.c:345
const int MENU_HELP_SCREEN
Definition constants.c:171
const int MENU_SCRIPTCONSOLE
Definition constants.c:163
const int GUI_WINDOW_MISSION_LOADER
Definition constants.c:193
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
Definition EnString.c:396
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8