-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathonetap.d.ts
1584 lines (1390 loc) · 58.8 KB
/
onetap.d.ts
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
/**
* @file Declaration file for interacting with the onetap scripting engine.
* @author April <april#0001>
* @author Dank <[email protected]>
*/
/**
* An array of strings that references a path to a menu element.
*/
export declare type Path = Array<string>;
/**
* The index of an entity in the game world.
*/
export declare type EntityID = number;
/**
* The index of a user in an event.
*/
export declare type UserID = number;
/**
* An array containing three number corresponding to the X, Y and Z positions of a 3D point.
* Or, alternatively, an array containing the pitch, yaw and roll of an Euler angle.
*/
export declare type Vector = Array<number>;
/**
* An enum listing each stage in a game "frame".
* @readonly
* @enum {number}
*/
export enum FrameStage {
/** Identifies that frame has started. */
FRAME_START = 0,
/** Identifies that network packet has been received. */
FRAME_NET_UPDATE_START,
/** Identifies that packet's processing has started. */
FRAME_NET_UPDATE_POSTDATAUPDATE_START,
/** Identifies that packet's processing has ended. */
FRAME_NET_UPDATE_POSTDATAUPDATE_END,
/** Identifies that network packet has been processed. */
FRAME_NET_UPDATE_END,
/** Identifies that frame's rendering has started. */
FRAME_RENDER_START,
/** Identifies that frame's rendering has ended. */
FRAME_RENDER_END
}
/**
* An enum listing each hitbox index.
* @readonly
* @enum {number}
*/
export enum HitboxIndex {
HEAD = 0,
NECK,
PELVIS,
BODY,
THORAX,
CHEST,
UPPER_CHEST,
RIGHT_THIGH,
LEFT_CALF,
RIGHT_CALF,
LEFT_FOOT,
RIGHT_FOOT,
LEFT_HAND,
RIGHT_HAND,
LEFT_UPPER_ARM,
LEFT_FOREARM,
RIGHT_UPPER_ARM,
RIGHT_FOREARM,
}
/**
* An enum listing each animation layer index.
* @readonly
* @enum {number}
* @todo Comment enum items.
*/
export enum AnimationLayerIndex {
AIMMATRIX = 0,
WEAPON_ACTION,
WEAPON_ACTION_RECROUCH,
ADJUST,
MOVEMENT_JUMP_OR_FALL,
MOVEMENT_LAND_OR_CLIMB,
MOVEMENT_MOVE,
MOVEMENT_STRAFECHANGE,
WHOLE_BODY,
FLASHED,
FLINCH,
ALIVELOOP,
LEAN
}
export interface AnimationLayer {
Sequence: number;
Activity: number;
Weight: number;
WeightDeltaRange: number;
Cycle: number;
PlaybackRate: number;
}
export interface PredictedGrenadeHit {
/** Entity index that is predicted to be hit. */
EntityIndex: EntityID;
/** Predicted damage the grenade will inflict on the entity. */
Damage: number;
}
export interface PredictedGrenade {
/** Indicates if the grenade is live. */
IsLive: boolean;
/** Entity index of the grenade's owner. */
Owner: EntityID;
/** Indicates the type of grenade (i.e. Molotov). */
Type: string;
/** Entity index of the grenade. */
EntityIndex: EntityID;
/** Predicted end point of the grenade. */
Position: Vector;
/** List of entities predicted to be hit by the grenade. */
Hits: Array<PredictedGrenadeHit>;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/2/| Official Onetap Documentation}
*/
declare namespace Globals {
/**
* @returns The amount of choked ticks.
* @see {@link https://www.onetap.com/resources/180/| Official Onetap Documentation}
*/
function ChokedCommands(): number;
/**
* @returns The time, in seconds, since the game started.
* @see {@link https://www.onetap.com/resources/64/| Official Onetap Documentation}
*/
function Realtime(): number;
/**
* @returns The time, in seconds, between the last and current frame.
* @see {@link https://www.onetap.com/resources/63/| Official Onetap Documentation}
*/
function Frametime(): number;
/**
* @returns The time, in seconds, since the server started.
* @see {@link https://www.onetap.com/resources/12/| Official Onetap Documentation}
*/
function Curtime(): number;
/**
* @returns The interval, in seconds, between each tick.
* @see {@link https://www.onetap.com/resources/11/| Official Onetap Documentation}
*/
function TickInterval(): number;
/**
* @returns The server's amount of ticks/second.
* @see {@link https://www.onetap.com/resources/10/| Official Onetap Documentation}
*/
function Tickrate(): number;
/**
* @returns The time, in ticks, since the server started.
* @see {@link https://www.onetap.com/resources/9/| Official Onetap Documentation}
*/
function Tickcount(): number;
/**
* @returns The current FrameStageNotify stage.
* @see {@link https://www.onetap.com/resources/8/| Official Onetap Documentation}
*/
function FrameStage(): FrameStage;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/5/| Official Onetap Documentation}
*/
declare namespace UI {
/**
* Register a new callback to a certain menu element.
* @param path The element's path.
* @see {@link https://www.onetap.com/resources/230/| Official Onetap Documentation}
*/
function RegisterCallback(path: Path): void;
/**
* @returns The cheat's menu position.
* @see {@link https://www.onetap.com/resources/214/| Official Onetap Documentation}
*/
function GetMenuPosition(): Array<number>;
/**
* Updates the list of a Dropdown or Multi-dropdown.
* @param path The element's path.
* @param list The new list of values.
* @see {@link https://www.onetap.com/resources/211/| Official Onetap Documentation}
*/
function UpdateList(path: Path, list: Array<string>): void;
/**
* Removes a menu element created by a script.
* @param path The element's path.
* @see {@link https://www.onetap.com/resources/210/| Official Onetap Documentation}
*/
function RemoveItem(path: Path): void;
/**
* @returns The virtual-key code for a hotkey.
* @param path The element's path.
* @see {@link https://www.onetap.com/resources/209/| Official Onetap Documentation}
*/
function GetHotkey(path: Path): number;
/**
* Overrides a hotkey's state/mode.
* @param path The element's path.
* @param state The new state in string form. This can either be 'Always', 'Toggle' or 'Hold'.
* @see {@link https://www.onetap.com/resources/207/| Official Onetap Documentation}
*/
function SetHotkeyState(path: Path, state: string): void;
/**
* @returns The state/mode of a hotkey.
* @param path The element's path.
* @see {@link https://www.onetap.com/resources/206/| Official Onetap Documentation}
*/
function GetHotkeyState(path: Path): string;
/**
* Toggles a hotkey on/off. Only works on hotkeys set to 'Toggle'.
* @param path The element's path.
* @see {@link https://www.onetap.com/resources/203/| Official Onetap Documentation}
*/
function ToggleHotkey(path: Path): void;
/**
* Overrides a color-picker's color.
* @param path The element's path.
* @param color The new color.
* @see {@link https://www.onetap.com/resources/202/| Official Onetap Documentation}
*/
function SetColor(path: Path, color: Array<number>): void;
/**
* Creates a new sub-tab at the designated path and then returns the registered path.
* @param path The path to the tab.
* @param name The sub-tab's name.
* @see {@link https://www.onetap.com/resources/201/| Official Onetap Documentation}
*/
function AddSubTab(path: Path, name: string): Path;
/**
* Creates a new textbox at the designated path and then returns the registered path.
* @param path The path to the textbox.
* @param name The textbox's name.
* @see {@link https://www.onetap.com/resources/200/| Official Onetap Documentation}
*/
function AddTextbox(path: Path, name: string): Path;
/**
* Creates a new color picker at the designated path and then returns the registered path.
* @param path The path to the color picker.
* @param name The color picker's name.
* @see {@link https://www.onetap.com/resources/199/| Official Onetap Documentation}
*/
function AddColorPicker(path: Path, name: string): Path;
/**
* Creates a new multi-dropdown at the designated path and then returns the registered path.
* @param path The path to the multi-dropdown.
* @param name The multi-dropdown's name.
* @param values The multi-dropdown's values.
* @param search_bar Whether or not the multi-dropdown should contain a search bar.
* @see {@link https://www.onetap.com/resources/198/| Official Onetap Documentation}
*/
function AddMultiDropdown(path: Path, name: string, values: Array<string>, search_bar: number): Path;
/**
* Creates a new dropdown at the designated path and then returns the registered path.
* @param path The path to the dropdown.
* @param name The dropdown's name.
* @param values The dropdown's values.
* @param search_bar Whether or not the dropdown should contain a search bar.
* @see {@link https://www.onetap.com/resources/197/| Official Onetap Documentation}
*/
function AddDropdown(path: Path, name: string, values: Array<string>, search_bar: number): Path;
/**
* Creates a new hotkey and at the designated path and then returns the registered path.
* @param path The path to the hotkey. Can only be inside a hotkey list.
* @param name The hotkey's name.
* @param display_name The hotkey's display name, shown in the keybind list.
* @see {@link https://www.onetap.com/resources/196/| Official Onetap Documentation}
*/
function AddHotkey(path: Path, name: string, display_name: string): Path;
/**
* Creates a new integer slider at the designated path and then returns the registered path.
* @param path The path to the slider.
* @param name The slider's name.
* @param min The minimum value of the slider.
* @param max The maximum value of the slider.
* @see {@link https://www.onetap.com/resources/194/| Official Onetap Documentation}
*/
function AddSliderInt(path: Path, name: string, min: number, max: number): Path;
/**
* Creates a new float slider at the designated path and then returns the registered path.
* @param path The path to the slider.
* @param name The slider's name.
* @param min The minimum value of the slider.
* @param max The maximum value of the slider.
* @see {@link https://www.onetap.com/resources/195/| Official Onetap Documentation}
*/
function AddSliderFloat(path: Path, name: string, min: number, max: number): Path;
/**
* Creates a new checkbox at the designated path and then returns the registered path.
* @param path The path to the checkbox.
* @param name The checkbox's name.
* @see {@link https://www.onetap.com/resources/193/| Official Onetap Documentation}
*/
function AddCheckbox(path: Path, name: string): Path;
/**
* Overrides the value of a menu element. Used in everything except color-pickers, hotkeys and textboxes.
* @param path The path to the element.
* @param value The new value.
* @see {@link https://www.onetap.com/resources/192/| Official Onetap Documentation}
*/
function SetValue(path: Path, value: number): Path;
/**
* Gets the value of a menu element and returns it.
* @param path The path to the element.
* @see {@link https://www.onetap.com/resources/190/| Official Onetap Documentation}
*/
function GetValue(path: Path): number;
/**
* Gets the value of a element in a string form. Used mainly on textboxes.
* @param path The path to the element.
* @see {@link https://www.onetap.com/resources/189/| Official Onetap Documentation}
*/
function GetString(path: Path): string;
/**
* Gets the color of a color-picker and returns it.
* @param path The path to the color-picker.
* @see {@link https://www.onetap.com/resources/188/| Official Onetap Documentation}
*/
function GetColor(path: Path): Array<number>;
/**
* Gets all menu element's within a certain path and return them.
* @param path The path to the container.
* @see {@link https://www.onetap.com/resources/191/| Official Onetap Documentation}
*/
function GetChildren(path: Path): Array<string>;
/**
* @returns Whether or not the cheat's menu is open.
* @see {@link https://www.onetap.com/resources/52/| Official Onetap Documentation}
*/
function IsMenuOpen(): boolean;
/**
* Overrides a menu element's visibility.
* @param path The path to the element.
* @param visible Whether or not the element should be visible.
* @see {@link https://www.onetap.com/resources/43/| Official Onetap Documentation}
*/
function SetEnabled(path: Path, visible: number): void;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/3/| Official Onetap Documentation}
*/
declare namespace Entity {
/**
* @returns An array with all entities in the server.
* @see {@link https://www.onetap.com/resources/16/| Official Onetap Documentation}
*/
function GetEntities(): Array<EntityID>;
/**
* @returns An array with all players in the server.
* @see {@link https://www.onetap.com/resources/17/| Official Onetap Documentation}
*/
function GetPlayers(): Array<EntityID>;
/**
* @returns An array with all enemies in the server.
* @see {@link https://www.onetap.com/resources/18/| Official Onetap Documentation}
*/
function GetEnemies(): Array<EntityID>;
/**
* @returns An array with all teammates in the server.
* @see {@link https://www.onetap.com/resources/19/| Official Onetap Documentation}
*/
function GetTeammates(): Array<EntityID>;
/**
* @returns The entity ID of the local player.
* @see {@link https://www.onetap.com/resources/20/| Official Onetap Documentation}
*/
function GetLocalPlayer(): EntityID;
/**
* @param index The user's index.
* @returns The entity index of the entity equivalent to the specified user index.
* @see {@link https://www.onetap.com/resources/21/| Official Onetap Documentation}
*/
function GetEntityFromUserID(index: UserID): EntityID;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is a teammate.
* @see {@link https://www.onetap.com/resources/22/| Official Onetap Documentation}
*/
function IsTeammate(index: EntityID): boolean;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is an enemy.
* @see {@link https://www.onetap.com/resources/23/| Official Onetap Documentation}
*/
function IsEnemy(index: EntityID): boolean;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is ourselves.
* @see {@link https://www.onetap.com/resources/24/| Official Onetap Documentation}
*/
function IsLocalPlayer(index: EntityID): boolean;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is valid.
* @see {@link https://www.onetap.com/resources/25/| Official Onetap Documentation}
*/
function IsValid(index: EntityID): boolean;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is alive.
* @see {@link https://www.onetap.com/resources/26/| Official Onetap Documentation}
*/
function IsAlive(index: EntityID): boolean;
/**
* @param index The entity's index.
* @returns Whether or not the specified entity is dormant to our player.
* @see {@link https://www.onetap.com/resources/27/| Official Onetap Documentation}
*/
function IsDormant(index: EntityID): boolean;
/**
* @param index The entity's index
* @returns Whether or not the specified entity is a bot.
* @see {@link https://www.onetap.com/resources/71/| Official Onetap Documentation}
*/
function IsBot(index: EntityID): boolean;
/**
* @param index The entity's index
* @returns The entity's class identifier.
* @see {@link https://www.onetap.com/resources/28/| Official Onetap Documentation}
*/
function GetClassID(index: EntityID): number;
/**
* @param index The entity's index
* @returns The entity's class name.
* @see {@link https://www.onetap.com/resources/29/| Official Onetap Documentation}
*/
function GetClassName(index: EntityID): string;
/**
* @param index The entity's index
* @returns The entity's name.
* @see {@link https://www.onetap.com/resources/30/| Official Onetap Documentation}
*/
function GetName(index: EntityID): string;
/**
* @param index The entity's index
* @returns The entity's origin position.
* @see {@link https://www.onetap.com/resources/31/| Official Onetap Documentation}
*/
function GetRenderOrigin(index: EntityID): Vector;
/**
* @param index The entity's index
* @returns The entity's eye position.
* @see {@link https://www.onetap.com/resources/76/| Official Onetap Documentation}
*/
function GetEyePosition(index: EntityID): Vector;
/**
* @param index The entity's index
* @param hitbox_index The hitbox's index. Ranges from 0 to 18.
* @returns The hitbox's position of an entity.
* @see {@link https://www.onetap.com/resources/77/| Official Onetap Documentation}
*/
function GetHitboxPosition(index: EntityID, hitbox_index: HitboxIndex): Vector;
/**
* Gets a property from an entity. @returns property's name on failure.
* @param index The entity's index
* @param table The property's table
* @param prop The property's name
* @see {@link https://www.onetap.com/resources/32/| Official Onetap Documentation}
*/
function GetProp(index: EntityID, table: string, prop: string): any;
/**
* Overrides a property of an entity. Cannot be used on players.
* @param index The entity's index
* @param table The property's table
* @param prop The property's name
* @param value The new value
* @see {@link https://www.onetap.com/resources/33/| Official Onetap Documentation}
*/
function SetProp(index: EntityID, table: string, prop: string, value: any): any;
/**
* @returns The weapon's entity index of a player.
* @param index The player's index
* @returns Weapon's entity ID
* @see {@link https://www.onetap.com/resources/70/| Official Onetap Documentation}
*/
function GetWeapon(index: EntityID): EntityID;
/**
* @returns An array containing all of the weapon's entity indexes of a player.
* @param index The player's index you want to get the weapons from.
* @see {@link https://www.onetap.com/resources/151/| Official Onetap Documentation}
*/
function GetWeapons(index: EntityID): Array<EntityID>;
/**
* @returns The game's CCSGameRulesProxy entity.
* @see {@link https://www.onetap.com/resources/72/| Official Onetap Documentation}
*/
function GetGameRulesProxy(): EntityID;
/**
* @param class_index The class' index.
* @returns An array containing all entities of a certain class.
* @see {@link https://www.onetap.com/resources/87/| Official Onetap Documentation}
*/
function GetEntitiesByClassID(class_index: number): Array<EntityID>;
/**
* @param {EntityID} index The entity's index
* @returns An array containing the data of a entity's bounding box: whether or not the box is valid, the box's top left corner X position,
* the box's top left Y position, the box's bottom right X position and the box's bottom right Y position.
* @see {@link https://www.onetap.com/resources/161/| Official Onetap Documentation}
*/
function GetRenderBox(index: EntityID): Array<number>;
/**
* @param index The player's or weapon's index.
* @returns An object containing all the info of a given weapon.
* @see {@link https://www.onetap.com/resources/212/| Official Onetap Documentation}
*/
function GetCCSWeaponInfo(index: EntityID): Object;
/**
* Adds a flag to a player's flag list, for one tick.
* @param index The player's index.
* @param flag The flag text.
* @param color The flag's color.
* @see {@link https://www.onetap.com/resources/213/| Official Onetap Documentation}
*/
function DrawFlag(index: EntityID, flag: string, color: Array<number>): void;
/**
* Disables all ESP on a player, for one tick. Does not affect chams.
* @param index The player's index.
* @see {@link https://www.onetap.com/resources/224/| Official Onetap Documentation}
*/
function DisableESP(index: EntityID): void;
/**
* @param index The player's index.
* @returns A players's STEAM64 identification.
* @see {@link https://www.onetap.com/resources/229/| Official Onetap Documentation}
*/
function GetSteamID(index: EntityID): number;
/**
* @param index The player's index.
* @param layer The animation layer index.
* @returns A players's STEAM64 identification.
* @see {@link https://www.onetap.com/resources/252/| Official Onetap Documentation}
*/
function GetAnimationLayer(index: EntityID, layer: AnimationLayerIndex): AnimationLayer;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/4/| Official Onetap Documentation}
*/
declare namespace Render {
/**
* Renders a line.
* @param {number} x1 The first X position
* @param {number} y1 The first Y position
* @param {number} x2 The second X position
* @param {number} y2 The second Y position
* @param {Array<number>} color The line's color
* @see {@link https://www.onetap.com/resources/35/| Official Onetap Documentation}
*/
function Line(x1: number, y1: number, x2: number, y2: number, color: Array<number>): void;
/**
* Renders a rectangle outline.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} w The rectangle's width
* @param {number} h The rectangle's height
* @param {Array<number>} color The rectangle's color
* @see {@link https://www.onetap.com/resources/36/| Official Onetap Documentation}
*/
function Rect(x: number, y: number, w: number, h: number, color: Array<number>): void;
/**
* Renders a rectangle.
* @param {number} x The X position.
* @param {number} y The Y position.
* @param {number} w The rectangle's width.
* @param {number} h The rectangle's height.
* @param {Array<number>} color The rectangle's color.
* @see {@link https://www.onetap.com/resources/37/| Official Onetap Documentation}
*/
function FilledRect(x: number, y: number, w: number, h: number, color: Array<number>): void;
/**
* Renders a ring.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} radius The circle's radius
* @param {Array<number>} color The circle's color
* @see {@link https://www.onetap.com/resources/38/| Official Onetap Documentation}
*/
function Circle(x: number, y: number, radius: number, color: Array<number>): void;
/**
* Renders a circle.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} radius The circle's radius
* @param {Array<number>} color The circle's color
* @see {@link https://www.onetap.com/resources/150/| Official Onetap Documentation}
*/
function FilledCircle(x: number, y: number, radius: number, color: Array<number>): void;
/**
* Renders a gradient.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} w The gradient's width
* @param {number} h The gradient's height
* @param {number} is_horizontal The gradient's direction. Use '0' for vertical and '1' for horizontal.
* @param {Array<number>} color1 The gradient's first color
* @param {Array<number>} color2 The gradient's second color
* @see {@link https://www.onetap.com/resources/80/| Official Onetap Documentation}
*/
function GradientRect(x: number, y: number, w: number, h: number, is_horizontal: number, color1: Array<number>, color2: Array<number>): void;
/**
* Renders a rectangle with a texture.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} w The rectangle's width
* @param {number} h The rectangle's height
* @param {number} texture_index The rectangle's texture index
* @see {@link https://www.onetap.com/resources/109/| Official Onetap Documentation}
*/
function TexturedRect(x: number, y: number, w: number, h: number, texture_index: number): void;
/**
* Renders a string.
* @param {number} x The X position
* @param {number} y The Y position
* @param {number} centered Whether or not it should be centered.
* @param {string} text The actual string
* @param {Array<number>} color The string's color
* @param {number} font The string's font. Onetap has predefined fonts from 1 to 7.
* @see {@link https://www.onetap.com/resources/204/| Official Onetap Documentation}
*/
function String(x: number, y: number, centered: number, text: string, color: Array<number>, font: number): void;
/**
* Renders a polygon.
* @param {Array<Array<number>>} points A matrix of all 3 points of the polygon.
* @param {Array<number>} color The polygon's color.
* @see {@link https://www.onetap.com/resources/84/| Official Onetap Documentation}
*/
function Polygon(points: Array<Array<number>>, color: Array<number>): void;
/**
* Convers a 3D point into a 2D point on your screen and returns its X and Y positions, and whether or not the point is behind you.
* @param {Vector} point The 3D point
* @see {@link https://www.onetap.com/resources/39/| Official Onetap Documentation}
*/
function WorldToScreen(point: Vector): Array<number>;
/**
* @returns The width and height of your screen.
* @see {@link https://www.onetap.com/resources/40/| Official Onetap Documentation}
*/
function GetScreenSize(): Array<number>;
/**
* Finds an already existing font by its parameters.
* @param {string} font The font's name
* @param {number} size The font's size
* @param {boolean} windows The font is installed into the windows font directory.
* @returns The font identifier.
* @see {@link https://www.onetap.com/resources/238/| Official Onetap Documentation}
*/
function GetFont(font: string, size: number, windows: boolean): number;
/**
* Creates a new texture from a on-disk file.
* @file .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm and .tga.
* @param {string} path The file's path relative to CSGO's folder.
* @see {@link https://www.onetap.com/resources/108/| Official Onetap Documentation}
*/
function AddTexture(path: string): number;
/**
* @returns The width and height of a string.
* @param {string} text The actual string.
* @param {number} font The string's font.
* @see {@link https://www.onetap.com/resources/205/| Official Onetap Documentation}
*/
function TextSize(text: string, font: number): Array<number>;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/6/| Official Onetap Documentation}
*/
declare namespace Convar {
/**
* Gets a CVar's value in integer form.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/53/| Official Onetap Documentation}
*/
function GetInt(cvar: string): number | boolean;
/**
* Gets a CVar's value in float form.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/55/| Official Onetap Documentation}
*/
function GetFloat(cvar: string): number | boolean;
/**
* Gets a CVar's value in string form.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/57/| Official Onetap Documentation}
*/
function GetString(cvar: string): string | boolean;
/**
* Overrides a CVar's value to a specified integer.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/54/| Official Onetap Documentation}
*/
function SetInt(cvar: string, value: number): void;
/**
* Overrides a CVar's value to a specified float.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/56/| Official Onetap Documentation}
*/
function SetFloat(cvar: string, value: number): void;
/**
* Overrides a CVar's value to a specified string.
* @param cvar The CVar.
* @see {@link https://www.onetap.com/resources/58/| Official Onetap Documentation}
*/
function SetString(cvar: string, value: string): void;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/7/| Official Onetap Documentation}
*/
declare namespace Event {
/**
* Gets a field's value in integer form.
* @param field_name The field.
* @see {@link https://www.onetap.com/resources/60/| Official Onetap Documentation}
*/
function GetInt(field_name: string): number;
/**
* Gets a field's value in float form.
* @param field_name The field.
* @see {@link https://www.onetap.com/resources/61/| Official Onetap Documentation}
*/
function GetFloat(field_name: string): number;
/**
* Gets a field's value in string form.
* @param field_name The field.
* @see {@link https://www.onetap.com/resources/62/| Official Onetap Documentation}
*/
function GetString(field_name: string): string;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/9/| Official Onetap Documentation}
*/
declare namespace Trace {
/**
* Traces a line from a point to another and returns its data.
* @param skip_entity The entity to be ignored
* @param from The initial position
* @param to The ending position
* @returns The entity index of a hit entity or undefined, the fraction of the trace ('0' means it hit immediately, '1' means it went fully through).
* @see {@link https://www.onetap.com/resources/78/| Official Onetap Documentation}
*/
function Line(skip_entity: EntityID, from: Vector, to: Vector): Array<number>;
/**
* Traces a bullet from a point to another and returns its data.
* @param attacker The entity who attacked
* @param victim The enttiy who should be hit
* @param from The initial position
* @param to The ending position
* @returns The entity index of a hit entity or undefined, the damage dealt, whether or not the ending position is visible and the hitbox that was hit.
* @see {@link https://www.onetap.com/resources/79/| Official Onetap Documentation}
*/
function Bullet(attacker: EntityID, victim: EntityID, from: Vector, to: Vector): Array<number>;
/**
* Traces a line from a point to another with a custom mask and returns its data. For advanced users only.
* @param skip_entity The entity to be ignored
* @param from The initial position
* @param to The ending position
* @param mask The custom mask
* @param type The type. '0' will trace everything, '1' will trace only the world and '2' will trace only the entities.
* @returns The entity index of a hit entity or undefined, the fraction of the trace ('0' means it hit immediately, '1' means it went fully through).
* @see {@link https://www.onetap.com/resources/187/| Official Onetap Documentation}
*/
function RawLine(skip_entity: EntityID, from: Vector, to: Vector, mask: number, type: number): Array<number>;
/**
* @returns Whether or not a line goes through a smoke. Breaks if smoke is removed.
* @param from The initial position
* @param to The ending position
* @see {@link https://www.onetap.com/resources/179/| Official Onetap Documentation}
*/
function Smoke(from: Vector, to: Vector): number;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/10/| Official Onetap Documentation}
*/
declare namespace UserCMD {
/**
* @returns An array containing forward, sideways and up movement.
* @see {@link https://www.onetap.com/resources/186/| Official Onetap Documentation}
*/
function GetMovement(): Array<number>;
/**
* @returns a bit-mask of all buttons.
* @see {@link https://www.onetap.com/resources/181/| Official Onetap Documentation}
*/
function GetButtons(): number;
/**
* Overrides the UserCMD's movement.
* @param values
* @see {@link https://www.onetap.com/resources/89/| Official Onetap Documentation}
*/
function SetMovement(values: Array<number>): void;
/**
* Overrides the UserCMD's buttons.
* @param buttons
* @see {@link https://www.onetap.com/resources/182/| Official Onetap Documentation}
*/
function SetButtons(buttons: number): void;
/**
* Overrides your UserCMD's angles.
* @param angles The new angles
* @param silent Whether or not you should visualize those angles.
* @see {@link https://www.onetap.com/resources/185/| Official Onetap Documentation}
*/
function SetViewAngles(angles: Vector, silent: boolean): void;
/**
* Overrides the mouse's X position.
* @param x The new position.
* @see {@link https://www.onetap.com/resources/231/| Official Onetap Documentation}
*/
function SetMouseX(x: number): void;
/**
* Overrides the mouse's Y position.
* @param y The new position.
* @see {@link https://www.onetap.com/resources/232/| Official Onetap Documentation}
*/
function SetMouseY(y: number): void;
/**
* Forces the cheat to choke a tick.
* @see {@link https://www.onetap.com/resources/183/| Official Onetap Documentation}
*/
function Choke(): void;
/**
* Forces the cheat to send a tick.
* @see {@link https://www.onetap.com/resources/184/| Official Onetap Documentation}
*/
function Send(): void;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/11/| Official Onetap Documentation}
*/
declare namespace Sound {
/**
* Plays a sound.
* @param path The path to the sound file.
* @see {@link https://www.onetap.com/resources/82/| Official Onetap Documentation}
*/
function Play(path: string): void;
/**
* Plays a sound on your in-game microphone.
* @param path The path to the sound file.
* @see {@link https://www.onetap.com/resources/99/| Official Onetap Documentation}
*/
function PlayMicrophone(path: string): void;
/**
* Stops playing a sound on your microphone.
* @see {@link https://www.onetap.com/resources/100/| Official Onetap Documentation}
*/
function StopMicrophone(): void;
}
/**
* @see {@link https://www.onetap.com/scripting/categories/12/| Official Onetap Documentation}
*/
declare namespace Local {
/**
* @returns your latency/ping in seconds.
* @see {@link https://www.onetap.com/resources/13/| Official Onetap Documentation}
*/
function Latency(): number;
/**
* @returns a vector containing your pitch, yaw and roll.
* @see {@link https://www.onetap.com/resources/15/| Official Onetap Documentation}
*/
function GetViewAngles(): Vector;
/**
* @returns a vector containing your camera's pitch, yaw and roll.
* @see {@link https://www.onetap.com/resources/223/| Official Onetap Documentation}
*/
function GetCameraAngles(): Vector;
/**
* @returns a vector containing your camera's X, Y and Z positions.
* @see {@link https://www.onetap.com/resources/222/| Official Onetap Documentation}
*/
function GetCameraPosition(): Vector;
/**
* @returns Whether or not the local player is dormant to an entity.
* @see {@link https://www.onetap.com/resources/248/| Official Onetap Documentation}
*/
function IsDormantTo(index: EntityID): boolean;
/**
* Overrides your engine's view angles.
* @param angles The new angles
* @see {@link https://www.onetap.com/resources/15/| Official Onetap Documentation}
*/
function SetViewAngles(angles: Vector): void;