From 796f6209f5bb05e0c311470270b74fa2ab893752 Mon Sep 17 00:00:00 2001 From: kikkin_yo_azzez <69381115+USBMenus@users.noreply.github.com> Date: Sat, 13 Jul 2024 06:41:58 -0500 Subject: [PATCH] more player stats lua bindings (#3325) get_player_money get_player_wallet get_player_bank get_player_language_id get_player_language_name --- docs/lua/tables/network.md | 79 +++++++++++++++++++++++++++++++++ src/lua/bindings/network.cpp | 86 +++++++++++++++++++++++++++++++++++- 2 files changed, 163 insertions(+), 2 deletions(-) diff --git a/docs/lua/tables/network.md b/docs/lua/tables/network.md index 3c3e8334..beaccdf2 100644 --- a/docs/lua/tables/network.md +++ b/docs/lua/tables/network.md @@ -177,6 +177,9 @@ Call get_player_rank(playerID) - **Parameters:** - `pid` (int) +- **Returns:** + - `int`: Returns an integer which contains the players rank. + **Example Usage:** ```lua network.get_player_rank(pid) @@ -189,9 +192,85 @@ Call get_player_rp(playerID) - **Parameters:** - `pid` (int) +- **Returns:** + - `int`: Returns an integer which contains the players rp. + **Example Usage:** ```lua network.get_player_rp(pid) ``` +### `get_player_money(pid)` +Call get_player_money(playerID) + +- **Parameters:** + - `pid` (int) + +- **Returns:** + - `int`: Returns an integer which contains the players money. + +**Example Usage:** +```lua +network.get_player_money(pid) +``` + +### `get_player_wallet(pid)` + +Call get_player_wallet(playerID) + +- **Parameters:** + - `pid` (int) + +- **Returns:** + - `int`: Returns an integer which contains the players wallet. + +**Example Usage:** +```lua +network.get_player_wallet(pid) +``` + +### `get_player_bank(pid)` + +Call get_player_bank(playerID) + +- **Parameters:** + - `pid` (int) + +- **Returns:** + - `int`: Returns an integer which contains the players bank. + +**Example Usage:** +```lua +network.get_player_bank(pid) +``` + +### `get_player_language_id(pid)` + +Call get_player_language_id(playerID) + +- **Parameters:** + - `pid` (int) + +- **Returns:** + - `int`: Returns an integer which contains the players language id. + +**Example Usage:** +```lua +network.get_player_language_id(pid) +``` + +### `get_player_language_name(pid)` + +Call get_player_language_name(playerID) + +- **Parameters:** + - `pid` (int) + +- **Returns:** + - `string`: Returns a string which contains the players language name. + +**Example Usage:** +```lua +network.get_player_language_name(pid) +``` \ No newline at end of file diff --git a/src/lua/bindings/network.cpp b/src/lua/bindings/network.cpp index 721859a0..01a80a9c 100644 --- a/src/lua/bindings/network.cpp +++ b/src/lua/bindings/network.cpp @@ -1,6 +1,7 @@ #include "network.hpp" #include "../../script.hpp" +#include "core/data/language_codes.hpp" #include "core/scr_globals.hpp" #include "hooking/hooking.hpp" #include "pointers.hpp" @@ -12,6 +13,7 @@ #include "util/system.hpp" #include "util/teleport.hpp" #include