|
1 | | ----@class ESXAccount |
2 | | ----@field name string # Account name (e.g., "bank", "money"). |
3 | | ----@field money number # Current balance in this account. |
4 | | ----@field label string # Human-readable label for the account. |
5 | | ----@field round boolean # Whether amounts are rounded for display. |
6 | | ----@field index number # Index of the account in the player's accounts list. |
7 | | - |
8 | | ----@class ESXItem |
9 | | ----@field name string # Item identifier (internal name). |
10 | | ----@field label string # Display name of the item. |
11 | | ----@field weight number # Weight of a single unit of the item. |
12 | | ----@field usable boolean # Whether the item can be used. |
13 | | ----@field rare boolean # Whether the item is rare. |
14 | | ----@field canRemove boolean # Whether the item can be removed from inventory. |
15 | | - |
16 | | ----@class ESXInventoryItem:ESXItem |
17 | | ----@field count number # Number of this item in the player's inventory. |
18 | | - |
19 | | ----@class ESXJob |
20 | | ----@field id number # Job ID. |
21 | | ----@field name string # Job internal name. |
22 | | ----@field label string # Job display label. |
23 | | ----@field grade number # Current grade/rank number. |
24 | | ----@field grade_name string # Name of the current grade. |
25 | | ----@field grade_label string # Label of the current grade. |
26 | | ----@field grade_salary number # Salary for the current grade. |
27 | | ----@field skin_male table # Skin configuration for male characters. |
28 | | ----@field skin_female table # Skin configuration for female characters. |
29 | | ----@field onDuty boolean? # Whether the player is currently on duty. |
30 | | - |
31 | | ----@class ESXWeapon |
32 | | ----@field name string # Weapon identifier (internal name). |
33 | | ----@field label string # Weapon display name. |
34 | | - |
35 | | ----@class ESXInventoryWeapon:ESXWeapon |
36 | | ----@field ammo number # Amount of ammo in the weapon. |
37 | | ----@field components string[] # List of components attached to the weapon. |
38 | | ----@field tintIndex number # Current weapon tint index. |
39 | | - |
40 | | ----@class ESXWeaponComponent |
41 | | ----@field name string # Component identifier (internal name). |
42 | | ----@field label string # Component display name. |
43 | | ----@field hash string|number # Component hash or identifier. |
44 | | - |
45 | | ----@class StaticPlayer |
46 | | ----@field src number # Player's server ID. |
47 | | ---- Money Functions |
48 | | ----@field setMoney fun(money: number) # Set player's cash balance. |
49 | | ----@field getMoney fun(): number # Get player's current cash balance. |
50 | | ----@field addMoney fun(money: number, reason: string) # Add money to the player's cash balance. |
51 | | ----@field removeMoney fun(money: number, reason: string) # Remove money from the player's cash balance. |
52 | | ----@field setAccountMoney fun(accountName: string, money: number, reason?: string) # Set specific account balance. |
53 | | ----@field addAccountMoney fun(accountName: string, money: number, reason?: string) # Add money to an account. |
54 | | ----@field removeAccountMoney fun(accountName: string, money: number, reason?: string) # Remove money from an account. |
55 | | ----@field getAccount fun(account: string): ESXAccount? # Get account data by name. |
56 | | ----@field getAccounts fun(minimal?: boolean): ESXAccount[]|table<string,number> # Get all accounts, optionally minimal. |
57 | | ---- Inventory Functions |
58 | | ----@field getInventory fun(minimal?: boolean): ESXInventoryItem[]|table<string,number> # Get inventory, optionally minimal. |
59 | | ----@field getInventoryItem fun(itemName: string): ESXInventoryItem? # Get a specific item from inventory. |
60 | | ----@field addInventoryItem fun(itemName: string, count: number) # Add items to inventory. |
61 | | ----@field removeInventoryItem fun(itemName: string, count: number) # Remove items from inventory. |
62 | | ----@field setInventoryItem fun(itemName: string, count: number) # Set item count in inventory. |
63 | | ----@field getWeight fun(): number # Get current carried weight. |
64 | | ----@field getMaxWeight fun(): number # Get maximum carry weight. |
65 | | ----@field setMaxWeight fun(newWeight: number) # Set maximum carry weight. |
66 | | ----@field canCarryItem fun(itemName: string, count: number): boolean # Check if player can carry more of an item. |
67 | | ----@field canSwapItem fun(firstItem: string, firstItemCount: number, testItem: string, testItemCount: number): boolean # Check if items can be swapped. |
68 | | ----@field hasItem fun(item: string): ESXInventoryItem|false, number? # Check if player has an item. |
69 | | ----@field getLoadout fun(minimal?: boolean): ESXInventoryWeapon[]|table<string, {ammo:number, tintIndex?:number, components?:string[]}> # Get player's weapon loadout. |
70 | | ---- Job Functions |
71 | | ----@field getJob fun(): ESXJob # Get player's current job. |
72 | | ----@field setJob fun(newJob: string, grade: string, onDuty?: boolean) # Set player's job and grade. |
73 | | ----@field setGroup fun(newGroup: string) # Set player's permission group. |
74 | | ----@field getGroup fun(): string # Get player's permission group. |
75 | | ---- Weapon Functions |
76 | | ----@field addWeapon fun(weaponName: string, ammo: number) # Give player a weapon. |
77 | | ----@field removeWeapon fun(weaponName: string) # Remove weapon from player. |
78 | | ----@field hasWeapon fun(weaponName: string): boolean # Check if player has a weapon. |
79 | | ----@field getWeapon fun(weaponName: string): number?, table? # Get weapon ammo & components. |
80 | | ----@field addWeaponAmmo fun(weaponName: string, ammoCount: number) # Add ammo to a weapon. |
81 | | ----@field removeWeaponAmmo fun(weaponName: string, ammoCount: number) # Remove ammo from a weapon. |
82 | | ----@field updateWeaponAmmo fun(weaponName: string, ammoCount: number) # Update ammo count for a weapon. |
83 | | ----@field addWeaponComponent fun(weaponName: string, weaponComponent: string) # Add component to weapon. |
84 | | ----@field removeWeaponComponent fun(weaponName: string, weaponComponent: string) # Remove component from weapon. |
85 | | ----@field hasWeaponComponent fun(weaponName: string, weaponComponent: string): boolean # Check if weapon has component. |
86 | | ----@field setWeaponTint fun(weaponName: string, weaponTintIndex: number) # Set weapon tint. |
87 | | ----@field getWeaponTint fun(weaponName: string): number # Get weapon tint. |
88 | | ---- Player State Functions |
89 | | ----@field getIdentifier fun(): string # Get player's unique identifier. |
90 | | ----@field getSSN fun(): string # Get player's social security number. |
91 | | ----@field getSource fun(): number # Get player source/server ID. |
92 | | ----@field getPlayerId fun(): number # Alias for getSource. |
93 | | ----@field getName fun(): string # Get player's name. |
94 | | ----@field setName fun(newName: string) # Set player's name. |
95 | | ----@field setCoords fun(coordinates: vector4|vector3|table) # Teleport player to coordinates. |
96 | | ----@field getCoords fun(vector?: boolean, heading?: boolean): vector3|vector4|table # Get player's coordinates. |
97 | | ----@field isAdmin fun(): boolean # Check if player is admin. |
98 | | ----@field kick fun(reason: string) # Kick player from server. |
99 | | ----@field getPlayTime fun(): number # Get total playtime in seconds. |
100 | | ----@field set fun(k: string, v: any) # Set custom variable. |
101 | | ----@field get fun(k: string): any # Get custom variable. |
102 | | ----@field updatePlayerData fun(key: string, value: any) # Update player data |
103 | | ---- Metadata Functions |
104 | | ----@field getMeta fun(index?: string, subIndex?: string|table): any # Get metadata value(s). |
105 | | ----@field setMeta fun(index: string, value: any, subValue?: any) # Set metadata value(s). |
106 | | ----@field clearMeta fun(index: string, subValues?: string|table) # Clear metadata value(s). |
107 | | ---- Notification Functions |
108 | | ----@field showNotification fun(msg: string, notifyType?: string, length?: number, title?: string, position?: string) # Show a simple notification. |
109 | | ----@field showAdvancedNotification fun(sender: string, subject: string, msg: string, textureDict: string, iconType: string, flash: boolean, saveToBrief: boolean, hudColorIndex: number) # Show advanced notification. |
110 | | ----@field showHelpNotification fun(msg: string, thisFrame?: boolean, beep?: boolean, duration?: number) # Show help notification. |
111 | | ---- Misc Functions |
112 | | ----@field togglePaycheck fun(toggle: boolean) # Enable/disable paycheck. |
113 | | ----@field isPaycheckEnabled fun(): boolean # Check if paycheck is enabled. |
114 | | ----@field executeCommand fun(command: string) # Execute a server command. |
115 | | ----@field triggerEvent fun(eventName: string, ...) # Trigger client event for this player. |
116 | | - |
117 | | - |
118 | | ----@class xPlayer:StaticPlayer |
119 | | ---- Properties |
120 | | ----@field accounts ESXAccount[] # Array of the player's accounts. |
121 | | ----@field coords table # Player's coordinates {x, y, z, heading}. |
122 | | ----@field group string # Player permission group. |
123 | | ----@field identifier string # Unique identifier (usually Steam or license). |
124 | | ----@field license string # Player license string. |
125 | | ----@field inventory ESXInventoryItem[] # Player's inventory items. |
126 | | ----@field job ESXJob # Player's current job. |
127 | | ----@field loadout ESXInventoryWeapon[] # Player's current weapons. |
128 | | ----@field name string # Player's display name. |
129 | | ----@field playerId number # Player's ID (server ID). |
130 | | ----@field source number # Player's source (alias for playerId). |
131 | | ----@field variables table # Custom player variables. |
132 | | ----@field weight number # Current carried weight. |
133 | | ----@field maxWeight number # Maximum carry weight. |
134 | | ----@field metadata table # Custom metadata table. |
135 | | ----@field lastPlaytime number # Last recorded playtime in seconds. |
136 | | ----@field paycheckEnabled boolean # Whether paycheck is enabled. |
137 | | ----@field admin boolean # Whether the player is an admin. |
138 | | - |
139 | 1 | ---@param playerId number |
140 | 2 | ---@param identifier string |
141 | 3 | ---@param ssn string |
|
0 commit comments