/
ham_const.inc
4354 lines (3807 loc) · 130 KB
/
ham_const.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Ham Sandwich Constants
//
#if defined _ham_const_included
#endinput
#endif
#define _ham_const_included
/**
* Ham return types.
*
* @note Return these from hooks to disable calling the target function.
* Numbers match up with fakemeta's FMRES_* for clarity. They are
* interchangable. 0 (or no return) is also interpretted as HAM_IGNORED.
*/
#define HAM_IGNORED 1 /**< Calls target function, returns normal value */
#define HAM_HANDLED 2 /**< Tells the module you did something, still calls target function and returns normal value */
#define HAM_OVERRIDE 3 /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */
#define HAM_SUPERCEDE 4 /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */
/**
* List of virtual functions made available through the hamsandwich module.
*
* @note Not all functions will do as you expect on all mods. If a function does
* not do what you would believe it should DO NOT file a bug report, you
* will be ignored.
* @note Passing invalid parameters has potential to crash the server, so be
* careful, and test carefully and adequately!
* @note All functions take (and pass) a "this" index as the first param.
* This is the entity from which the function is being executed on.
* @note All functions and forwards (eg: {Register,Execute}Ham[B]) require
* the mod to have the pev and base keys in addition to the function
* keys for the corresponding mod/operating system in gamedata
* @note Some functions that return booleans may need to be logically ANDed
* to get the desired results because the mod will return the full integer
* value. E.g.: (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF) != 0
*/
enum Ham
{
/**
* Description: This is typically called whenever an entity is created.
* It is the virtual equivilent of spawn from the engine.
* Some mods call this on player spawns too.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Spawn, this);
*/
Ham_Spawn = 0,
/**
* Description: This is typically called on map change.
* This will typically precache all assets required by the entity.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Precache, this);
*/
Ham_Precache,
/**
* Description: Typically this is similar to an engine keyvalue call.
* Use the kvd natives from fakemeta to handle the kvd_handle passed.
* NOTE: Do not pass handle 0 to this! Use create_kvd() from fakemeta instead!
* Forward params: function(this, kvd_handle);
* Return type: None.
* Execute params: ExecuteHam(Ham_Keyvalue, this, kvd_handle);
*/
Ham_Keyvalue,
/**
* Description: Returns flags for how an entity can be used.
* Forward params: function(this)
* Return type: Integer (FCAP_* constants, see hlsdk_const.inc).
* Execute params: ExecuteHam(Ham_ObjectCaps, this);
*/
Ham_ObjectCaps,
/**
* Description: Usually called to activate some objects.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Activate, this);
*/
Ham_Activate,
/**
* Description: Usually called after the engine call with the same name.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_SetObjectCollisionBox, this);
*/
Ham_SetObjectCollisionBox,
/**
* Description: Returns an integer number that corresponds with what type of entity this is.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_Classify, this);
*/
Ham_Classify,
/**
* Description: Typically called when an entity dies to notify any children entities about the death.
* Forward params: function(this, idchild)
* Return type: None.
* Execute params: ExecuteHam(Ham_DeathNotice, this, idchild)
*/
Ham_DeathNotice,
/**
* Description: Usually called whenever an entity gets attacked by a hitscan (such as a gun) weapon.
* Use the get/set tr2 natives in fakemeta to handle the traceresult data.
* Do not use a handle of 0 as a traceresult in execution, use create_tr2() from Fakemeta
* to pass a custom handle instead. (Don't forget to free the handle when you're done.)
* Forward params: function(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits)
* Return type: None.
* Execute params: ExecuteHam(Ham_TraceAttack, this, idattacker, Float:damage, Float:direction[3], tracehandle, damagebits);
*/
Ham_TraceAttack,
/**
* Description: Usually called whenever an entity takes any kind of damage.
* Inflictor is the entity that caused the damage (such as a gun).
* Attacker is the entity that tirggered the damage (such as the gun's owner).
* Forward params: function(this, idinflictor, idattacker, Float:damage, damagebits);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);
*/
Ham_TakeDamage,
/**
* Description: Usually called whenever an entity gets a form of a heal.
* Forward params: function(this, Float:health, damagebits);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_TakeHealth, this, Float:health, damagebits);
*/
Ham_TakeHealth,
/**
* Description: Normally called whenever an entity dies.
* For Team Fortress Classic mod, see Ham_TFC_Killed.
* Forward params: function(this, idattacker, shouldgib)
* Return type: None.
* Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib);
*/
Ham_Killed,
/**
* Description: Normally returns the blood color of the entity.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_BloodColor, this)
*/
Ham_BloodColor,
/**
* Description: Traces where blood should appear.
* Forward params: function(this, Float:Damage, Float:Direction[3], trace_handle, damagebits);
* Return type: None.
* Execute params: ExecuteHam(Ham_TraceBleed, this, Float:damage, Float:direction[3], trace_handle, damagebits);
*/
Ham_TraceBleed,
/**
* Description: Returns whether an entity is activated.
* This function is not supported by Day Of Defeat.
* This function has different version for the following mods:
* Team Fortress Classic, see Ham_TFC_IsTriggered instead.
* Sven-Coop 5.0+, see Ham_SC_IsTriggered instead.
* Forward params: function(this, idActivator);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_IsTriggered, this, idActivator);
*/
Ham_IsTriggered,
/**
* Description: Returns the id of the entity if its class is derived off of CBaseMonster, -1 otherwise.
* Forward params: function(this)
* Return type: Entity.
* Execute params: ExecuteHam(Ham_MyMonsterPointer, this);
*/
Ham_MyMonsterPointer,
/**
* Description: Returns the id of the entity if its class is derived off of CBaseSquadMonster, -1 otherwise.
* Forward params: function(this)
* Return type: Entity.
* Execute params: ExecuteHam(Ham_MySquadMonsterPointer, this);
*/
Ham_MySquadMonsterPointer,
/**
* Description: Returns the toggle state of the entity.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_GetToggleState, this);
*/
Ham_GetToggleState,
/**
* Description: Typically adds points to the entity.
* This function is not supported for the following mods:
* Team Fortress Classic.
* Sven-Coop 5.0-, see Ham_SC_AddPoints instead.
* Forward params: function(this, points, bool:cangonegative);
* Return type: None.
* Execute params: ExecuteHam(Ham_AddPoints, this, points, bool:cangonegative);
*/
Ham_AddPoints,
/**
* Description: Typically adds points to everybody on the entity's team.
* This function is not supported for the following mods:
* Team Fortress Classic.
* Sven-Coop 5.0-, see Ham_SC_AddPointsToTeam instead.
* Forward params: function(this, points, bool:cangonegative);
* Return type: None.
* Execute params: ExecuteHam(Ham_AddPointsToTeam, this, points, bool:cangonegative);
*/
Ham_AddPointsToTeam,
/**
* Description: Adds an item to the player's inventory.
* Forward params: function(this, idother);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_AddPlayerItem, this, idother);
*/
Ham_AddPlayerItem,
/**
* Description: Removes an item to the player's inventory.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_RemovePlayerItem instead.
* Return type: Integer.
* Execute params: ExecuteHam(Ham_RemovePlayerItem, this, idother);
*/
Ham_RemovePlayerItem,
/**
* Description: Gives ammo to the entity.
* This function is not supported for the following mods:
* Earth's Special Forces.
* Sven-Coop 4.8+, see Ham_SC_GiveAmmo instead.
* Team Fortress Classic, see Ham_TFC_GiveAmmo instead.
* Forward params: function(this, Amount, const Name[], Max)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_GiveAmmo, this, amount, "type", max);
*/
Ham_GiveAmmo,
/**
* Description: Unsure, I believe this is the delay between activation for an entity.
* Forward params: function(this)
* Return type: Float.
* Execute params: ExecuteHam(Ham_GetDelay, this, Float:output)
*/
Ham_GetDelay,
/**
* Description: Whether or not the entity is moving.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsMoving instead.
* Forward params: function(this);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_IsMoving, this);
*/
Ham_IsMoving,
/**
* Description: Unsure.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_OverrideReset, this)
*/
Ham_OverrideReset,
/**
* Description: Returns the damage decal of the entity for the damage type.
* Forward params: function(this, damagebits)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_DamageDecal, this);
*/
Ham_DamageDecal,
/**
* Description: Sets the toggle state of the entity.
* Forward params: function(this, state)
* Return type: None.
* Execute params: ExecuteHam(Ham_SetToggleState, this, state);
*/
Ham_SetToggleState,
/**
* Description: Not entirely sure what this does.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_StartSneaking, this);
*/
Ham_StartSneaking,
/**
* Description: Not entirely sure what this does.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_StopSneaking, this);
*/
Ham_StopSneaking,
/**
* Description: Not entirely sure.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_OnControls instead.
* Forward params: function(this, idOn)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_OnControls, this, idOn);
*/
Ham_OnControls,
/**
* Description: Whether or not the entity is sneaking.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsSneaking instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsSneaking, this);
*/
Ham_IsSneaking,
/**
* Description: Whether or not the entity is alive.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsAlive instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsAlive, this);
*/
Ham_IsAlive,
/**
* Description: Whether or not the entity uses a BSP model.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsBSPModel instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsBSPModel, this);
*/
Ham_IsBSPModel,
/**
* Description: Whether or not the entity can reflect gauss shots..
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_ReflectGauss instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_ReflectGauss, this);
*/
Ham_ReflectGauss,
/**
* Description: Whether or not the target is the same as the one passed.
* Note the strindex parameter is a string passed that has been allocated by the engine.
* Use fakemeta's EngFunc_SzFromIndex to convert to a normal string, or fakemeta's
* EngFunc_AllocString to create a new string.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_HasTarget instead.
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_HasTarget, this, strindex);
*/
Ham_HasTarget,
/**
* Description: Whether or not the entity is in the world.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsInWorld instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsInWorld, this);
*/
Ham_IsInWorld,
/**
* Description: Whether or not the entity is a player.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsPlayer instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsPlayer, this);
*/
Ham_IsPlayer,
/**
* Description: Whether or not the entity is a net client.
* This function is not supported for the following mods:
* Sven-Coop 5.0+, see Ham_SC_IsNetClient instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_IsNetClient, this);
*/
Ham_IsNetClient,
/**
* Description: Get the entity's team id.
* This function is not supported by Team Fortress Classic mod.
* Forward params: function(this);
* Return type: String (string length returned and string byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_TeamId, this, buffer[], size);
*/
Ham_TeamId,
/**
* Description: Returns the next target of this.
* Forward params: function(this);
* Return type: Entity.
* Execute params: ExecuteHam(Ham_GetNextTarget, this);
*/
Ham_GetNextTarget,
/**
* Description: Called whenever an entity thinks.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Think, this);
*/
Ham_Think,
/**
* Description: Called whenever two entities touch.
* Forward params: function(this, idother);
* Return type: None.
* Execute params: ExecuteHam(Ham_Touch, this, idother);
*/
Ham_Touch,
/**
* Description: Called whenver one entity uses another.
* Forward params: function(this, idcaller, idactivator, use_type, Float:value)
* Return type: None.
* Execute params: ExecuteHam(Ham_Use, this, idcaller, idactivator, use_type, Float:value);
*/
Ham_Use,
/**
* Description: Normally called whenever one entity blocks another from moving.
* Forward params: function(this, idother);
* Return type: None.
* Execute params: ExecuteHam(Ham_Blocked, this, idother);
*/
Ham_Blocked,
/**
* Description: Normally called when a map-based item respawns, such as a health kit or something.
* Forward params: function(this);
* Return type: Entity.
* Execute params: ExecuteHam(Ham_Respawn, this);
*/
Ham_Respawn,
/**
* Description: Used in Half-Life to update a monster's owner.
* Forward params: function(this);
* Return type: None.
* Execute params: ExecuteHam(Ham_UpdateOwner, this);
*/
Ham_UpdateOwner,
/**
* Description: Normally called whenever a barnacle grabs the entity.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_FBecomeProne instead.
* Forward params: function(this);
* Return type: Integer.
* Execute params: ExecuteHam(Ham_FBecomeProne, this);
*/
Ham_FBecomeProne,
/**
* Description: Returns the center of the entity.
* Forward params: function(this);
* Return type: Vector (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_Center, this, Float:output[3]);
*/
Ham_Center,
/**
* Description: Returns the eye position of the entity.
* Forward params: function(this);
* Return type: Vector (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_EyePosition, this, Float:output[3]);
*/
Ham_EyePosition,
/**
* Description: Returns the ear position of the entity.
* Forward params: function(this);
* Return type: Vector (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_EarPosition, this, Float:output[3]);
*/
Ham_EarPosition,
/**
* Description: Position to shoot at.
* Forward params: function(this, Float:srcvector[3]);
* Return type: Vector (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_BodyTarget, Float:srcvector[3], Float:returnvector[3])
*/
Ham_BodyTarget,
/**
* Description: Returns the illumination of the entity.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_Illumination, this);
*/
Ham_Illumination,
/**
* Description: Returns true if a line can be traced from the caller's eyes to the target.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_FVisible instead.
* Forward params: function(this, idOther);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_FVisible, this, idOther);
*/
Ham_FVisible,
/**
* Description: Returns true if a line can be traced from the caller's eyes to given vector.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_FVecVisible instead.
* Forward params: function(this, const Float:origin[3]);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_FVecVisible, this, const Float:origin[3]);
*/
Ham_FVecVisible,
/**
* Players have all the attributes of normal entities, in addition to these.
*/
/**
* Description: Typically called every frame when a player has jump held.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_Jump, this);
*/
Ham_Player_Jump,
/**
* Description: Typically called every frame when a player has duck held.
* This function is not supported in Earth's Special Forces mod.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_Duck, this);
*/
Ham_Player_Duck,
/**
* Description: Typically called every frame during PlayerPreThink engine call.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_PreThink, this);
*/
Ham_Player_PreThink,
/**
* Description: Typically called every frame during PlayerPostThink engine call.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_PostThink, this);
*/
Ham_Player_PostThink,
/**
* Description: Returns a vector that tells the gun position.
* This function is not supported by Team Fortress Classic.
* Forward params: function(this)
* Return type: Vector (byreffed in ExecuteHam);.
* Execute params: ExecuteHam(Ham_Player_GetGunPosition, this, Float:output[3]);
*/
Ham_Player_GetGunPosition,
/**
* Description: Whether or not the player should fade on death.
* Forward param: function(this)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Player_ShouldFadeOnDeath, this);
*/
Ham_Player_ShouldFadeOnDeath,
/**
* Description: Called whenever an impulse command is executed.
* Forward param: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_ImpulseComands, this);
*/
Ham_Player_ImpulseCommands,
/**
* Description: Updates the client's data for hud changes (such as ammo). Usually called every frame.
* This function is not supported by Team Fortress Classic mod.
* Forward param: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Player_UpdateClientData, this);
*/
Ham_Player_UpdateClientData,
/**
* Items have all the attributes of normal entities in addition to these.
*/
/**
* Description: Adds the item to the player.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_AddToPlayer instead.
* Forward params: function(this, idPlayer);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_AddToPlayer, this, idPlayer);
*/
Ham_Item_AddToPlayer,
/**
* Description: Unsure.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_AddDuplicate instead.
* Forward params: function(this, idOriginal);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_AddDuplicate, this, idOriginal);
*/
Ham_Item_AddDuplicate,
/**
* Description: Whether or not this entity can be deployed.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_CanDeploy instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_CanDeploy, this);
*/
Ham_Item_CanDeploy,
/**
* Description: Deploys the entity (usually a weapon).
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_Deploy instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_Deploy, this);
*/
Ham_Item_Deploy,
/**
* Description: Whether or not the entity can be holstered.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_CanHolster instead.
* Forward params: function(this);
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_CanHolster, this);
*/
Ham_Item_CanHolster,
/**
* Description: Whether or not the entity (usually weapon) can be holstered.
* Forward params: function(this)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Item_Holster, this);
*/
Ham_Item_Holster,
/**
* Description: Updates the HUD info about this item.
* Forward params: function(this);
* Return type: None.
* Execute params: ExecuteHam(Ham_UpdateItemInfo, this);
*/
Ham_Item_UpdateItemInfo,
/**
* Description: Called each frame for an item, normally only on active items.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Item_PreFrame, this);
*/
Ham_Item_PreFrame,
/**
* Description: Called each frame for an item, normally only on active items.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Item_PostFrame, this);
*/
Ham_Item_PostFrame,
/**
* Description: Called when an item gets dropped, normally on death only.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Item_Drop, this);
*/
Ham_Item_Drop,
/**
* Description: Normally called when an item gets deleted.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Item_Kill, this);
*/
Ham_Item_Kill,
/**
* Description: Called when an entity starts being attached to (normally invisible and "following") a player.
* Forward params: function(this, idPlayer)
* Return type: None.
* Execute params: ExecuteHam(Ham_Item_AttachToPlayer, this, idPlayer)
*/
Ham_Item_AttachToPlayer,
/**
* Description: Returns the ammo index of the item.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_Item_PrimaryAmmoIndex, this);
*/
Ham_Item_PrimaryAmmoIndex,
/**
* Description: Returns the secondary ammo index of the item.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_Item_SecondaryAmmoIndex, this);
*/
Ham_Item_SecondaryAmmoIndex,
/**
* Description: Updates item data for the client.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Item_UpdateClientData instead.
* Forward params: function(this, idPlayer)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_Item_UpdateClientData, this, idPlayer);
*/
Ham_Item_UpdateClientData,
/**
* Description: Returns the entity index if the item is a weapon, -1 otherwise.
* Forward params: function(this)
* Return type: Entity.
* Execute Params: ExecuteHam(Ham_Item_GetWeaponPtr, this)
*/
Ham_Item_GetWeaponPtr,
/**
* Description: Returns the item slot for the item.
* Forward params: function(this)
* Return type: Integer.
* Execute Params: ExecuteHam(Ham_Item_ItemSlot, this)
*/
Ham_Item_ItemSlot,
/**
* Weapons have all the attributes to Ham_Item_*, in addition to these.
*/
/**
* Description: Gets ammo from the target weapon.
* This function is not supported in Earth's Special Forces mod.
* Forward params: function(this, idTarget)
* Return type: Integer.
* Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget)
*/
Ham_Weapon_ExtractAmmo,
/**
* Description: Gets clip ammo from the target weapon.
* This function is not supported in Earth's Special Forces mod.
* Forward params: function(this, idTarget)
* Return type: Integer.
* Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget)
*/
Ham_Weapon_ExtractClipAmmo,
/**
* Description: Unsure.
* This function is not supported in Earth's Special Forces mod.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Weapon_AddWeapon instead.
* Forward params: function(this)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Weapon_AddWeapon, this);
*/
Ham_Weapon_AddWeapon,
/**
* Description: Plays the weapon's empty sound.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Weapon_PlayEmptySound instead.
* Forward params: function(this)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Weapon_PlayEmptySound, this);
*/
Ham_Weapon_PlayEmptySound,
/**
* Description: Sets the weapon so that it can play empty sound again.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_ResetEmptySound, this);
*/
Ham_Weapon_ResetEmptySound,
/**
* Description: Sends an animation event for the weapon.
* This function has different versions for the following mods:
* Counter-Strike: see Ham_CS_Weapon_SendWeaponAnim.
* Team Fortress Classic: see Ham_TFC_Weapon_SendWeaponAnim.
* Day Of Defeat: see Ham_DOD_Weapon_SendWeaponAnim.
* Forward params: function(this, iAnim, skiplocal, body);
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_SendWeaponAnim, this, iAnim, skiplocal, body);
*/
Ham_Weapon_SendWeaponAnim,
/**
* Description: Whether or not the weapon is usable (has ammo, etc.)
* This function is not supported in Earth's Special Forces mod.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Weapon_IsUsable instead.
* Forward params: function(this)
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Weapon_IsUsable, this)
*/
Ham_Weapon_IsUsable,
/**
* Description: Called when the main attack of a weapon is triggered.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_PrimaryAttack, this);
*/
Ham_Weapon_PrimaryAttack,
/**
* Description: Called when the secondary attack of a weapon is triggered.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_SecondaryAttack, this);
*/
Ham_Weapon_SecondaryAttack,
/**
* Description: Called when the weapon is reloaded.
* This function is not supported in Earth's Special Forces mod.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_Reload, this);
*/
Ham_Weapon_Reload,
/**
* Description: Displays the idle animation for the weapon.
* Forward params: function(this)
* Return type: None.
* Execute params: ExecuteHam(Ham_Weapon_WeaponIdle, this);
*/
Ham_Weapon_WeaponIdle,
/**
* Description: There is no more ammo for this gun, so switch to the next best one.
* Forward params: function(this)
* Return type: None.
* ExecuteParams: ExecuteHam(Ham_Weapon_RetireWeapon, this)
*/
Ham_Weapon_RetireWeapon,
/**
* Description: Whether or not the weapon should idle.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Weapon_ShouldWeaponIdle instead.
* Forward params: function(this)
* Return type: Integer (boolean).
* Execute Params: ExecuteHam(Ham_Weapon_ShouldWeaponIdle, this)
*/
Ham_Weapon_ShouldWeaponIdle,
/**
* Description: Unsure.
* This function is not supported by Team Fortress Classic.
* This function has different version for the following mods:
* Sven-Coop 5.0+, see Ham_SC_Weapon_UseDecrement instead.
* Return type: Integer (boolean).
* Execute params: ExecuteHam(Ham_Weapon_UseDecrement, this);
*/
Ham_Weapon_UseDecrement,
/**
* The following functions are specific to The Specialists.
*/
/**
* Description: -
* Forward params: function(this, someboolvalue)
* Return type: None.
* Execute params: ExecuteHam(Ham_TS_BreakableRespawn, this, someboolvalue);
*/
Ham_TS_BreakableRespawn,
/**
* Description: -
* Forward params: function(this)
* Return type: Integer (boolean)
* Execute params: ExecuteHam(Ham_TS_CanUsedThroughWalls, this);
*/
Ham_TS_CanUsedThroughWalls,
/**
* Description: Unsure - this was removed in TS 3.0 (and thus is deprecated).
* Forward params: function(this)
* Return type: Integer (I think...)
* Execute params: ExecuteHam(Ham_TS_RespawnWait, this);
*/
Ham_TS_RespawnWait,
/**
* The following functions are specific to Counter-Strike.
*/
/**
* Description: This is called on a map reset for most map based entities.
* Forward params: function(this);
* Return type: None.
* Execute params: ExecuteHam(Ham_CS_Restart, this);
*/
Ham_CS_Restart,
/**
* Description: Respawn function for players/bots only! Do not use this on non player/bot entities!
* Forward params: function(this);
* Return type: None.
* Execute params: ExecuteHam(Ham_CS_RoundRespawn, this);
*/
Ham_CS_RoundRespawn,
/**
* Description: Whether or not the player can drop the specified item.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_CS_Item_CanDrop, this);
*/
Ham_CS_Item_CanDrop,
/**
* Description: Gets the maximum speed for whenever a player has the item deployed.
* Forward params: function(this);
* Return type: Float (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output);
*/
Ham_CS_Item_GetMaxSpeed,
/**
* The following functions are specific to Day Of Defeat.
*/
/**
* Description: I assume this spawns players at the start of a new round.
* Forward params: function(this)
* Return type: None.
* Execute Params: ExecuteHam(Ham_DOD_RoundRespawn, this);
*/
Ham_DOD_RoundRespawn,
/**
* Description: I assume this spawns entities (like func_breakables) at the start of a new round.
* Forward params: function(this)
* Return type: None.
* Execute Params: ExecuteHam(Ham_DOD_RoundRespawnEnt, this);
*/
Ham_DOD_RoundRespawnEnt,
/**
* Description: Unsure.
* Forward params: function(this)
* Return type: None, I think...
* Execute params: ExecuteHam(Ham_DOD_RoundStore, this);
*/
Ham_DOD_RoundStore,