DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
TrapBase.c
Go to the documentation of this file.
2{
4}
5
6class TrapBase extends ItemBase
7{
8 #ifdef SERVER
9 protected const int SPAWN_FLAGS = ECE_CREATEPHYSICS;
10 #else
11 protected const int SPAWN_FLAGS = ECE_LOCAL;
12 #endif
13
14 protected const int DAMAGE_TRIGGER_MINE = 75;
15 protected const float UPDATE_TIMER_INTERVAL = 0.05;
16
17 int m_InitWaitTime; //After this time after deployment, the trap is activated
18 bool m_NeedActivation; //If activation of trap is needed
19 float m_DefectRate; //Added damage after trap activation
20 float m_DamagePlayers; //How much damage player gets when caught
21 float m_DamageOthers; //How much damage player gets when caught
22
23 bool m_AddActivationDefect; // Damage trap after activation
24 bool m_AddDeactivationDefect; // Damage trap after deactivation
25 protected bool m_IsActive; // True means that the trap is ready to detonate
26 protected bool m_IsInProgress;
27
28 protected bool m_Disarmed = false;
29
31
35
41
42 protected ref Timer m_Timer;
43 protected ref Timer m_UpdateTimer;
45
48
49 void TrapBase()
50 {
51 m_IsInProgress = false;
52 m_NeedActivation = true;
53 m_InitWaitTime = 5; //After this time after deployment, the trap is activated
54 m_DefectRate = 15; //Added damage after trap activation
55 m_DamagePlayers = 25; //How much damage player gets when caught
56 m_DamageOthers = 100; //How much damage others gets when caught
57
60
62
66
67 m_InfoSetup = "#STR_TrapBase0";
68 m_InfoDeactivated = "#STR_TrapBase1";
69 m_InfoDamageManipulation = "#STR_TrapBase2";
70 m_InfoDamage = "#STR_TrapBase3";
71 m_InfoActivationTime = "#STR_TrapBase4" + m_InitWaitTime.ToString() + "#STR_TrapBase5";
72
73 m_UpdateTimer = new ref Timer();
74
75 RegisterNetSyncVariableBool("m_IsActive");
76 RegisterNetSyncVariableBool("m_IsInProgress");
77 RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
78 RegisterNetSyncVariableBool("m_IsDeploySound");
79 }
80
81 void ~TrapBase()
82 {
84 }
85
86 void OnUpdate(EntityAI victim);
87
90 {
91 super.OnVariablesSynchronized();
92
93 if ( IsDeploySound() )
94 {
96 }
97
99 {
101 }
102
104 {
106 }
107
108 if ( GetGame().IsMultiplayer() )
109 {
110 if (m_IsActive)
111 {
112 SetActive();
113 }
114
116 {
117 StartActivate(null);
118 }
119 }
120 }
121
122 override void EEDelete(EntityAI parent)
123 {
124 super.EEDelete(parent);
125
126 //GetGame() can be sometimes NULL when turning off server
127 if ( GetGame() && m_TrapTrigger )
128 {
130 m_TrapTrigger = NULL;
131 }
132 }
133
135 {
136 super.OnStoreSave(ctx);
137
138 ctx.Write(m_IsActive);
139
141 }
142
143 //----------------------------------------------------------------
144 override bool OnStoreLoad(ParamsReadContext ctx, int version)
145 {
146 if ( !super.OnStoreLoad(ctx, version) )
147 return false;
148
149 bool b_is_active = false;
150 if ( !ctx.Read( b_is_active ) )
151 b_is_active = false;
152
153 bool b_is_in_progress = false;
154 if ( !ctx.Read( b_is_in_progress ) )
155 b_is_in_progress = false;
156
157 if ( b_is_active )
158 {
159 SetActive();
160 }
161
162 if (b_is_in_progress && !b_is_active)
163 {
164 StartActivate(null);
165 }
166
167 return true;
168 }
169
170 bool IsActive()
171 {
172 return m_IsActive && m_IsInProgress == false && GetHierarchyRootPlayer() == null;
173 }
174
176 {
177 return !IsActive() && m_IsInProgress == false && GetHierarchyRootPlayer() == null;
178 }
179
180 // trap cannot be taken when is activated
181 override bool IsTakeable()
182 {
183 if ( m_IsInProgress == false && !IsActive() )
184 {
185 return true;
186 }
187
188 return false;
189 }
190
192 {
193 return !IsActive() && GetHierarchyRootPlayer() == null && GetHierarchyParent() == null && m_IsInProgress == false && !IsRuined() && m_NeedActivation;
194 }
195
197 {
198 if ( GetHierarchyRootPlayer() != null && GetHierarchyRootPlayer().GetHumanInventory().GetEntityInHands() == this )
199 {
200 PlayerBase player = PlayerBase.Cast( GetHierarchyRootPlayer() );
201
202 vector player_pos = player.GetPosition();
203 vector aim_pos = player.GetAimPosition();
204
205 if ( vector.DistanceSq( player_pos, aim_pos ) <= ( Math.SqrFloat( 1.5 ) ) )
206 {
207 return IsPlaceableAtPosition( aim_pos );
208 }
209 }
210
211 return false;
212 }
213
215 {
216 if ( GetGame().SurfaceIsSea( position[0], position[2] ) )
217 {
218 return false;
219 }
220 else if ( GetGame().SurfaceIsPond( position[0], position[2] ) )
221 {
222 return false;
223 }
224
225 return true;
226 }
227
228 void Disarm()
229 {
230 SetInactive(false);
231 RefreshState();
232 GetGame().RPCSingleParam(this, ERPCs.RPC_TRAP_DISARM, null, true);
233
234 OnDisarm();
235 }
236
238 void OnDisarm();
239
241 {
242 if ( GetGame().IsServer() )
243 {
244 if ( m_Timer )
245 {
246 m_Timer.Stop();
247 }
248
249 RefreshState();
250
251 if (m_DamagePlayers > 0)
252 {
253 if (victim)
254 {
255 if ( victim.IsInherited(SurvivorBase))
256 {
257 victim.DecreaseHealth("", "", m_DamagePlayers);
258 }
259 else if (victim.IsInherited(DayZCreatureAI))
260 {
261 victim.DecreaseHealth("", "", m_DamageOthers);
262 }
263 else if (victim.IsInherited(ItemBase))
264 {
265 ItemBase victim_item = ItemBase.Cast(victim);
266 float damage_coef = 1;
267
268 if (victim_item.HasQuantity() && victim_item.GetQuantityMax() != 0 && victim_item.GetQuantity() > 0)
269 {
270 damage_coef = victim_item.GetQuantityMax() / victim_item.GetQuantity(); // Lower quantity increases damage exposure
271 }
272
273 if (damage_coef > 0)
274 {
275 int item_size_x = 1;
276 int item_size_y = 1;
277 GetGame().GetInventoryItemSize(victim_item, item_size_x, item_size_y);
278
279 float add_damage = 300 * damage_coef / Math.Clamp(item_size_x * item_size_y, 1, int.MAX);
280 victim_item.DecreaseHealth("", "", add_damage);
281 }
282 }
283 }
284 }
285
286 Synch(victim);
287 }
288
289 OnSteppedOn(victim);
290 }
291
293 {
294 OnSteppedOut(victim);
295 Synch(null);
296 }
297
299 {
300 SetInactive(false);
301 }
302
303 void OnSteppedOut(EntityAI victim);
304
305 // Synchronizes states
306 protected void Synch(EntityAI victim)
307 {
308 if (GetGame().IsServer())
309 {
310 SetSynchDirty();
311
312 if (victim && !victim.GetAllowDamage())
313 {
314 return;
315 }
316
317 Param1<EntityAI> p = new Param1<EntityAI>(victim);
318 GetGame().RPCSingleParam(this, ERPCs.RPC_TRAP_VICTIM, p, true);
319 }
320
321 }
322
323 // On server -> client synchronization
324 override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
325 {
326 super.OnRPC(sender, rpc_type, ctx);
327
328 if ( !GetGame().IsDedicatedServer() )
329 {
330 switch (rpc_type)
331 {
332 case ERPCs.RPC_TRAP_VICTIM:
333
334 ref Param1<EntityAI> p_victim = new Param1<EntityAI>(NULL);
335
336 if (ctx.Read(p_victim))
337 {
338 if (p_victim.param1)
339 {
340 SnapOnObject(p_victim.param1);
341 }
342 }
343
344 break;
345
346 case ERPCs.RPC_TRAP_DISARM:
347 OnDisarm();
348 break;
349
350 case SoundTypeTrap.ACTIVATING:
351
352 ref Param1<bool> p = new Param1<bool>(false);
353
354 if (ctx.Read(p))
355 {
356 bool play = p.param1;
357 }
358
359 if ( play )
360 {
362 }
363
364 if ( !play )
365 {
367 }
368
369 break;
370 }
371 }
372 }
373
375 {
377 {
378 return;
379 }
380
381 if ( GetGame().IsServer() )
382 {
383 // item is owned by player
384 if ( GetHierarchyRootPlayer() != NULL && m_AnimationPhaseGrounded != "" )
385 {
386 SetAnimationPhase( m_AnimationPhaseSet, 1 );
388 {
389 SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
390 }
391 SetAnimationPhase( m_AnimationPhaseGrounded, 0 );
392 }
393 // item is set active
394 else if ( IsActive() )
395 {
396 if ( m_AnimationPhaseGrounded != "" )
397 {
398 SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
399 }
401 {
402 SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
403 SetAnimationPhase( m_AnimationPhaseSet, 0 );
404 }
405 }
406 // item is inactive and not owned by player (on the ground)
407 else if ( IsInactive() )
408 {
410 {
411 SetAnimationPhase( m_AnimationPhaseGrounded, 1 );
412 }
414 {
415 SetAnimationPhase( m_AnimationPhaseSet, 1 );
416 SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
417 }
418 }
419 }
420 }
421
423 {
424 if ( GetGame().IsServer() )
425 {
426 if ( GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity( this ) ) // kvoli desyncu
427 {
428 SetupTrapPlayer( PlayerBase.Cast( GetHierarchyRootPlayer() ) );
429 }
430 }
431 }
432
433 void SetupTrapPlayer( PlayerBase player, bool set_position = true )
434 {
435 if ( GetGame().IsServer() )
436 {
437 if ( set_position )
438 {
439 Error("Mojmir: TODO");
440 player.LocalDropEntity( this );
441
442 vector trapPos = ( player.GetDirection() ) * 1.5;
443 trapPos[1] = 0;
444 SetPosition( player.GetPosition() + trapPos );
445 }
446
447 if ( m_NeedActivation == false )
448 {
449 SetActive();
450 }
451 //player.MessageStatus( m_InfoSetup );
452 }
453 }
454
456 {
457 if ( GetGame().IsServer() )
458 {
459 DecreaseHealth( "", "", m_DefectRate );
460 }
461 }
462
464 {
466
467 m_IsInProgress = false;
468 m_IsActive = true;
469
471 {
472 AddDefect();
473 }
474
475 if (GetGame().IsServer())
476 {
478 RefreshState();
479 Synch(null);
480 }
481
482 OnActivate();
483 }
484
485 void OnActivate();
486
488 {
489 if ( GetGame().IsServer() )
490 {
492 HideSelection("safety_pin");
493
494 if ( m_InitWaitTime > 0 )
495 {
496 m_IsInProgress = true;
497 m_Timer.Run( m_InitWaitTime, this, "SetActive" );
498
499 Synch(null);
500 }
501 else
502 {
503 SetActive();
504 }
505 }
506 }
507
508 void StartDeactivate(PlayerBase player);
509
510 void SetInactive(bool stop_timer = true)
511 {
513
514 m_IsActive = false;
515 if (m_Timer && stop_timer)
516 {
517 m_Timer.Stop();
518 }
519
521 {
522 AddDefect();
523 }
524
526 RefreshState();
527 Synch(null);
528 }
529
531 {
532 if (Class.CastTo(m_TrapTrigger, GetGame().CreateObjectEx("TrapTrigger", GetPosition(), SPAWN_FLAGS)))
533 {
534 vector mins = "-0.01 -0.05 -0.01";
535 vector maxs = "0.01 0.5 0.01";
536 m_TrapTrigger.SetOrientation(GetOrientation());
537 m_TrapTrigger.SetExtents(mins, maxs);
539 }
540 }
541
543 {
545 m_TrapTrigger = null;
546 }
547
548 override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
549 {
550 super.OnItemLocationChanged(old_owner, new_owner);
551
552 if (GetGame().IsServer())
553 {
554 RefreshState();
555
556 // TAKE ACTIVE TRAP FROM VICINITY
557 if (old_owner == NULL && new_owner != NULL && IsActive())
558 {
559 // TAKE INTO HANDS
560 if ( new_owner.IsPlayer() )
561 {
562 SnapOnObject(new_owner);
563 }
564 else if (new_owner.GetHierarchyRootPlayer())
565 {
566 SnapOnObject(new_owner.GetHierarchyRootPlayer());
567 }
568 }
569 }
570
571 }
572
573 override void EEItemAttached(EntityAI item, string slot_name)
574 {
575 super.EEItemAttached(item, slot_name);
576
577 if ( GetGame().IsServer() )
578 {
579 RefreshState();
580 }
581 }
582
583 override void EEItemDetached(EntityAI item, string slot_name)
584 {
585 super.EEItemDetached(item, slot_name);
586
587 if ( GetGame().IsServer() )
588 {
589 RefreshState();
590 }
591 }
592
593 override bool CanPutInCargo( EntityAI parent )
594 {
595 if ( !super.CanPutInCargo(parent) )
596 {
597 return false;
598 }
599
600 return IsTakeable();
601 }
602
603 override bool CanPutIntoHands( EntityAI parent )
604 {
605 if ( !super.CanPutIntoHands( parent ) )
606 {
607 return false;
608 }
609
610 return IsTakeable();
611 }
612
613 override bool CanRemoveFromHands( EntityAI parent )
614 {
615 return IsTakeable();
616 }
617
618 override bool CanBePlaced( Man player, vector position )
619 {
620 return IsPlaceableAtPosition( position );
621 }
622
625 {
626 return true;
627 }
628
629 //Set if trap can be disarmed using trap-specific action
631 {
632 return false;
633 }
634
636 void SetDisarmed( bool disarmed )
637 {
638 m_Disarmed = disarmed;
639 }
640
643 {
644 return m_Disarmed;
645 }
646
647 //================================================================
648 // ADVANCED PLACEMENT
649 //================================================================
650
652 {
653 #ifndef SERVER
655 {
657 }
658 #endif
659 }
660
662 {
663 #ifndef SERVER
665 {
668 }
669 #endif
670 }
671
672 override void SetActions()
673 {
674 super.SetActions();
675
677 }
678
679 // HELPERS
681 {
683 vector trapPosXZ = GetPosition();
684 trapPosXZ[1] = 0;
685
686 GameInventory inv = victim.GetInventory();
687 for (int i = 0; i < inv.AttachmentCount(); i++)
688 {
690 EntityAI wheelEntity = inv.GetAttachmentFromIndex(i);
691 if (wheelEntity && wheelEntity.Type() == CarWheel_Ruined)
692 {
693 continue;
694 }
695
697 int slotId;
698 string slotName;
699 wheelEntity.GetInventory().GetCurrentAttachmentSlotInfo(slotId, slotName);
700 slotName.ToLower();
701 if (slotName.Contains("spare"))
702 {
703 continue
704 }
705
707 if (wheelEntity && wheelEntity.IsInherited(CarWheel))
708 {
709 vector entPosXZ = wheelEntity.GetPosition();
710 entPosXZ[1] = 0;
711 if (vector.Distance(trapPosXZ, entPosXZ) < 1)
712 {
713 return wheelEntity;
714 }
715 }
716 }
717
718 return null;
719 }
720
721 protected void DamageClothing(PlayerBase player)
722 {
723 //Array used to find all relevant information about currently equipped clothes
724 array<ClothingBase> equippedClothes = new array<ClothingBase>;
725
726 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("LEGS")));
727 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BACK")));
728 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("VEST")));
729 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("HeadGear")));
730 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("Mask")));
731 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("BODY")));
732 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("FEET")));
733 equippedClothes.Insert(ClothingBase.Cast(player.GetItemOnSlot("GLOVES")));
734
735 //Damage all currently equipped clothes
736 for (int i = 0; i < equippedClothes.Count(); i++)
737 {
738 //If no item is equipped on slot, slot is ignored
739 if (equippedClothes[i] == null)
740 {
741 continue;
742 }
743
744 equippedClothes[i].DecreaseHealth(m_ClothingDmg[i], false);
745 }
746 }
747}
void AddAction(typename actionName)
vector GetOrientation()
override void EEItemDetached(EntityAI item, string slot_name)
override bool CanPutIntoHands(EntityAI parent)
override void EEItemAttached(EntityAI item, string slot_name)
const int ECE_LOCAL
const int ECE_CREATEPHYSICS
protected void Disarm()
Definition ClockBase.c:198
ref Timer m_Timer
Definition DayZGame.c:687
ERPCs
Definition ERPCs.c:2
const int MAX
Definition EnConvert.c:27
override void EEDelete(EntityAI parent)
override bool IsTakeable()
void PlayDeploySound()
Definition ItemBase.c:8920
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition ItemBase.c:5779
bool IsDeploySound()
Definition ItemBase.c:8915
bool CanPlayDeployLoopSound()
Definition ItemBase.c:8947
override void OnVariablesSynchronized()
bool m_IsActive
bool IsActive()
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
protected ref Timer m_UpdateTimer
Definition RadialMenu.c:20
override bool CanPutInCargo(EntityAI parent)
void OnRPC(float stamina, float stamina_cap, bool cooldown)
deprecated use, StaminaHandler uses SyncJunctures now
string m_AnimationPhaseTriggered
Definition TrapBase.c:34
protected ref EffectSound m_DeployLoopSound
Definition TrapBase.c:47
float m_DefectRate
Definition TrapBase.c:19
protected const float UPDATE_TIMER_INTERVAL
Definition TrapBase.c:15
string m_InfoDamageManipulation
Definition TrapBase.c:38
bool m_WasActivatedOrDeactivated
DEPRECATED Used for explosive traps to prevent detonation after destroying through disarm action.
Definition TrapBase.c:30
bool IsActivable()
Definition TrapBase.c:191
enum SoundTypeTrap SPAWN_FLAGS
void PlayDeployLoopSound()
Definition TrapBase.c:651
void StopDeployLoopSound()
Definition TrapBase.c:661
string m_AnimationPhaseGrounded
Definition TrapBase.c:32
override bool CanBePlaced(Man player, vector position)
Definition TrapBase.c:618
void AddDefect()
Definition TrapBase.c:455
void RefreshState()
Definition TrapBase.c:374
void RemoveFromObject(EntityAI victim)
Definition TrapBase.c:292
protected void Synch(EntityAI victim)
keeping "step" here for consistency only
Definition TrapBase.c:306
void SetActive()
Definition TrapBase.c:463
bool m_NeedActivation
Definition TrapBase.c:18
protected void DamageClothing(PlayerBase player)
Definition TrapBase.c:721
void SetupTrap()
Definition TrapBase.c:422
protected EntityAI GetClosestCarWheel(EntityAI victim)
Definition TrapBase.c:680
string m_InfoActivationTime
Definition TrapBase.c:40
string m_AnimationPhaseSet
Definition TrapBase.c:33
bool IsInactive()
Definition TrapBase.c:175
void SnapOnObject(EntityAI victim)
Definition TrapBase.c:240
string m_InfoSetup
Definition TrapBase.c:36
void SetInactive(bool stop_timer=true)
Definition TrapBase.c:510
bool IsPlaceable()
Definition TrapBase.c:196
protected ref array< int > m_ClothingDmg
Definition TrapBase.c:46
SoundTypeTrap
Definition TrapBase.c:2
@ ACTIVATING
Definition TrapBase.c:3
bool CanBeClapped()
DEPRECATED Set if trap can be disarmed using ActionClapBearTrapWithThisItem.
Definition TrapBase.c:624
int m_InitWaitTime
Definition TrapBase.c:17
protected const int DAMAGE_TRIGGER_MINE
Definition TrapBase.c:14
string m_InfoDeactivated
Definition TrapBase.c:37
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Definition TrapBase.c:433
void SetDisarmed(bool disarmed)
DEPRECATED.
Definition TrapBase.c:636
bool GetDisarmed()
DEPRECATED.
Definition TrapBase.c:642
float m_DamagePlayers
Definition TrapBase.c:20
bool IsPlaceableAtPosition(vector position)
Definition TrapBase.c:214
void StartActivate(PlayerBase player)
Definition TrapBase.c:487
string m_InfoDamage
Definition TrapBase.c:39
bool m_AddActivationDefect
Definition TrapBase.c:23
void DeleteTrigger()
Definition TrapBase.c:542
protected bool m_IsInProgress
Definition TrapBase.c:26
void ~TrapBase()
Definition TrapBase.c:81
bool m_AddDeactivationDefect
Definition TrapBase.c:24
protected bool m_Disarmed
Definition TrapBase.c:28
float m_DamageOthers
Definition TrapBase.c:21
override bool CanRemoveFromHands(EntityAI parent)
Definition TrapBase.c:613
void StartDeactivate(PlayerBase player)
protected TrapTrigger m_TrapTrigger
Definition TrapBase.c:44
class JsonUndergroundAreaTriggerData GetPosition
proto native void ObjectDelete(Object obj)
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:882
Super root of all classes in Enforce script.
Definition EnScript.c:11
do not process rotations !
Definition DayZAnimal.c:437
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
void SoundStop()
Stops sound.
script counterpart to engine's class Inventory
Definition Inventory.c:77
proto native EntityAI GetAttachmentFromIndex(int index)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
Definition EnMath.c:7
The class that will be instanced (moddable)
Definition gameplay.c:378
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto bool Write(void value_out)
proto bool Read(void value_in)
override void Stop()
override void OnDisarm()
Definition Trap_Bear.c:216
override void OnSteppedOut(EntityAI victim)
Definition Trap_Bear.c:125
override bool CanBeDisarmed()
Definition Trap_Bear.c:25
override string GetLoopDeploySoundset()
Definition Trap_Bear.c:246
override void OnSteppedOn(EntityAI victim)
Definition Trap_Bear.c:67
override void OnActivate()
Definition Trap_Bear.c:209
override void SetActions()
Definition Trap_Bear.c:251
override void CreateTrigger()
Definition Trap_Bear.c:43
Trigger used by traps.
Definition TrapTrigger.c:3
void SetParentObject(TrapBase obj)
Definition TrapTrigger.c:10
void SetExtents(vector mins, vector maxs)
Set the size of the Trigger, avoid using SetCollisionBox directly.
Definition Trigger.c:116
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition Effect.c:427
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float SqrFloat(float f)
Returns squared value.
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
proto native void OnUpdate()
Definition tools.c:338