-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.lua
1766 lines (1603 loc) · 52.4 KB
/
plugin.lua
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
---@meta
---@class ESXItem
---@field name string
---@field count number
---@field label string
---@field weight number
---@field usable boolean
---@field rare boolean
---@field canRemove boolean
---@class ESXPlayerAccount
---@field name string
---@field money number
---@field label string
---@field round boolean
---@field index number
---@class ESXPlayerJob
---@field id number
---@field name string
---@field label string
---@field grade number
---@field grade_name string
---@field grade_label string
---@field grade_salary number
---@field skin_male table
---@field skin_female table
---@class ESXLoadoutWeapon
---@field name string
---@field ammo number
---@field label string
---@field components string[]
---@field tintIndex number
---@class ESXPLayerData
---@field accounts ESXPlayerAccount []
---@field coords vector3
---@field dateofbirth string
---@field firstName string
---@field lastName string
---@field job ESXPlayerJob
---@field height number
---@field identifier string
---@field inventory ESXItem[]
---@field loadout ESXLoadoutWeapon[]
---@field money number
---@field name string
---@field sex string
---@class ESXConfigWeaponComponent
---@field name string
---@field label string
---@field hash number
---@class ESXConfigWeapon
---@field name string
---@field label string
---@field components ESXConfigWeaponComponent[]
---@class ESXConfig
---@field Locale string
---@field OxInventory boolean
---@field Accounts table<string, { label: string, round: boolean }>
---@field StartingAccountMoney table<string, number>
---@field StartingInventoryItems false | table<string, number>
---@field DefaultSpawns { x: number, y: number, z: number; heading: number }[]
---@field AdminGroups table<string, true>
---@field EnablePaycheck boolean
---@field LogPaycheck boolean
---@field EnableSocietyPayouts boolean
---@field MaxWeight number
---@field PaycheckInterval number
---@field EnableDebug boolean
---@field EnableDefaultInventory boolean
---@field EnableWantedLevel boolean
---@field EnablePVP boolean
---@field Multichar boolean
---@field Identity boolean
---@field DistanceGive number
---@field AdminLogging boolean
---@field DisableHealthRegeneration boolean
---@field DisableVehicleRewards boolean
---@field DisableNPCDrops boolean
---@field DisableDispatchServices boolean
---@field DisableScenarios boolean
---@field DisableWeaponWheel boolean
---@field DisableAimAssist boolean
---@field DisableVehicleSeatShuff boolean
---@field DisableDisplayAmmo boolean
---@field RemoveHudComponents table<number, boolean>
---@field SpawnVehMaxUpgrades boolean
---@field CustomAIPlates string
---@field DefaultWeaponTints table<number, string>
---@field Weapons ESXConfigWeapon[]
---@class ESXJobGrade
---@field grade number
---@field label string
---@field salary number
---@field skin_male table<string, number>
---@field skin_female table<string, number>
---@class ESXJob
---@field name string
---@field label string
---@field grades table<string, ESXJobGrade>
---@alias ESXMenuTypeCallback fun(namespace: string, name: string)
---@class xPlayer
---@field accounts ESXPlayerAccount[]
---@field coords vector3
---@field group string
---@field identifier string
---@field job ESXPlayerJob
---@field loadout ESXLoadoutWeapon[]
---@field name string
---@field playerId number
---@field source number
---@field variables table<string, any>
---@field weight number
---@field maxWeight number
---@field metadata table<string, any>
---@field admin boolean
---@field license string
---@field triggerEvent fun(eventName: string, ...: any)
---@field setCoords fun(coordinates: vector4 | vector3 | { x: number; y: number; z: number; w?: number })
---@field getCoords fun(vector: boolean, heading: boolean): { x: number; y: number; z: number; heading: number }
---@field kick fun(reason: string)
---@field setMoney fun(money: number)
---@field getMoney fun(): number
---@field addMoney fun(money: number, reason: string)
---@field removeMoney fun(money: number, reason: string)
---@field getIdentifier fun(): string
---@field setGroup fun(newGroup: string)
---@field getGroup fun(): string
---@field set fun(key: string, value: any)
---@field get fun(key: string): any?
---@field getAccounts (fun(): ESXPlayerAccount[]) | (fun(minimal: true): table<string, number>)
---@field getAccount fun(account: string): ESXPlayerAccount?
---@field getInventory (fun(): ESXItem[]) | (fun(minimal: true): table<string, number>)
---@field getJob fun(): ESXPlayerJob
---@field getLoadout fun(minimal: boolean): ESXLoadoutWeapon[]
---@field getName fun(): string
---@field setName fun(newName: string)
---@field setAccountMoney fun(account: string, money: number, reason?: string)
---@field addAccountMoney fun(account: string, money: number, reason?: string)
---@field removeAccountMoney fun(account: string, money: number, reason?: string)
---@field getInventoryItem fun(itemName: string): ESXItem?
---@field addInventoryItem fun(itemName: string, count: number)
---@field removeInventoryItem fun(itemName: string, count: number)
---@field setInventoryItem fun(itemName: string, count: number)
---@field getWeight fun(): number
---@field getMaxWeight fun(): number
---@field canCarryItem fun(itemName: string, count: number): boolean
---@field canSwapItem fun(firstItem: string, firstItemCount: number, testItem: string, testItemCount: number): boolean
---@field setMaxWeight fun(maxWeight: number)
---@field setJob fun(job: string, grade: string)
---@field addWeapon fun(weaponName: string, ammo: number)
---@field addWeaponComponent fun(weaponName: string, weaponComponent: number)
---@field addWeaponAmmo fun(weaponName: string, ammoCount: number)
---@field updateWeaponAmmo fun(weaponName: string, ammoCount: number)
---@field setWeaponTint fun(weaponName: string, weaponTintIndex: number)
---@field getWeaponTint fun(weaponName: string): number
---@field removeWeapon fun(weaponName: string)
---@field removeWeaponComponent fun(weaponName: string, weaponComponent: string)
---@field removeWeaponAmmo fun(weaponName: string, ammoCount: number)
---@field hasWeaponComponent fun(weaponName: string, weaponComponent: string): boolean
---@field hasWeapon fun(weaponName: string): boolean
---@field hasItem fun(item: string): false | ESXItem, number?
---@field getWeapon fun(weaponName: string): number?, ESXConfigWeapon?
---@field showNotification fun(msg: string, type?: 'info' | 'error' | 'success', length?: number)
---@field showAdvancedNotification fun(sender: string, subject: string, msg: string, textureDict: string, iconType: number, flash?: boolean, saveToBrief?: boolean, hudColorIndex?: number)
---@field showHelpNotification fun(msg: string, thisFrame?: boolean, beep?: boolean, duration?: number)
---@field getMeta fun(index: string, subIndex: string | number | table): any
---@field setMeta fun(index: string, value: any, subValue: string | number | table)
---@field clearMeta fun(index: string, subIndex: string | number | table)
---@class ESX
---@field PlayerLoaded boolean
---@field PlayerData ESXPLayerData
---@field Items table<string, ESXItem>
ESX = {};
ESX.UI = {};
ESX.UI.Menu = {};
---@type table<string, { open: ESXMenuTypeCallback; close: ESXMenuTypeCallback }>
ESX.UI.Menu.RegisteredTypes = {};
ESX.Game = {};
ESX.Scaleform = {};
ESX.Scaleform.Utils = {};
ESX.Streaming = {};
ESX.Math = {};
ESX.Table = {};
ESX.OneSync = {};
exports.es_extended = {};
--- `CLIENT`, `SERVER`
---
---@return ESX
function exports.es_extended:getSharedObject() end
--- INTERNAL USE ONLY !!! DO NUT USE
--- Spawns the player with the given skin and coordinates.
---
--- `CLIENT`
---
---@param skin table<string, number>
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param cb fun()
function ESX.SpawnPlayer(skin, coords, cb) end
--- This function checks if the player has loaded in.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/isplayerloaded/)
---
--- `CLIENT`
---
---@return boolean
function ESX.IsPlayerLoaded() end
--- Returns the player's local data.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/getplayerdata/)
---
--- `CLIENT`
---
---@return ESXPLayerData
function ESX.GetPlayerData() end
--- Searches the player's inventory for the given items.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/searchinventory/)
---
--- `CLIENT`
---
---@overload fun(items: string | string[], count: false): table<string, ESXItem>
---@overload fun(items: string | string[], count: true): table<string, number>
function ESX.SearchInventory(items, count) end
--- Sets the player's local data.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/setplayerdata/)
---
--- `CLIENT`
---
---@param key string
---@param val any
function ESX.SetPlayerData(key, val) end
---@class ESXProgressBarAnimation
---@field type 'anim'
---@field dict string
---@field lib string
---@class ESXProgressBarScenario
---@field type 'Scenario'
---@field Scenario string
---@class ESXProgressBarOptions
---@field FreezePlayer? boolean
---@field animation? ESXProgressBarAnimation | ESXProgressBarScenario
---@field onFinish? fun()
---@field onCancel? fun()
--- Displays a progress bar.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/progressbar/)
---
--- `CLIENT`
---
---@param message string
---@param length number
---@param Options? ESXProgressBarOptions
function ESX.Progressbar(message, length, Options) end
--- This function shows a notification to the player.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/shownotification/)
---
--- `CLIENT`
---
---@param message string
---@param notifyType? 'info' | 'success' | 'error'
---@param length? number
function ESX.ShowNotification(message, notifyType, length) end
--- Shows a floating text on screen
---
--- `CLIENT`
---
---@param message string
---@param notifyType? 'info' | 'success' | 'error'
function ESX.TextUI(message, notifyType) end
--- Hides the text ui
---
--- `CLIENT`
---
function ESX.HideUI() end
--- This function shows an advanced notification.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/showadvancednotification/)
---
--- `CLIENT`
---
---@param sender string
---@param subject string
---@param msg string
---@param textureDict string
---@param iconType number
---@param flash? boolean
---@param saveToBrief? boolean
---@param hudColorIndex? number
function ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex) end
--- This function shows a help notification with a message. These help notification support displaying button inputs, see [this list](https://pastebin.com/HPg8pYwi)
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/showhelpnotification/)
---
--- `CLIENT`
---
---@param msg string
---@param thisFrame? boolean
---@param beep? boolean
---@param duration? number
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration) end
--- This function shows a help notification with a message. These help notification support displaying button inputs, see [this list](https://pastebin.com/HPg8pYwi)
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/showfloatinghelpnotification/)
---
--- `CLIENT`
---
---@param msg string
---@param coords vector3
function ESX.ShowFloatingHelpNotification(msg, coords) end
--- This function hashes the given string.
---
--- `CLIENT`
---
---@param str string
function ESX.HashString(str) end
---@class ESXContextElement
---@field unselectable? boolean
---@field icon? string
---@field title string
---@field val? string
---@field input? boolean
---@field inputType? string
---@field inputPlaceholder? string
---@field inputMin? number
---@field inputMax? number
---@alias ESXContextMenuPositions 'right' | 'left' | 'center'
---@class ESXContextMenu
---@field position ESXContextMenuPositions
---@field eles ESXContextElement[]
---@field onSelect fun(menu: ESXContextMenu, element: ESXContextElement)
---@field onClose? fun(menu: ESXContextMenu)
---@field canClose? boolean
--- Opens a context menu.
---
--- `CLIENT`
---
---@param position ESXContextMenuPositions
---@param elements ESXContextElement[]
---@param onSelect fun(menu: ESXContextMenu, element: ESXContextElement)
---@param onClose? fun(menu: ESXContextMenu)
---@param canClose? boolean
function ESX.OpenContext(position, elements, onSelect, onClose, canClose) end
--- Opens the context, but does not focus the nui
---
--- `CLIENT`
---
---@param position ESXContextMenuPositions
---@param elements ESXContextElement[]
---@param onSelect fun(menu: ESXContextMenu, element: ESXContextElement)
---@param onClose? fun(menu: ESXContextMenu)
---@param canClose? boolean
function ESX.PreviewContext(position, elements, onSelect, onClose, canClose) end
--- Closes the current context menu
---
--- `CLIENT`
---
function ESX.CloseContext() end
--- Refreshes the current context menu
---
--- `CLIENT`
---
---@overload fun(elements: ESXContextElement[], position?: ESXContextMenuPositions)
---@overload fun(elements?: ESXContextElement[], position: ESXContextMenuPositions)
---@overload fun(elements: ESXContextElement[], position: ESXContextMenuPositions)
function ESX.RefreshContext(elements, position) end
---@param command_name string
---@param label string
---@param input_group string
---@param key string
---@param on_press fun(source: 0, args: string[], rawCommand: string)
---@param on_release? fun(source: 0, args: string[], rawCommand: string)
function ESX.RegisterInput(command_name, label, input_group, key, on_press, on_release) end
--- Registers a menu type.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/registertype)
---
--- `CLIENT`
---
---@param menuType string
---@param open ESXMenuTypeCallback
---@param close ESXMenuTypeCallback
function ESX.UI.Menu.RegisterType(menuType, open, close) end
---@alias ESXMenuElement { label: string } | table<string, any>
---@class ESXMenuData
---@field title string
---@field elements? ESXMenuElement[]
---@field align? 'left' | 'top-left' | 'top' | 'top-right' | 'right' | 'bottom-right' | 'bottom' | 'bottom-left' | 'center' | string
---@field type? 'big' | 'default' | string
---@class ESXMenu
---@field type 'menu' | 'dialog' | string
---@field namespace string
---@field resourceName string
---@field name string
---@field data ESXMenuData
---@field submit ESXMenuCallback
---@field cancel? ESXMenuCallback
---@field change? ESXMenuCallback
---@field close fun()
---@field update fun(query: table<string, any>, newData: table<string, any>)
---@field refresh fun()
---@field setElement fun(index: number, key: string, value: any)
---@field setElements fun(newElements: ESXMenuElement[])
---@field setTitle fun(newTitle: string)
---@field removeElement fun(query: table)
---@class ESXMenuCallbackData
---@field _namespace string
---@field _name string
---@field value? string;
---@field current? ESXMenuElement
---@field elements? ESXMenuElement[]
---@alias ESXMenuCallback fun(data: ESXMenuCallbackData, menu: ESXMenu)
---@alias ESXMenuType 'menu' | 'dialog' | string
--- Opens a menu.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/open)
---
--- `CLIENT`
---
---@param menuType ESXMenuType
---@param namespace string
---@param name string
---@param data ESXMenuData
---@param submit? ESXMenuCallback
---@param cancel? ESXMenuCallback
---@param change? ESXMenuCallback
---@param close? ESXMenuCallback
---@return ESXMenu
function ESX.UI.Menu.Open(menuType, namespace, name, data, submit, cancel, change, close) end
--- Closes the specified menu.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/close)
---
--- `CLIENT`
---
---@param menuType ESXMenuType
---@param namespace string
---@param name string
function ESX.UI.Menu.Close(menuType, namespace, name) end
--- Closes all open menus.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/closeall)
---
--- `CLIENT`
---
function ESX.UI.Menu.CloseAll() end
--- Returns the specified menu.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/getopened)
---
--- `CLIENT`
---
---@param menuType ESXMenuType
---@param namespace string
---@param name string
---@return ESXMenu
function ESX.UI.Menu.GetOpened(menuType, namespace, name) end
--- Returns all open menus.
---
--- `CLIENT`
---
---@return ESXMenu[]
function ESX.UI.Menu.GetOpenedMenus() end
--- Returns whether the specified menu is open.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/menu/isopen)
---
--- `CLIENT`
---
---@param menuType ESXMenuType
---@param namespace string
---@param name string
function ESX.UI.Menu.IsOpen(menuType, namespace, name) end
--- Shows an inventory item notification.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/ui/showinventoryitemnotification)
---
--- `CLIENT`
---
---@param add boolean
---@param item string
---@param count number | string
function ESX.UI.ShowInventoryItemNotification(add, item, count) end
--- This function generates a mugshot of the ped usable in various applications.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getpedmugshot/)
---
--- `CLIENT`
---
---@param ped number
---@param transparent? boolean
---@return number mugshot
---@return string mugshoStr
function ESX.Game.GetPedMugshot(ped, transparent) end
--- Teleports the specified entity to the given coordinates.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/teleport/)
---
--- `CLIENT`
---
---@param entity number
---@param coords vector3 | vector4 | { x: number, y: number, z: number; heading?: number }
---@param cb? fun()
function ESX.Game.Teleport(entity, coords, cb) end
--- Spawns an object.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/spawnobject/)
---
--- `CLIENT`
---
---@param model string | number
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param cb? fun(object: number)
---@param networked? boolean
function ESX.Game.SpawnObject(model, coords, cb, networked) end
--- This function spawns a local object, which is only visible to the local player and no one else.
---
--- !!! warning This is an async function because it awaits the object model to be streamed.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/spawnlocalobject)
---
--- `CLIENT`
---
---@param model string | number
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param cb? fun(object: number)
function ESX.Game.SpawnLocalObject(model, coords, cb) end
--- This function deletes the given vehicle.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/deletevehicle)
---
--- `CLIENT`
---
---@param vehicle number
function ESX.Game.DeleteVehicle(vehicle) end
--- This function deletes the given object.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/deleteobject)
---
--- `CLIENT`
---
---@param object number
function ESX.Game.DeleteObject(object) end
--- This function spawns a vehicle.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/spawnvehicle)
---
--- `CLIENT`
---
---@param vehicleModel string | number
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param heading number
---@param cb? fun(vehicle: number)
---@param networked? boolean
function ESX.Game.SpawnVehicle(vehicleModel, coords, heading, cb, networked) end
--- This function spawns a local vehicle, which is only visible to the local player and no one else.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/spawnlocalvehicle)
---
--- `CLIENT`
---
---@param vehicleModel string | number
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param heading number
---@param cb? fun(vehicle: number)
function ESX.Game.SpawnLocalVehicle(vehicleModel, coords, heading, cb) end
--- Returns whether the specified vehicle is empty.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/isvehicleempty)
---
--- `CLIENT`
---
---@param vehicle number entity
function ESX.Game.IsVehicleEmpty(vehicle) end
--- This function gets all objects found in the game world.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getobjects)
---
--- `CLIENT`
---
---@return number[]
function ESX.Game.GetObjects() end
--- This function gets all peds found in the game world.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getpeds)
---
--- `CLIENT`
---
---@param onlyOtherPeds? boolean
---@return number[]
function ESX.Game.GetPeds(onlyOtherPeds) end
--- This function gets all vehicles found in the game world.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getvehicles)
---
--- `CLIENT`
---
---@return number[]
function ESX.Game.GetVehicles() end
--- This function is used to get all the active players.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getplayers)
---
--- `CLIENT`
---
---@param onlyOtherPlayers? boolean
---@param returnKeyValue? boolean
---@param returnPeds? boolean
---@return table<number, number>
function ESX.Game.GetPlayers(onlyOtherPlayers, returnKeyValue, returnPeds) end
--- This function returns the closest object handle, and distance to the object.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getclosestobject)
---
--- `CLIENT`
---
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param modelFilter? table<number, true>
---@return number object
---@return number distance
function ESX.Game.GetClosestObject(coords, modelFilter) end
--- This function returns the closest ped handle, and distance to the ped.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getclosestped)
---
--- `CLIENT`
---
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@param modelFilter? table<number, true>
---@return number ped
---@return number distance
function ESX.Game.GetClosestPed(coords, modelFilter) end
--- This function gets the closest player client id, and distance to the player.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getclosestplayer)
---
--- `CLIENT`
---
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@return number player
---@return number distance
function ESX.Game.GetClosestPlayer(coords) end
--- This function gets the closest vehicle.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getclosestvehicle)
---
--- `CLIENT`
---
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@param modelFilter? table<number, true>
---@return number vehicle
---@return number distance
function ESX.Game.GetClosestVehicle(coords, modelFilter) end
--- This function gets all players within the max distance of a coord.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getplayersinarea)
---
--- `CLIENT`
---
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@param maxDistance number
---@return number[]
function ESX.Game.GetPlayersInArea(coords, maxDistance) end
--- This function gets all vehicles within the max distance of a coord.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getvehiclesinarea)
---
--- `CLIENT`
---
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@param maxDistance number
---@return number[]
function ESX.Game.GetVehiclesInArea(coords, maxDistance) end
--- This function returns the closest Entity handle, and distance to the Entity.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getclosestEntity)
---
--- `CLIENT`
---
---@param entities number[]
---@param isPlayerEntities? boolean
---@param coords? vector3 | vector4 | { x: number, y: number, z: number }
---@param modelFilter? table<number, true>
---@return number entity
---@return number distance
function ESX.Game.GetClosestEntity(entities, isPlayerEntities, coords, modelFilter) end
--- This function gets the closest vehicle in the player's direction within 5 units, utilizes ray-casts.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getvehicleindirection)
---
--- `CLIENT`
---
---@return boolean?, vector3?
function ESX.Game.GetVehicleInDirection() end
---@class ESXVehicleProperties
---@field model number
---@field doorsBroken boolean[]
---@field windowsBroken boolean[]
---@field tyreBurst boolean[]
---@field tyresCanBurst boolean
---@field plate string
---@field plateIndex number
---@field bodyHealth number
---@field engineHealth number
---@field tankHealth number
---@field fuelLevel number
---@field dirtLevel number
---@field color1 number
---@field color2 number
---@field customPrimaryColor [number, number, number]|nil
---@field customSecondaryColor [number, number, number]|nil
---@field pearlescentColor number
---@field wheelColor number
---@field dashboardColor number
---@field interiorColor number
---@field wheels number
---@field windowTint number
---@field xenonColor number
---@field customXenonColor number|nil
---@field neonEnabled boolean[]
---@field neonColor [number, number, number]
---@field extras table<string, boolean>
---@field tyreSmokeColor [number, number, number]
---@field modSpoilers number
---@field modFrontBumper number
---@field modRearBumper number
---@field modSideSkirt number
---@field modExhaust number
---@field modFrame number
---@field modGrille number
---@field modHood number
---@field modFender number
---@field modRightFender number
---@field modRoof number
---@field modRoofLivery number
---@field modEngine number
---@field modBrakes number
---@field modTransmission number
---@field modHorns number
---@field modSuspension number
---@field modArmor number
---@field modTurbo boolean
---@field modSmokeEnabled boolean
---@field modXenon boolean
---@field modFrontWheels number
---@field modCustomFrontWheels boolean
---@field modBackWheels number
---@field modCustomBackWheels boolean
---@field modPlateHolder number
---@field modVanityPlate number
---@field modTrimA number
---@field modOrnaments number
---@field modDashboard number
---@field modDial number
---@field modDoorSpeaker number
---@field modSeats number
---@field modSteeringWheel number
---@field modShifterLeavers number
---@field modAPlate number
---@field modSpeakers number
---@field modTrunk number
---@field modHydrolic number
---@field modEngineBlock number
---@field modAirFilter number
---@field modStruts number
---@field modArchCover number
---@field modAerials number
---@field modTrimB number
---@field modTank number
---@field modWindows number
---@field modLivery number
---@field modLightbar number
---@class ESXVehicleOptionalProperties
---@field model? number
---@field doorsBroken? boolean[]
---@field windowsBroken? boolean[]
---@field tyreBurst? boolean[]
---@field tyresCanBurst? boolean
---@field plate? string
---@field plateIndex? number
---@field bodyHealth? number
---@field engineHealth? number
---@field tankHealth? number
---@field fuelLevel? number
---@field dirtLevel? number
---@field color1? number
---@field color2? number
---@field customPrimaryColor? [number, number, number]|nil
---@field customSecondaryColor? [number, number, number]|nil
---@field pearlescentColor? number
---@field wheelColor? number
---@field dashboardColor? number
---@field interiorColor? number
---@field wheels? number
---@field windowTint? number
---@field xenonColor? number
---@field customXenonColor? number|nil
---@field neonEnabled? boolean[]
---@field neonColor? [number, number, number]
---@field extras? table<string, boolean>
---@field tyreSmokeColor? [number, number, number]
---@field modSpoilers? number
---@field modFrontBumper? number
---@field modRearBumper? number
---@field modSideSkirt? number
---@field modExhaust? number
---@field modFrame? number
---@field modGrille? number
---@field modHood? number
---@field modFender? number
---@field modRightFender? number
---@field modRoof? number
---@field modRoofLivery? number
---@field modEngine? number
---@field modBrakes? number
---@field modTransmission? number
---@field modHorns? number
---@field modSuspension? number
---@field modArmor? number
---@field modTurbo? boolean
---@field modSmokeEnabled? boolean
---@field modXenon? boolean
---@field modFrontWheels? number
---@field modCustomFrontWheels? boolean
---@field modBackWheels? number
---@field modCustomBackWheels? boolean
---@field modPlateHolder? number
---@field modVanityPlate? number
---@field modTrimA? number
---@field modOrnaments? number
---@field modDashboard? number
---@field modDial? number
---@field modDoorSpeaker? number
---@field modSeats? number
---@field modSteeringWheel? number
---@field modShifterLeavers? number
---@field modAPlate? number
---@field modSpeakers? number
---@field modTrunk? number
---@field modHydrolic? number
---@field modEngineBlock? number
---@field modAirFilter? number
---@field modStruts? number
---@field modArchCover? number
---@field modAerials? number
---@field modTrimB? number
---@field modTank? number
---@field modWindows? number
---@field modLivery? number
---@field modLightbar? number
--- This function gets an vehicle's properties.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/getvehicleproperties)
---
--- `CLIENT`
---
---@param vehicle number
---@return ESXVehicleProperties
function ESX.Game.GetVehicleProperties(vehicle) end
--- This function sets an vehicle's properties.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/setvehicleproperties)
---
--- `CLIENT`
---
---@param vehicle number
---@param properties ESXVehicleOptionalProperties
function ESX.Game.SetVehicleProperties(vehicle, properties) end
--- This function draws 3D text on the specified coords. Must be drawn every frame, ideally in a loop. `size` and `font` arguments are optional.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/game/utils/drawtext3d)
---
--- `CLIENT`
---
---@param coords vector3 | vector4 | { x: number, y: number, z: number }
---@param text string
---@param size? number
---@param font? number
function ESX.Game.Utils.DrawText3D(coords, text, size, font) end
--- Returns the account of the specified name, if it exists.
---
--- `CLIENT`
---
---@param account string
---@return ESXPlayerAccount?
function ESX.GetAccount(account) end
--- Shows a context menu with the player's inventory.
---
--- `CLIENT`
---
function ESX.ShowInventory() end
--- This function triggers a server callback. See [ESX.RegisterServerCallback](https://documentation.esx-framework.org/legacy/Server/Functions/registerservercallback/) on registering server callbacks.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Client/functions/triggerservercallback/)
---
--- `CLIENT`
---
---@param eventName string
---@param callback fun(...: any)
---@param ... any
function ESX.TriggerServerCallback(eventName, callback, ...) end
--- This function registers a server callback, which is used for sending Server Data, to a client.
---
--- [View documentation](https://documentation.esx-framework.org/legacy/Server/Functions/registerservercallback/)
---
--- `SERVER`
---
---@param eventName string
---@param callback fun(source: number, cb: fun(...: any), ...: any)
function ESX.RegisterServerCallback(eventName, callback) end
--- This function registers a client callback, which is used for sending Client Data, to the server.
---
--- `CLIENT`
---
---@param eventName string
---@param callback fun(cb: fun(...: any), ...: any)