diff --git a/docs/lua/infraction.md b/docs/lua/infraction.md index cfecd54a..169d52e4 100644 --- a/docs/lua/infraction.md +++ b/docs/lua/infraction.md @@ -7,7 +7,7 @@ All the infraction from the menu are listed below, used as parameter for adding network.flag_player_as_modder(player_index, infraction.CUSTOM_REASON, "My custom reason on why the player is flagged as a modder") ``` -## Infraction Count: 13 +## Infraction Count: 15 ### `DESYNC_PROTECTION` ### `TRIGGERED_ANTICHEAT` @@ -22,3 +22,5 @@ network.flag_player_as_modder(player_index, infraction.CUSTOM_REASON, "My custom ### `SUPER_JUMP` ### `UNDEAD_OTR` ### `CUSTOM_REASON` +### `CHAT_SPAM` +### `SENT_MODDER_BEACONS` diff --git a/docs/lua/tables/self.md b/docs/lua/tables/self.md new file mode 100644 index 00000000..3acc6a3f --- /dev/null +++ b/docs/lua/tables/self.md @@ -0,0 +1,57 @@ +# Table: self + +Table for retrieving data or info about our own player object. + +## Functions (5) + +### `get_ped()` + +- **Returns:** + - `integer`: Script handle of our ped. + +**Example Usage:** +```lua +integer = self.get_ped() +``` + +### `get_id()` + +- **Returns:** + - `integer`: Our player id. + +**Example Usage:** +```lua +integer = self.get_id() +``` + +### `get_ped()` + +- **Returns:** + - `vec3`: Position of our ped. + +**Example Usage:** +```lua +vec3 = self.get_ped() +``` + +### `get_ped()` + +- **Returns:** + - `vec3`: Rotation of our ped. + +**Example Usage:** +```lua +vec3 = self.get_ped() +``` + +### `get_ped()` + +- **Returns:** + - `integer`: Script handle of our current vehicle. + +**Example Usage:** +```lua +integer = self.get_ped() +``` + + diff --git a/docs/lua/tabs.md b/docs/lua/tabs.md index 7fb15a7b..52e56f33 100644 --- a/docs/lua/tabs.md +++ b/docs/lua/tabs.md @@ -13,7 +13,7 @@ end) For a complete list of available gui functions, please refer to the tab class documentation and the gui table documentation. -## Tab Count: 47 +## Tab Count: 49 ### `GUI_TAB_SELF` ### `GUI_TAB_WEAPONS` @@ -42,6 +42,8 @@ For a complete list of available gui functions, please refer to the tab class do ### `GUI_TAB_VFX` ### `GUI_TAB_XML_MAPS` ### `GUI_TAB_NETWORK` +### `GUI_TAB_CHAT` +### `GUI_TAB_NETWORK_CONTROLS` ### `GUI_TAB_MISSIONS` ### `GUI_TAB_SPOOFING` ### `GUI_TAB_PLAYER_DATABASE` diff --git a/src/lua/bindings/self.cpp b/src/lua/bindings/self.cpp index a0dfeeab..8e270e53 100644 --- a/src/lua/bindings/self.cpp +++ b/src/lua/bindings/self.cpp @@ -5,26 +5,50 @@ namespace lua_self = self; namespace lua::self { + // Lua API: Table + // Name: self + // Table for retrieving data or info about our own player object. + + // Lua API: Function + // Table: self + // Name: get_ped + // Returns: integer: Script handle of our ped. static Ped get_ped() { return lua_self::ped; } + // Lua API: Function + // Table: self + // Name: get_id + // Returns: integer: Our player id. static Player get_id() { return lua_self::id; } + // Lua API: Function + // Table: self + // Name: get_ped + // Returns: vec3: Position of our ped. static Vector3 get_pos() { return lua_self::pos; } + // Lua API: Function + // Table: self + // Name: get_ped + // Returns: vec3: Rotation of our ped. static Vector3 get_rot() { return lua_self::rot; } + // Lua API: Function + // Table: self + // Name: get_ped + // Returns: integer: Script handle of our current vehicle. static Vehicle get_veh() { return lua_self::veh;