Merge branch 'master' into fix-cache-openfile-fail
This commit is contained in:
commit
6b07b3130b
@ -19,7 +19,6 @@ AlwaysBreakTemplateDeclarations: 'Yes'
|
||||
BinPackArguments: 'false'
|
||||
BinPackParameters: 'true'
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Allman
|
||||
BreakBeforeTernaryOperators: 'false'
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakInheritanceList: AfterColon
|
||||
|
38
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
38
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -52,6 +52,44 @@ body:
|
||||
- Other (please mention in "Additional context")
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Language
|
||||
description: Which language do you have GTA 5 set to?
|
||||
multiple: false
|
||||
options:
|
||||
- English
|
||||
- French
|
||||
- Italian
|
||||
- German
|
||||
- Spanish
|
||||
- Japanese
|
||||
- Russian
|
||||
- Polish
|
||||
- Brazilian Portuguese
|
||||
- Traditional Chinese
|
||||
- Simplified Chinese
|
||||
- Latin American Spanish
|
||||
- Korean
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: YimMenu Language
|
||||
description: Which language do you use with YimMenu?
|
||||
multiple: false
|
||||
options:
|
||||
- English (US)
|
||||
- Español (España)
|
||||
- Français (FR)
|
||||
- Italiano (IT)
|
||||
- Portuguese (BR)
|
||||
- Русский (RU)
|
||||
- Chinese (CN)
|
||||
- Chinese (TW)
|
||||
- Korean (KR)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -1,6 +1,16 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- src/**
|
||||
- cmake/**
|
||||
- CMakeLists.txt
|
||||
- .github/workflows/ci.yml
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
|
12
.github/workflows/nightly.yml
vendored
12
.github/workflows/nightly.yml
vendored
@ -6,6 +6,10 @@ on:
|
||||
- cron: '0 14 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: nightly
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_nightly:
|
||||
runs-on: [self-hosted, Windows]
|
||||
@ -27,16 +31,18 @@ jobs:
|
||||
arch: amd64
|
||||
|
||||
- name: Generate CMake project
|
||||
run: cmake -D CMAKE_BUILD_TYPE=Release -S. -Bbuild -G Ninja
|
||||
run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -S. -Bbuild -G Ninja
|
||||
|
||||
- name: Build 64bit release DLL
|
||||
run: cmake --build ./build --config Release --target YimMenu --
|
||||
run: cmake --build ./build --config RelWithDebInfo --target YimMenu --
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: binary
|
||||
path: build/YimMenu.dll
|
||||
path: |
|
||||
build/YimMenu.dll
|
||||
build/YimMenu.pdb
|
||||
|
||||
- name: Generate Build Info
|
||||
id: var
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@ __pycache__/
|
||||
*.ipch
|
||||
*.gch
|
||||
*.pch
|
||||
*.pyc
|
||||
|
||||
# generated by CMAKE
|
||||
version.cpp
|
@ -2,23 +2,26 @@ cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(YimMenu CXX ASM_MASM)
|
||||
|
||||
if (NOT MSVC)
|
||||
message(FATAL_ERROR "Unsupported compiler used '${CMAKE_CXX_COMPILER_ID}', YimMenu only supports MSVC.")
|
||||
endif()
|
||||
|
||||
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
|
||||
|
||||
# Git commit embed
|
||||
include(scripts/git.cmake)
|
||||
include(cmake/git.cmake)
|
||||
|
||||
# Fetch modules
|
||||
message("\nFetching modules")
|
||||
include(scripts/minhook.cmake)
|
||||
include(scripts/async-logger.cmake)
|
||||
include(scripts/pugixml.cmake)
|
||||
include(scripts/json.cmake)
|
||||
include(scripts/cpr.cmake)
|
||||
include(scripts/zydis.cmake)
|
||||
include(scripts/lua.cmake)
|
||||
include(scripts/imgui.cmake)
|
||||
include(cmake/minhook.cmake)
|
||||
include(cmake/async-logger.cmake)
|
||||
include(cmake/pugixml.cmake)
|
||||
include(cmake/json.cmake)
|
||||
include(cmake/cpr.cmake)
|
||||
include(cmake/lua.cmake)
|
||||
include(cmake/imgui.cmake)
|
||||
message("\nFetching custom modules")
|
||||
include(scripts/gtav-classes.cmake)
|
||||
include(cmake/gtav-classes.cmake)
|
||||
|
||||
|
||||
# YimMenu
|
||||
@ -34,6 +37,8 @@ file(GLOB_RECURSE SRC_MAIN
|
||||
|
||||
if (MSVC)
|
||||
add_compile_options(/bigobj)
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
else ()
|
||||
add_compile_options(-Wa,-mbig-obj)
|
||||
endif ()
|
||||
@ -50,10 +55,11 @@ target_include_directories(YimMenu PRIVATE
|
||||
"${json_SOURCE_DIR}/single_include"
|
||||
"${gtav_classes_SOURCE_DIR}"
|
||||
"${imgui_SOURCE_DIR}"
|
||||
"${minhook_SOURCE_DIR}/src/hde"
|
||||
)
|
||||
|
||||
target_precompile_headers(YimMenu PRIVATE "${SRC_DIR}/common.hpp")
|
||||
target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis lua_static)
|
||||
target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr lua_static)
|
||||
|
||||
# Warnings as errors
|
||||
set_property(TARGET YimMenu PROPERTY COMPILE_WARNING_AS_ERROR ON)
|
||||
@ -63,3 +69,15 @@ add_compile_definitions(YimMenu
|
||||
"NOMINMAX"
|
||||
"WIN32_LEAN_AND_MEAN"
|
||||
)
|
||||
|
||||
# Optimizations
|
||||
if(MSVC)
|
||||
if(OPTIMIZE)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS
|
||||
"${CMAKE_MODULE_LINKER_FLAGS} /LTCG /OPT:REF,ICF /GUARD:NO")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Oi /Ot /Oy /Ob3 /sdl- /GL /GF /GS- /Gw")
|
||||
string(REPLACE "/Ob1" "/Ob3" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,15 +1,39 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": ""
|
||||
}
|
||||
]
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Release-FastCompile",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"variables": [ {"name": "OPTIMIZE", "value": "YES", "type": "BOOL"} ]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": []
|
||||
}
|
||||
]
|
||||
}
|
38
cmake/README.md
Normal file
38
cmake/README.md
Normal file
@ -0,0 +1,38 @@
|
||||
# CMake Scripts
|
||||
|
||||
This folder contains all external dependencies that YimMenu requires, this README should explain some of the things you should know.
|
||||
|
||||
## Updating dependencies
|
||||
|
||||
Most cmake files in this folder will look a bit as follows:
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
dependency_name
|
||||
GIT_REPOSITORY https://github.com/example/repo.git
|
||||
GIT_TAG 902ab63e0a771547961e132ccc0700d62e2a1423
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
message("<dependency_name>")
|
||||
FetchContent_MakeAvailable(dependency_name)
|
||||
set_property(TARGET dependency_target PROPERTY CXX_STANDARD 23)
|
||||
```
|
||||
|
||||
There's a `GIT_TAG` in there that defines which specific version of the dependency we rely on, for some dependencies this will be a hash `902ab63e0a771547961e132ccc0700d62e2a1423` for others it will be just a version number (it's important to note that there must be a tag/release associated with it).
|
||||
|
||||
Examples on when to use what, for dependencies like ImGui we're best off using actually versioned releases as these have been "vetted" by the developer as release worthy, it will prevent us from relying on some random experimental release that exists on the ImGui master branch at that date and time. Others like Yimura/GTAV-Classes are updated frequently (rolling releases) and it would prove pointless to rely on versioning in this environment as such we rely on commit hashes directly.
|
||||
|
||||
## Different Dependencies
|
||||
|
||||
YimMenu contains many different dependencies and not all CMake scripts under this folder are used to fetch dependencies, some server a utilitarian function.
|
||||
|
||||
- `async-logger.cmake` : Library based on glog updated to support more modern C++ syntax
|
||||
- `cpr.cmake` : Allows YimMenu to make connections to the internet and fetch data (mainly used for translations)
|
||||
- `git.cmake` : Not a dependency, it's responsible for updating the git commit hash and git commit date the binary was built on
|
||||
- `gtav-classes.cmake` : A collection of GTA V classes reverse engineered by the community
|
||||
- `imgui.cmake` : The UI library used by YimMenu
|
||||
- `json.cmake` : Allows YimMenu to parse json files and load them in as native C++ objects
|
||||
- `lua.cmake` : Self-explanatory, implements a Lua runtime and allows YimMenu to expose functions to Lua directly
|
||||
- `minhook.cmake` : Allows us to detour hook functions in GTA V
|
||||
- `piguxml.cmake` : Xml parser used for XML vehicles and maps
|
@ -1,12 +1,12 @@
|
||||
include(FetchContent)
|
||||
|
||||
message("AsyncLogger")
|
||||
FetchContent_Declare(
|
||||
AsyncLogger
|
||||
GIT_REPOSITORY https://github.com/Yimura/AsyncLogger.git
|
||||
GIT_TAG v0.0.6
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(AsyncLogger)
|
||||
|
||||
set_property(TARGET AsyncLogger PROPERTY CXX_STANDARD 23)
|
||||
include(FetchContent)
|
||||
|
||||
message("AsyncLogger")
|
||||
FetchContent_Declare(
|
||||
AsyncLogger
|
||||
GIT_REPOSITORY https://github.com/Yimura/AsyncLogger.git
|
||||
GIT_TAG v0.0.6
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(AsyncLogger)
|
||||
|
||||
set_property(TARGET AsyncLogger PROPERTY CXX_STANDARD 23)
|
@ -5,7 +5,7 @@ set(CURL_DISABLE_TESTS OFF)
|
||||
FetchContent_Declare(
|
||||
cpr
|
||||
GIT_REPOSITORY https://github.com/libcpr/cpr.git
|
||||
GIT_TAG 1986262ba4e0cb052161e9e7919aef5ef08217f0
|
||||
GIT_TAG 1.10.5
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
message("cpr")
|
@ -3,7 +3,7 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
gtav_classes
|
||||
GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git
|
||||
GIT_TAG 3c7763fcf996f53f891e40f12bbfa8115fd612a7
|
||||
GIT_TAG 09a586011a296cf8ce3ffb9c15db7ce474ea4363
|
||||
GIT_PROGRESS TRUE
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
@ -2,7 +2,7 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
imgui
|
||||
GIT_REPOSITORY https://github.com/ocornut/imgui.git
|
||||
GIT_TAG 94c46d74869ec991c101c187088da0f25d6c8e40
|
||||
GIT_TAG v1.90
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
message("ImGui")
|
@ -3,4 +3,5 @@
|
||||
## Inherit from 1 class: base_text_element
|
||||
|
||||
Class representing a gui button.
|
||||
Refer to the tab class documentation for more info (tab:add_button(name, callback))
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
# Class: sameline
|
||||
|
||||
Class for ImGui::SameLine() - Puts a sameline between widgets or groups to layout them horizontally.
|
||||
Refer to the tab class documentation for more info (tab:add_sameline())
|
||||
|
||||
|
@ -11,7 +11,15 @@ command.call_player(somePlayerIndex, "spawn", {joaat("adder")})
|
||||
|
||||
For a complete list of available command functions, please refer to the command table documentation.
|
||||
|
||||
## Command Count: 212
|
||||
## Command Count: 213
|
||||
|
||||
### bailkick
|
||||
BAIL_KICK_DESC
|
||||
Arg Count: 1
|
||||
|
||||
### bailkickall
|
||||
BAIL_KICK_DESC
|
||||
Arg Count: 0
|
||||
|
||||
### breakup
|
||||
BREAKUP_KICK_DESC
|
||||
@ -53,10 +61,6 @@ Arg Count: 1
|
||||
SCRIPT_HOST_KICK_DESC
|
||||
Arg Count: 1
|
||||
|
||||
### multikick
|
||||
MULTI_KICK_DESC
|
||||
Arg Count: 1
|
||||
|
||||
### clearwanted
|
||||
CLEAR_WANTED_LEVEL_DESC
|
||||
Arg Count: 1
|
||||
|
23
docs/lua/infraction.md
Normal file
23
docs/lua/infraction.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Infraction
|
||||
|
||||
All the infraction from the menu are listed below, used as parameter for adding an infraction to a given player, for flagging them as modder.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
network.flag_player_as_modder(player_index, infraction.CUSTOM_REASON, "My custom reason on why the player is flagged as a modder")
|
||||
```
|
||||
|
||||
## Infraction Count: 12
|
||||
|
||||
### `TRIGGERED_ANTICHEAT`
|
||||
### `TRIED_CRASH_PLAYER`
|
||||
### `TRIED_KICK_PLAYER`
|
||||
### `ATTACKING_WITH_GODMODE`
|
||||
### `ATTACKING_WITH_INVISIBILITY`
|
||||
### `ATTACKING_WHEN_HIDDEN_FROM_PLAYER_LIST`
|
||||
### `SPOOFED_DATA`
|
||||
### `SPOOFED_HOST_TOKEN`
|
||||
### `INVALID_PLAYER_MODEL`
|
||||
### `SUPER_JUMP`
|
||||
### `UNDEAD_OTR`
|
||||
### `CUSTOM_REASON`
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table for manipulating GTA entities.
|
||||
|
||||
## Functions (3)
|
||||
## Functions (4)
|
||||
|
||||
### `get_all_vehicles_as_handles()`
|
||||
|
||||
@ -34,4 +34,20 @@ table<int, int> = entities.get_all_peds_as_handles()
|
||||
table<int, int> = entities.get_all_objects_as_handles()
|
||||
```
|
||||
|
||||
### `take_control_of(entity, try_count)`
|
||||
|
||||
Must be called from a script (script.run_in_fiber for example)
|
||||
|
||||
- **Parameters:**
|
||||
- `entity` (Entity): Script handle of the entity we are trying to take control of.
|
||||
- `try_count` (integer): Optional. Number of time we'll try taking control of the entity. Default to 300.
|
||||
|
||||
- **Returns:**
|
||||
- `boolean`: Returns true if we successfully got control of the entity.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
boolean = entities.take_control_of(entity, try_count)
|
||||
```
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table containing functions for manipulating gta script globals.
|
||||
|
||||
## Functions (9)
|
||||
## Functions (11)
|
||||
|
||||
### `get_int(global)`
|
||||
|
||||
@ -64,6 +64,21 @@ Retrieves a string global value.
|
||||
string = globals.get_string(global)
|
||||
```
|
||||
|
||||
### `get_vec3(global)`
|
||||
|
||||
Retrieves a Vector3 global value.
|
||||
|
||||
- **Parameters:**
|
||||
- `global` (integer): index of the global
|
||||
|
||||
- **Returns:**
|
||||
- `Vector3`: value of the global
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
Vector3 = globals.get_vec3(global)
|
||||
```
|
||||
|
||||
### `set_int(global, val)`
|
||||
|
||||
Sets an int global value.
|
||||
@ -116,6 +131,19 @@ Sets a string global value.
|
||||
globals.set_string(global, str)
|
||||
```
|
||||
|
||||
### `set_vec3(global, param)`
|
||||
|
||||
Sets a Vector3 global value.
|
||||
|
||||
- **Parameters:**
|
||||
- `global` (integer): index of the global
|
||||
- `param` (Vector3): new value for the global
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
globals.set_vec3(global, param)
|
||||
```
|
||||
|
||||
### `get_pointer(global)`
|
||||
|
||||
Retrieves a pointer global.
|
||||
|
27
docs/lua/tables/io.md
Normal file
27
docs/lua/tables/io.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Table: io
|
||||
|
||||
Table for file manipulation. Modified for security purposes.
|
||||
|
||||
## Functions (2)
|
||||
|
||||
### `open()`
|
||||
|
||||
- **Returns:**
|
||||
- `file_handle`: file handle or nil if can't read / write to the given path.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
file_handle = io.open()
|
||||
```
|
||||
|
||||
### `exists()`
|
||||
|
||||
- **Returns:**
|
||||
- `boolean`: True if the passed file path exists
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
boolean = io.exists()
|
||||
```
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table for manipulating GTA scripts locals.
|
||||
|
||||
## Functions (5)
|
||||
## Functions (9)
|
||||
|
||||
### `get_int(script, index)`
|
||||
|
||||
@ -18,6 +18,20 @@ Table for manipulating GTA scripts locals.
|
||||
integer = locals.get_int(script, index)
|
||||
```
|
||||
|
||||
### `get_uint(script, index)`
|
||||
|
||||
- **Parameters:**
|
||||
- `script` (string): The name of the script
|
||||
- `index` (index): Index of the script local.
|
||||
|
||||
- **Returns:**
|
||||
- `unsigned integer`: The value of the given local.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
unsigned integer = locals.get_uint(script, index)
|
||||
```
|
||||
|
||||
### `get_float(script, index)`
|
||||
|
||||
- **Parameters:**
|
||||
@ -32,6 +46,20 @@ integer = locals.get_int(script, index)
|
||||
float = locals.get_float(script, index)
|
||||
```
|
||||
|
||||
### `get_vec3(script, index)`
|
||||
|
||||
- **Parameters:**
|
||||
- `script` (string): The name of the script
|
||||
- `index` (index): Index of the script local.
|
||||
|
||||
- **Returns:**
|
||||
- `Vector3`: The value of the given local.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
Vector3 = locals.get_vec3(script, index)
|
||||
```
|
||||
|
||||
### `set_int(script, index, val)`
|
||||
|
||||
- **Parameters:**
|
||||
@ -44,6 +72,18 @@ float = locals.get_float(script, index)
|
||||
locals.set_int(script, index, val)
|
||||
```
|
||||
|
||||
### `set_int(script, index, val)`
|
||||
|
||||
- **Parameters:**
|
||||
- `script` (string): The name of the script
|
||||
- `index` (index): Index of the script local.
|
||||
- `val` (unsigned integer): The new value of the given local.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
locals.set_int(script, index, val)
|
||||
```
|
||||
|
||||
### `set_float(script, index, val)`
|
||||
|
||||
- **Parameters:**
|
||||
@ -56,6 +96,18 @@ locals.set_int(script, index, val)
|
||||
locals.set_float(script, index, val)
|
||||
```
|
||||
|
||||
### `set_vec3(script, index, val)`
|
||||
|
||||
- **Parameters:**
|
||||
- `script` (string): The name of the script
|
||||
- `index` (index): Index of the script local.
|
||||
- `val` (Vector3): The new value of the given local.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
locals.set_vec3(script, index, val)
|
||||
```
|
||||
|
||||
### `get_pointer(script, index)`
|
||||
|
||||
- **Parameters:**
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table containing all possible events to which you can respond.
|
||||
|
||||
## Fields (6)
|
||||
## Fields (8)
|
||||
|
||||
### `PlayerLeave`
|
||||
|
||||
@ -79,3 +79,27 @@ end)
|
||||
|
||||
- Type: `integer`
|
||||
|
||||
### `MenuUnloaded`
|
||||
|
||||
Event that is triggered when we unload YimMenu.
|
||||
**Example Usage:**
|
||||
```lua
|
||||
event.register_handler(menu_event.MenuUnloaded, function ()
|
||||
log.info("Menu unloaded.")
|
||||
end)
|
||||
```
|
||||
|
||||
- Type: `integer`
|
||||
|
||||
### `ScriptsReloaded`
|
||||
|
||||
Event that is triggered when we reload the Lua scripts.
|
||||
**Example Usage:**
|
||||
```lua
|
||||
event.register_handler(menu_event.ScriptsReloaded, function ()
|
||||
log.info("Scripts reloaded.")
|
||||
end)
|
||||
```
|
||||
|
||||
- Type: `integer`
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table containing helper functions for network related features.
|
||||
|
||||
## Functions (10)
|
||||
## Functions (12)
|
||||
|
||||
### `trigger_script_event(bitset, _args)`
|
||||
|
||||
@ -79,16 +79,18 @@ integer = network.get_selected_player()
|
||||
integer = network.get_selected_database_player_rockstar_id()
|
||||
```
|
||||
|
||||
### `flag_player_as_modder(player_idx)`
|
||||
### `flag_player_as_modder(player_idx, reason, custom_reason)`
|
||||
|
||||
Flags the given player as a modder in our local database.
|
||||
|
||||
- **Parameters:**
|
||||
- `player_idx` (integer): Index of the player.
|
||||
- `reason` (Infraction): Reason why the player is flagged as a modder, if the infraction is CUSTOM_REASON, then the custom_reason string is added in the local database. For a full list of the possible infraction reasons to use, please check the infraction page.
|
||||
- `custom_reason` (string): Optional, required only when the infraction is CUSTOM_REASON. The custom reason why the player is flagged as a modder.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
network.flag_player_as_modder(player_idx)
|
||||
network.flag_player_as_modder(player_idx, reason, custom_reason)
|
||||
```
|
||||
|
||||
### `is_player_flagged_as_modder(player_idx)`
|
||||
@ -104,6 +106,32 @@ network.flag_player_as_modder(player_idx)
|
||||
boolean = network.is_player_flagged_as_modder(player_idx)
|
||||
```
|
||||
|
||||
### `is_player_friend(player_idx)`
|
||||
|
||||
- **Parameters:**
|
||||
- `player_idx` (integer): Index of the player.
|
||||
|
||||
- **Returns:**
|
||||
- `boolean`: Returns true if the given player is a friend.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
boolean = network.is_player_friend(player_idx)
|
||||
```
|
||||
|
||||
### `get_flagged_modder_reason(player_idx)`
|
||||
|
||||
- **Parameters:**
|
||||
- `player_idx` (integer): Index of the player.
|
||||
|
||||
- **Returns:**
|
||||
- `string`: Returns a string which contains the reason(s) why the player is flagged as a modder.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
string = network.get_flagged_modder_reason(player_idx)
|
||||
```
|
||||
|
||||
### `force_script_host(script_name)`
|
||||
|
||||
Try to force ourself to be host for the given GTA Script.
|
||||
|
@ -1,8 +1,9 @@
|
||||
# Table: stats
|
||||
|
||||
Table for manipulating GTA stats.
|
||||
For stats that get prefixed by either `MP0` or `MP1`, you can use `MPX` instead and the menu will resolve to the correct number automatically.
|
||||
|
||||
## Functions (21)
|
||||
## Functions (25)
|
||||
|
||||
### `get_character_index()`
|
||||
|
||||
@ -296,4 +297,52 @@ boolean = stats.set_masked_int(stat_hash, new_value, bit_start, bit_size)
|
||||
boolean = stats.set_masked_int(stat_name, new_value, bit_start, bit_size)
|
||||
```
|
||||
|
||||
### `get_packed_stat_bool(index)`
|
||||
|
||||
- **Parameters:**
|
||||
- `index` (int): packed stat's index
|
||||
|
||||
- **Returns:**
|
||||
- `boolean`: Value of the stat.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
boolean = stats.get_packed_stat_bool(index)
|
||||
```
|
||||
|
||||
### `set_packed_stat_bool(index, value)`
|
||||
|
||||
- **Parameters:**
|
||||
- `index` (int): packed stat's index.
|
||||
- `value` (bool): value to set the packed stat to.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
stats.set_packed_stat_bool(index, value)
|
||||
```
|
||||
|
||||
### `get_packed_stat_int(index)`
|
||||
|
||||
- **Parameters:**
|
||||
- `index` (int): packed stat's index.
|
||||
|
||||
- **Returns:**
|
||||
- `int`: Value of the stat.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
int = stats.get_packed_stat_int(index)
|
||||
```
|
||||
|
||||
### `set_packed_stat_int(index, value)`
|
||||
|
||||
- **Parameters:**
|
||||
- `index` (int): packed stat's index.
|
||||
- `value` (int): value to set the packed stat to.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
stats.set_packed_stat_int(index, value)
|
||||
```
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table for manipulating gta tunables.
|
||||
|
||||
## Functions (6)
|
||||
## Functions (12)
|
||||
|
||||
### `get_int(tunable_name)`
|
||||
|
||||
@ -43,6 +43,45 @@ float = tunables.get_float(tunable_name)
|
||||
boolean = tunables.get_bool(tunable_name)
|
||||
```
|
||||
|
||||
### `get_int(tunable_joaated_value)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
|
||||
- **Returns:**
|
||||
- `integer`: The value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
integer = tunables.get_int(tunable_joaated_value)
|
||||
```
|
||||
|
||||
### `get_float(tunable_joaated_value)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
|
||||
- **Returns:**
|
||||
- `float`: The value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
float = tunables.get_float(tunable_joaated_value)
|
||||
```
|
||||
|
||||
### `get_bool(tunable_joaated_value)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
|
||||
- **Returns:**
|
||||
- `boolean`: The value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
boolean = tunables.get_bool(tunable_joaated_value)
|
||||
```
|
||||
|
||||
### `set_int(tunable_name, val)`
|
||||
|
||||
- **Parameters:**
|
||||
@ -76,4 +115,37 @@ tunables.set_float(tunable_name, val)
|
||||
tunables.set_bool(tunable_name, val)
|
||||
```
|
||||
|
||||
### `set_int(tunable_joaated_value, val)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
- `val` (integer): The new value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
tunables.set_int(tunable_joaated_value, val)
|
||||
```
|
||||
|
||||
### `set_float(tunable_joaated_value, val)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
- `val` (float): The new value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
tunables.set_float(tunable_joaated_value, val)
|
||||
```
|
||||
|
||||
### `set_bool(tunable_joaated_value, val)`
|
||||
|
||||
- **Parameters:**
|
||||
- `tunable_joaated_value` (integer): The joaated value of the tunable.
|
||||
- `val` (boolean): The new value of the given tunable.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
tunables.set_bool(tunable_joaated_value, val)
|
||||
```
|
||||
|
||||
|
||||
|
85
docs/lua/tables/vehicles.md
Normal file
85
docs/lua/tables/vehicles.md
Normal file
@ -0,0 +1,85 @@
|
||||
# Table: vehicles
|
||||
|
||||
Table containing functions for getting information about vehicles in GTA V.
|
||||
|
||||
## Functions (4)
|
||||
|
||||
### `get_vehicle_display_name(vehicle_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(vehicles.get_vehicle_display_name('BTYPE2'))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `vehicle_hash` (Hash): JOAAT hash of the vehicle.
|
||||
|
||||
- **Returns:**
|
||||
- `vehicle_display_string`: String: the in-game display string. If the vehicle is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
vehicle_display_string = vehicles.get_vehicle_display_name(vehicle_hash)
|
||||
```
|
||||
|
||||
### `get_vehicle_display_name(vehicle_name)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(vehicles.get_vehicle_display_name('BTYPE2'))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `vehicle_name` (String): Name of the vehicle.
|
||||
|
||||
- **Returns:**
|
||||
- `vehicle_display_string`: String: the in-game display string. If the vehicle is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
vehicle_display_string = vehicles.get_vehicle_display_name(vehicle_name)
|
||||
```
|
||||
|
||||
### `get_all_vehicles_by_class(vehicle_class)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local sports_classics = vehicles.get_all_vehicles_by_class('Sports Classics')
|
||||
for i = 1, #sports_classics do
|
||||
log.info(sports_classics[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `vehicle_class` (String): The vehicle class.
|
||||
|
||||
- **Returns:**
|
||||
- `vehicles`: table<int, String>: a list of all vehicles that match the class passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
vehicles = vehicles.get_all_vehicles_by_class(vehicle_class)
|
||||
```
|
||||
|
||||
### `get_all_vehicles_by_mfr(manufacturer)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local albanies = vehicles.get_all_vehicles_by_mfr('Albany')
|
||||
for i = 1, #albanies do
|
||||
log.info(albanies[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `manufacturer` (String): The vehicle manufacturer.
|
||||
|
||||
- **Returns:**
|
||||
- `vehicles`: table<int, String>: a list of all vehicles that match the manufacturer passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
vehicles = vehicles.get_all_vehicles_by_mfr(manufacturer)
|
||||
```
|
||||
|
||||
|
204
docs/lua/tables/weapons.md
Normal file
204
docs/lua/tables/weapons.md
Normal file
@ -0,0 +1,204 @@
|
||||
# Table: weapons
|
||||
|
||||
Table containing functions for getting information about weapons in GTA V.
|
||||
|
||||
## Functions (10)
|
||||
|
||||
### `get_weapon_display_name(weapon_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_display_name(joaat('WEAPON_REVOLVER')))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_hash` (Hash): JOAAT hash of the weapon.
|
||||
|
||||
- **Returns:**
|
||||
- `weapon_display_name`: String: the in-game display string. If the weapon is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapon_display_name = weapons.get_weapon_display_name(weapon_hash)
|
||||
```
|
||||
|
||||
### `get_weapon_display_name(weapon_name)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_display_name('WEAPON_REVOLVER'))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_name` (String): Name of the weapon.
|
||||
|
||||
- **Returns:**
|
||||
- `weapon_display_name`: String: the in-game display string. If the weapon is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapon_display_name = weapons.get_weapon_display_name(weapon_name)
|
||||
```
|
||||
|
||||
### `get_all_weapons_of_group_type(group_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local pistols = weapons.get_all_weapons_of_group_type(joaat('GROUP_PISTOL'))
|
||||
for i = 1, #pistols do
|
||||
log.info(pistols[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `group_hash` (Hash): The JOAAT hash of the group the weapon(s) belong to.
|
||||
|
||||
- **Returns:**
|
||||
- `weapons_of_group_type`: table<int, String>: a list of all weapons that match the group hash passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapons_of_group_type = weapons.get_all_weapons_of_group_type(group_hash)
|
||||
```
|
||||
|
||||
### `get_all_weapons_of_group_type(group_name)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local pistols = weapons.get_all_weapons_of_group_type('GROUP_PISTOL')
|
||||
for i = 1, #pistols do
|
||||
log.info(pistols[i])
|
||||
end
|
||||
|
||||
local pistols = weapons.get_all_weapons_of_group_type('PISTOL')
|
||||
for i = 1, #pistols do
|
||||
log.info(pistols[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `group_name` (String): The group the weapon(s) belong to. Can be in either GROUP_ format or not. Parameter is case-insensitive.
|
||||
|
||||
- **Returns:**
|
||||
- `weapons_of_group_type`: table<int, String>: a list of all weapons that match the group hash passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapons_of_group_type = weapons.get_all_weapons_of_group_type(group_name)
|
||||
```
|
||||
|
||||
### `get_all_weapon_components(weapon_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local pistol_attachments = weapons.get_all_weapon_components(joaat('WEAPON_PISTOL'))
|
||||
for i = 1, #pistol_attachments do
|
||||
log.info(pistol_attachments[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_hash` (Hash): The JOAAT hash of the weapon the component(s) belong to.
|
||||
|
||||
- **Returns:**
|
||||
- `weapon_components`: table<int, String>: a list of all components that match the weapon passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapon_components = weapons.get_all_weapon_components(weapon_hash)
|
||||
```
|
||||
|
||||
### `get_all_weapon_components(weapon_name)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
local pistol_attachments = weapons.get_all_weapon_components('WEAPON_PISTOL')
|
||||
for i = 1, #pistol_attachments do
|
||||
log.info(pistol_attachments[i])
|
||||
end
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_name` (String): The weapon the component(s) belong to.
|
||||
|
||||
- **Returns:**
|
||||
- `weapon_components`: table<int, String>: a list of all components that match the weapon passed in. The list can contain anything from 0 to n elements.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
weapon_components = weapons.get_all_weapon_components(weapon_name)
|
||||
```
|
||||
|
||||
### `get_weapon_component_display_name(weapon_component_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_component_display_name(joaat('COMPONENT_PISTOL_CLIP_01')))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_component_hash` (Hash): JOAAT hash of the weapon component.
|
||||
|
||||
- **Returns:**
|
||||
- `component_display_name`: String: the in-game display string. If the component is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
component_display_name = weapons.get_weapon_component_display_name(weapon_component_hash)
|
||||
```
|
||||
|
||||
### `get_weapon_component_display_name(weapon_component)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_component_display_name('COMPONENT_PISTOL_CLIP_01'))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_component` (String): The weapon component.
|
||||
|
||||
- **Returns:**
|
||||
- `component_display_name`: String: the in-game display string. If the component is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
component_display_name = weapons.get_weapon_component_display_name(weapon_component)
|
||||
```
|
||||
|
||||
### `get_weapon_component_display_desc(weapon_component_hash)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_component_display_desc(joaat('COMPONENT_PISTOL_CLIP_01')))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_component_hash` (Hash): JOAAT hash of the weapon component.
|
||||
|
||||
- **Returns:**
|
||||
- `component_display_desc`: String: the in-game display string. If the component is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
component_display_desc = weapons.get_weapon_component_display_desc(weapon_component_hash)
|
||||
```
|
||||
|
||||
### `get_weapon_component_display_desc(weapon_component)`
|
||||
|
||||
- **Example Usage:**
|
||||
```lua
|
||||
log.info(weapons.get_weapon_component_display_desc('COMPONENT_PISTOL_CLIP_01'))
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `weapon_component` (String): The weapon component.
|
||||
|
||||
- **Returns:**
|
||||
- `component_display_desc`: String: the in-game display string. If the component is not found, or the call is made too early, a blank string will be returned. It is guranteed to return a safe value.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
component_display_desc = weapons.get_weapon_component_display_desc(weapon_component)
|
||||
```
|
||||
|
||||
|
@ -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: 44
|
||||
## Tab Count: 47
|
||||
|
||||
### `GUI_TAB_SELF`
|
||||
### `GUI_TAB_WEAPONS`
|
||||
@ -22,6 +22,7 @@ For a complete list of available gui functions, please refer to the tab class do
|
||||
### `GUI_TAB_MOBILE`
|
||||
### `GUI_TAB_OUTFIT_EDITOR`
|
||||
### `GUI_TAB_OUTFIT_SLOTS`
|
||||
### `GUI_TAB_ANIMATIONS`
|
||||
### `GUI_TAB_VEHICLE`
|
||||
### `GUI_TAB_HANDLING`
|
||||
### `GUI_TAB_HANDLING_SEARCH`
|
||||
@ -39,6 +40,7 @@ For a complete list of available gui functions, please refer to the tab class do
|
||||
### `GUI_TAB_BLACKHOLE`
|
||||
### `GUI_TAB_MODEL_SWAPPER`
|
||||
### `GUI_TAB_VFX`
|
||||
### `GUI_TAB_XML_MAPS`
|
||||
### `GUI_TAB_NETWORK`
|
||||
### `GUI_TAB_MISSIONS`
|
||||
### `GUI_TAB_SPOOFING`
|
||||
@ -55,5 +57,6 @@ For a complete list of available gui functions, please refer to the tab class do
|
||||
### `GUI_TAB_REACTION_SETTINGS`
|
||||
### `GUI_TAB_PROTECTION_SETTINGS`
|
||||
### `GUI_TAB_TRANSLATION_SETTINGS`
|
||||
### `GUI_TAB_PROXY_SETTINGS`
|
||||
### `GUI_TAB_DEBUG`
|
||||
### `GUI_TAB_PLAYER`
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"game": {
|
||||
"online": "1.67",
|
||||
"build": "2944"
|
||||
"online": "1.68",
|
||||
"build": "3095"
|
||||
}
|
||||
}
|
39
scripts/README.md
Normal file
39
scripts/README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Scripts
|
||||
|
||||
This directory contains a collection of scripts used to generate certain parts of the code base.
|
||||
|
||||
## Doc Gen
|
||||
|
||||
`doc_gen.py` is used to generate the Lua documentation that's provided by YimMenu.
|
||||
It relies on specifically formatted code comments to generate Lua documentation.
|
||||
|
||||
## Generate Natives
|
||||
|
||||
`generate_natives.py` is responsible for generating the `src/natives.hpp` and `src/invoker/crossmap.hpp` files.
|
||||
|
||||
It takes a `natives.json` from [here](https://github.com/alloc8or/gta5-nativedb-data) and a `crossmap.txt` file which needs follow a certain format of:
|
||||
```csv
|
||||
[first_seen_native_hash]<comma>[current_native_hash]
|
||||
```
|
||||
|
||||
Example:
|
||||
```csv
|
||||
0xE1A0450ED46A7812,0x11FD21BA1B765FE2
|
||||
0x39BE7CEA8D9CC8E6,0x5F7C6361179DFFC4
|
||||
0x3C5FD37B5499582E,0x54BC5E0B6A29AE8A
|
||||
0xE2A99A9B524BEFFF,0x1FDE21A286357401
|
||||
0x51F1A8E48C3D2F6D,0xD1BAD83E70275AEB
|
||||
0x0A6D923DFFC9BD89,0x93693D93BD53ACB1
|
||||
0x112CEF1615A1139F,0x203607236413B185
|
||||
0xD47A2C1BA117471D,0x4F3198DEED415E95
|
||||
0xC2F7FE5309181C7D,0xCFE92984BF3486D5
|
||||
0x23789E777D14CE44,0x2B3725FC402B94A8
|
||||
0x350AA5EBC03D3BD2,0x606408352C7741AD
|
||||
0x498C1E05CE5F7877,0x59E8FA762FB527C5
|
||||
...
|
||||
```
|
||||
|
||||
## Natives Gen
|
||||
|
||||
`natives_gen.py` is used to generate the Lua bindings for all the natives currently present in the menu.
|
||||
It'll read through the `src/natives.hpp` file and generate the appropriate bindings under `src/lua/natives/`.
|
6568
scripts/crossmap.txt
Normal file
6568
scripts/crossmap.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
import os
|
||||
from enum import Enum
|
||||
|
||||
src_folder = "../../src/"
|
||||
src_folder = "../src/"
|
||||
|
||||
lua_api_comment_identifier = "lua api"
|
||||
lua_api_comment_separator = ":"
|
||||
@ -18,6 +18,7 @@ class DocKind(Enum):
|
||||
Constructor = "constructor"
|
||||
Function = "function"
|
||||
Tabs = "tabs"
|
||||
Infraction = "infraction"
|
||||
|
||||
|
||||
class Table:
|
||||
@ -324,7 +325,10 @@ def parse_lua_api_doc(folder_path):
|
||||
.lower()
|
||||
)
|
||||
|
||||
if doc_kind is not DocKind.Tabs:
|
||||
if (
|
||||
doc_kind is not DocKind.Tabs
|
||||
and doc_kind is not DocKind.Infraction
|
||||
):
|
||||
continue
|
||||
|
||||
if doc_kind is not None and "//" in line:
|
||||
@ -367,7 +371,10 @@ def parse_lua_api_doc(folder_path):
|
||||
line,
|
||||
line_lower,
|
||||
)
|
||||
case DocKind.Tabs: parse_tabs_doc(file)
|
||||
case DocKind.Tabs:
|
||||
parse_tabs_doc(file)
|
||||
case DocKind.Infraction:
|
||||
parse_infraction_doc(file)
|
||||
case _:
|
||||
# print("unsupported doc kind: " + str(doc_kind))
|
||||
pass
|
||||
@ -386,6 +393,7 @@ def parse_table_doc(cur_table, line, line_lower):
|
||||
|
||||
return cur_table
|
||||
|
||||
|
||||
def parse_class_doc(cur_class, line, line_lower):
|
||||
if is_lua_doc_comment_startswith(line_lower, "name"):
|
||||
class_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
@ -402,28 +410,43 @@ def parse_class_doc(cur_class, line, line_lower):
|
||||
|
||||
|
||||
def parse_function_doc(cur_function, cur_table, cur_class, line, line_lower):
|
||||
if is_lua_doc_comment_startswith(line_lower, "table") and lua_api_comment_separator in line_lower:
|
||||
if (
|
||||
is_lua_doc_comment_startswith(line_lower, "table")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
table_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_table = make_table(table_name)
|
||||
|
||||
cur_function = Function("Didnt get name yet", cur_table, [], None, "", "")
|
||||
cur_table.functions.append(cur_function)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "class") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "class")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
class_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_class = make_class(class_name)
|
||||
|
||||
cur_function = Function("Didnt get name yet", cur_class, [], None, "", "")
|
||||
cur_class.functions.append(cur_function)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "name") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "name")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
function_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_function.name = function_name
|
||||
|
||||
if function_name not in functions:
|
||||
functions[function_name] = cur_function
|
||||
elif is_lua_doc_comment_startswith(line_lower, "param") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "param")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
parameter = make_parameter_from_doc_line(line)
|
||||
cur_function.parameters.append(parameter)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "return") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "return")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
return_info = line.split(lua_api_comment_separator, 2)
|
||||
try:
|
||||
cur_function.return_type = return_info[1].strip()
|
||||
@ -439,19 +462,28 @@ def parse_function_doc(cur_function, cur_table, cur_class, line, line_lower):
|
||||
|
||||
|
||||
def parse_field_doc(cur_field, cur_table, cur_class, line, line_lower):
|
||||
if is_lua_doc_comment_startswith(line_lower, "table") and lua_api_comment_separator in line_lower:
|
||||
if (
|
||||
is_lua_doc_comment_startswith(line_lower, "table")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
table_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_table = make_table(table_name)
|
||||
|
||||
cur_field = Field("Didnt get name yet", "", "")
|
||||
cur_table.fields.append(cur_field)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "class") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "class")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
class_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_class = make_class(class_name)
|
||||
|
||||
cur_field = Field("Didnt get name yet", "", "")
|
||||
cur_class.fields.append(cur_field)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "field") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "field")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
field_info = line.split(lua_api_comment_separator, 2)
|
||||
cur_field.name = field_info[1].strip()
|
||||
cur_field.type_ = field_info[2].strip()
|
||||
@ -467,13 +499,19 @@ def parse_field_doc(cur_field, cur_table, cur_class, line, line_lower):
|
||||
|
||||
|
||||
def parse_constructor_doc(cur_constructor, cur_class, line, line_lower):
|
||||
if is_lua_doc_comment_startswith(line_lower, "class") and lua_api_comment_separator in line_lower:
|
||||
if (
|
||||
is_lua_doc_comment_startswith(line_lower, "class")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
class_name = line.split(lua_api_comment_separator, 1)[1].strip()
|
||||
cur_class = make_class(class_name)
|
||||
|
||||
cur_constructor = Constructor(cur_class, [], "")
|
||||
cur_class.constructors.append(cur_constructor)
|
||||
elif is_lua_doc_comment_startswith(line_lower, "param") and lua_api_comment_separator in line_lower:
|
||||
elif (
|
||||
is_lua_doc_comment_startswith(line_lower, "param")
|
||||
and lua_api_comment_separator in line_lower
|
||||
):
|
||||
parameter = make_parameter_from_doc_line(line)
|
||||
cur_constructor.parameters.append(parameter)
|
||||
else:
|
||||
@ -485,6 +523,8 @@ def parse_constructor_doc(cur_constructor, cur_class, line, line_lower):
|
||||
|
||||
|
||||
tabs_enum = []
|
||||
|
||||
|
||||
def parse_tabs_doc(file):
|
||||
start_parsing = False
|
||||
for line in file:
|
||||
@ -503,7 +543,29 @@ def parse_tabs_doc(file):
|
||||
continue
|
||||
else:
|
||||
tabs_enum.append(line.replace(",", "").strip())
|
||||
|
||||
|
||||
|
||||
infraction_enum = []
|
||||
|
||||
|
||||
def parse_infraction_doc(file):
|
||||
start_parsing = False
|
||||
for line in file:
|
||||
if "enum class" in line.lower():
|
||||
start_parsing = True
|
||||
continue
|
||||
|
||||
if start_parsing:
|
||||
if "};" in line.lower():
|
||||
return
|
||||
if "{" == line.lower().strip():
|
||||
continue
|
||||
if "//" in line.lower():
|
||||
continue
|
||||
if "" == line.lower().strip():
|
||||
continue
|
||||
else:
|
||||
infraction_enum.append(line.replace(",", "").strip())
|
||||
|
||||
|
||||
def make_parameter_from_doc_line(line):
|
||||
@ -519,13 +581,15 @@ def make_parameter_from_doc_line(line):
|
||||
|
||||
return Parameter(param_name, param_type, param_desc)
|
||||
|
||||
|
||||
def sanitize_description(line):
|
||||
if line.startswith("// ") and line[3] != ' ':
|
||||
if line.startswith("// ") and line[3] != " ":
|
||||
line = line[3:]
|
||||
if line.startswith("//"):
|
||||
line = line[2:]
|
||||
return line.rstrip()
|
||||
|
||||
|
||||
def is_lua_doc_comment_startswith(line_lower, starts_with_text):
|
||||
return line_lower.replace("//", "").strip().startswith(starts_with_text)
|
||||
|
||||
@ -533,24 +597,25 @@ def is_lua_doc_comment_startswith(line_lower, starts_with_text):
|
||||
parse_lua_api_doc(src_folder)
|
||||
|
||||
try:
|
||||
os.makedirs("./tables/")
|
||||
os.makedirs("../docs/lua/tables/")
|
||||
except:
|
||||
pass
|
||||
|
||||
for table_name, table in tables.items():
|
||||
file_name = f"./tables/{table_name}.md"
|
||||
file_name = f"../docs/lua/tables/{table_name}.md"
|
||||
if os.path.exists(file_name):
|
||||
os.remove(file_name)
|
||||
f = open(file_name, "a")
|
||||
f.write(str(table))
|
||||
f = open(file_name, "ba")
|
||||
f.write(bytes(str(table), "UTF8"))
|
||||
f.close()
|
||||
|
||||
tabs_file_name = f"./tabs.md"
|
||||
tabs_file_name = f"../docs/lua/tabs.md"
|
||||
if os.path.exists(tabs_file_name):
|
||||
os.remove(tabs_file_name)
|
||||
f = open(tabs_file_name, "a")
|
||||
|
||||
f.write("""# Tabs
|
||||
f.write(
|
||||
"""# Tabs
|
||||
|
||||
All the tabs from the menu are listed below, used as parameter for adding gui elements to them.
|
||||
|
||||
@ -565,37 +630,63 @@ end)
|
||||
|
||||
For a complete list of available gui functions, please refer to the tab class documentation and the gui table documentation.
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
f.write(f"## Tab Count: {len(tabs_enum)}\n\n")
|
||||
|
||||
# Minus the first, because it's the `NONE` tab, minus the last one because it's for runtime defined tabs.
|
||||
for i in range(1, len(tabs_enum) - 1 ):
|
||||
for i in range(1, len(tabs_enum) - 1):
|
||||
f.write("### `GUI_TAB_" + tabs_enum[i] + "`\n")
|
||||
|
||||
f.close()
|
||||
|
||||
infraction_file_name = f"../docs/lua/infraction.md"
|
||||
if os.path.exists(infraction_file_name):
|
||||
os.remove(infraction_file_name)
|
||||
f = open(infraction_file_name, "a")
|
||||
|
||||
f.write(
|
||||
"""# Infraction
|
||||
|
||||
All the infraction from the menu are listed below, used as parameter for adding an infraction to a given player, for flagging them as modder.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
network.flag_player_as_modder(player_index, infraction.CUSTOM_REASON, "My custom reason on why the player is flagged as a modder")
|
||||
```
|
||||
|
||||
"""
|
||||
)
|
||||
|
||||
f.write(f"## Infraction Count: {len(infraction_enum)}\n\n")
|
||||
|
||||
for i in range(0, len(infraction_enum)):
|
||||
f.write("### `" + infraction_enum[i] + "`\n")
|
||||
|
||||
f.close()
|
||||
|
||||
try:
|
||||
os.makedirs("./classes/")
|
||||
os.makedirs("../docs/lua/classes/")
|
||||
except:
|
||||
pass
|
||||
|
||||
for class_name, class_ in classes.items():
|
||||
file_name = f"./classes/{class_name}.md"
|
||||
file_name = f"../docs/lua/classes/{class_name}.md"
|
||||
if os.path.exists(file_name):
|
||||
os.remove(file_name)
|
||||
f = open(file_name, "a")
|
||||
f.write(str(class_))
|
||||
f = open(file_name, "ba")
|
||||
f.write(bytes(str(class_), "UTF8"))
|
||||
f.close()
|
||||
|
||||
|
||||
|
||||
commands_file_name = f"./commands.md"
|
||||
commands_file_name = f"../docs/lua/commands.md"
|
||||
if os.path.exists(commands_file_name):
|
||||
os.remove(commands_file_name)
|
||||
f = open(commands_file_name, "a")
|
||||
|
||||
f.write("""# Commands
|
||||
f.write(
|
||||
"""# Commands
|
||||
|
||||
All the current commands from the menu are listed below.
|
||||
|
||||
@ -608,11 +699,12 @@ command.call_player(somePlayerIndex, "spawn", {joaat("adder")})
|
||||
|
||||
For a complete list of available command functions, please refer to the command table documentation.
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
commands = []
|
||||
with open("./commands_dump.txt", "r") as file:
|
||||
with open("../docs/lua/commands_dump.txt", "r") as file:
|
||||
for line in file:
|
||||
cmd = line.split("|", 1)[1].strip().split("|")
|
||||
commands.append(cmd)
|
||||
@ -629,4 +721,4 @@ for cmd in commands:
|
||||
f.write(f"Arg Count: {arg_count}\n")
|
||||
f.write("\n")
|
||||
|
||||
f.close()
|
||||
f.close()
|
123
scripts/generate_natives.py
Normal file
123
scripts/generate_natives.py
Normal file
@ -0,0 +1,123 @@
|
||||
import json
|
||||
|
||||
crossmap = {}
|
||||
natives = {}
|
||||
current_idx = 0
|
||||
crossmap_hash_list = []
|
||||
|
||||
class Arg:
|
||||
def __init__(self, name: str, type: str):
|
||||
self.name = name
|
||||
self.type = type#.replace("BOOL", "bool")# .replace("Any*", "void*")
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.type) + " " + str(self.name)
|
||||
|
||||
class NativeFunc:
|
||||
def __init__(self, namespace: str, name: str, hash: int, args: list[dict], return_type: str):
|
||||
self.namespace = namespace
|
||||
self.name = name
|
||||
self.hash = hash
|
||||
self.args: list[Arg] = []
|
||||
self.return_type = return_type#.replace("BOOL", "bool")# .replace("Any*", "void*")
|
||||
self.native_index = -1
|
||||
self.fix_vectors = "false"
|
||||
|
||||
for arg in args:
|
||||
self.args.append(Arg(arg["name"], arg["type"]))
|
||||
if arg["type"] == "Vector3*":
|
||||
self.fix_vectors = "true"
|
||||
|
||||
def get_native_def_str(self) -> str:
|
||||
assert self.native_index != -1
|
||||
|
||||
param_decl = ""
|
||||
param_pass = ""
|
||||
if len(self.args) > 0:
|
||||
for arg in self.args:
|
||||
param_decl += str(arg) + ", "
|
||||
param_pass += arg.name + ", "
|
||||
param_decl = param_decl[:-2]
|
||||
param_pass = param_pass[:-2]
|
||||
|
||||
return f"FORCEINLINE constexpr {self.return_type} {self.name}({param_decl}) {{ return big::native_invoker::invoke<{self.native_index}, {self.fix_vectors}, {self.return_type}>({param_pass}); }}"
|
||||
|
||||
class CrossmapEntry:
|
||||
def __init__(self, translated_hash: int):
|
||||
self.hash = translated_hash
|
||||
self.native_index = -1
|
||||
|
||||
def load_crossmap_data():
|
||||
global crossmap
|
||||
|
||||
data = open("crossmap.txt").readlines()
|
||||
for item in data:
|
||||
translation = item.split(",")
|
||||
crossmap[int(translation[0], 16)] = CrossmapEntry(int(translation[1], 16))
|
||||
|
||||
def load_natives_data():
|
||||
global natives
|
||||
|
||||
data = json.load(open("natives.json"))
|
||||
for ns, natives_list in data.items():
|
||||
natives[ns] = []
|
||||
for hash_str, native_data in natives_list.items():
|
||||
natives[ns].append(NativeFunc(ns, native_data["name"], int(hash_str, 16), native_data["params"], native_data["return_type"]))
|
||||
|
||||
def allocate_indices():
|
||||
global current_idx, crossmap_hash_list
|
||||
|
||||
for _, n in natives.items():
|
||||
for native in n:
|
||||
hash = native.hash
|
||||
if hash in crossmap:
|
||||
crossmap[hash].native_index = current_idx
|
||||
native.native_index = current_idx
|
||||
crossmap_hash_list.append(crossmap[hash].hash)
|
||||
current_idx += 1
|
||||
|
||||
|
||||
def write_crossmap_header():
|
||||
open("crossmap.hpp", "w+").write(f"""#pragma once
|
||||
#include <script/scrNativeHandler.hpp>
|
||||
|
||||
namespace big
|
||||
{{
|
||||
constexpr std::array<rage::scrNativeHash, {len(crossmap_hash_list)}> g_crossmap = {{{",".join([f"0x{x:X}" for x in crossmap_hash_list])}}};
|
||||
}}
|
||||
""")
|
||||
|
||||
def write_natives_header():
|
||||
natives_buf = ""
|
||||
natives_index_buf = ""
|
||||
|
||||
for ns, nvs in natives.items():
|
||||
natives_buf += f"namespace {ns}\n{{\n"
|
||||
for nat_data in nvs:
|
||||
if nat_data.native_index == -1:
|
||||
continue
|
||||
|
||||
natives_buf += f"\t{nat_data.get_native_def_str()}\n"
|
||||
natives_index_buf += f"\t{nat_data.name} = {nat_data.native_index},\n"
|
||||
natives_buf += "}\n\n"
|
||||
|
||||
natives_buf = natives_buf[:-2]
|
||||
|
||||
open("../natives.hpp", "w+").write(f"""#pragma once
|
||||
#include "invoker/invoker.hpp"
|
||||
|
||||
// clang-format off
|
||||
enum class NativeIndex
|
||||
{{
|
||||
{natives_index_buf}}};
|
||||
|
||||
{natives_buf}
|
||||
// clang-format on
|
||||
""")
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_crossmap_data()
|
||||
load_natives_data()
|
||||
allocate_indices()
|
||||
write_crossmap_header()
|
||||
write_natives_header()
|
119453
scripts/natives.json
Normal file
119453
scripts/natives.json
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,9 @@
|
||||
# working dir: scripts
|
||||
# python ./natives_gen.py
|
||||
|
||||
import os
|
||||
|
||||
natives_hpp = open("../../natives.hpp", "r")
|
||||
natives_hpp = open("../src/natives.hpp", "r")
|
||||
|
||||
cpp_print_buf = ""
|
||||
hpp_print_buf = ""
|
||||
@ -21,8 +24,17 @@ def print_hpp(text):
|
||||
class Arg:
|
||||
def __init__(self, name, type_):
|
||||
self.name = name
|
||||
self.type_ = type_.replace("BOOL", "bool")
|
||||
self.is_pointer_arg = "*" in type_ and "const char" not in type_
|
||||
self.type_ = type_.replace("BOOL", "bool").replace("Any*", "uintptr_t")
|
||||
if self.type_ == "uintptr_t":
|
||||
self.is_any_ptr = True
|
||||
else:
|
||||
self.is_any_ptr = False
|
||||
if self.type_ == "const char*":
|
||||
self.type_ = self.type_.replace("const char*", "sol::stack_object")
|
||||
self.is_string = True
|
||||
else:
|
||||
self.is_string = False
|
||||
self.is_pointer_arg = "*" in self.type_ and "const char" not in self.type_
|
||||
self.type_no_star = self.type_.replace("*", "")
|
||||
|
||||
def __str__(self) -> str:
|
||||
@ -35,7 +47,7 @@ class NativeFunc:
|
||||
self.lua_name = lua_name
|
||||
self.cpp_name = cpp_name
|
||||
self.args = args
|
||||
self.return_type = return_type.replace("BOOL", "bool")
|
||||
self.return_type = return_type.replace("BOOL", "bool").replace("Any*", "uintptr_t")
|
||||
|
||||
self.out_params = []
|
||||
if self.return_type != "void":
|
||||
@ -61,7 +73,7 @@ class NativeFunc:
|
||||
if out_param.is_pointer_arg:
|
||||
fixed_return += out_param.type_no_star + ", "
|
||||
else:
|
||||
fixed_return += out_param.type_ + ", "
|
||||
fixed_return += ("const char*" if out_param.is_string else out_param.type_) + ", "
|
||||
fixed_return = fixed_return[:-2] + ">"
|
||||
returning_multiple_values = True
|
||||
tuple_type = fixed_return
|
||||
@ -69,7 +81,7 @@ class NativeFunc:
|
||||
if self.out_params[0].is_pointer_arg:
|
||||
fixed_return = self.out_params[0].type_no_star
|
||||
else:
|
||||
fixed_return = self.out_params[0].type_
|
||||
fixed_return = ("const char*" if self.out_params[0].is_string else self.out_params[0].type_)
|
||||
|
||||
fixed_params = ""
|
||||
if len(self.args) > 0:
|
||||
@ -95,6 +107,9 @@ class NativeFunc:
|
||||
s += "\n"
|
||||
s += "\t{\n"
|
||||
|
||||
if self.cpp_name == "ADD_OWNED_EXPLOSION":
|
||||
s+= "\t\tbig::explosion_anti_cheat_bypass::apply();\n\n"
|
||||
|
||||
call_native = "\t\t"
|
||||
if len(self.out_params) > 0:
|
||||
if returning_multiple_values:
|
||||
@ -115,18 +130,28 @@ class NativeFunc:
|
||||
|
||||
if len(self.args) > 0:
|
||||
for arg in self.args:
|
||||
if arg.is_any_ptr:
|
||||
call_native += "(Any*)"
|
||||
|
||||
if arg.is_pointer_arg:
|
||||
if arg.type_ == "bool*":
|
||||
call_native += "(BOOL*)"
|
||||
call_native += "&"
|
||||
|
||||
|
||||
call_native += arg.name + ", "
|
||||
if arg.is_string:
|
||||
call_native += f'{arg.name}.is<const char*>() ? {arg.name}.as<const char*>() : nullptr, '
|
||||
else:
|
||||
call_native += arg.name + ", "
|
||||
call_native = call_native[:-2]
|
||||
|
||||
call_native += ");"
|
||||
|
||||
s += call_native
|
||||
|
||||
if self.cpp_name == "ADD_OWNED_EXPLOSION":
|
||||
s+= "\n\n\t\tbig::explosion_anti_cheat_bypass::restore();"
|
||||
|
||||
if returning_multiple_values:
|
||||
assign_return_values = "\n"
|
||||
if self.return_type != "void":
|
||||
@ -150,7 +175,10 @@ class NativeFunc:
|
||||
if returning_multiple_values:
|
||||
return_statement = "return return_values;"
|
||||
elif self.return_type != "void":
|
||||
return_statement = "return retval;"
|
||||
if self.return_type == "uintptr_t":
|
||||
return_statement = "return (uintptr_t)retval;"
|
||||
else:
|
||||
return_statement = "return retval;"
|
||||
else:
|
||||
for arg in self.args:
|
||||
if arg.is_pointer_arg:
|
||||
@ -178,7 +206,8 @@ def get_natives_func_from_natives_hpp_file(natives_hpp):
|
||||
if "namespace " in line:
|
||||
current_namespace = line.replace("namespace ", "").strip()
|
||||
functions_per_namespaces[current_namespace] = []
|
||||
elif "NATIVE_DECL" in line:
|
||||
elif "FORCEINLINE constexpr" in line:
|
||||
line = line.replace("FORCEINLINE constexpr", "")
|
||||
words = line.split()
|
||||
|
||||
# remove NATIVE_DECL from the words array
|
||||
@ -232,7 +261,7 @@ def generate_native_binding_cpp_and_hpp_files(functions_per_namespaces):
|
||||
generated_function_name = "void init_native_binding(sol::state& L)"
|
||||
|
||||
print_hpp("#pragma once")
|
||||
print_hpp('#include "lua/sol.hpp"')
|
||||
# print_hpp('#include "lua/sol.hpp"')
|
||||
print_hpp("")
|
||||
print_hpp("namespace lua::native")
|
||||
print_hpp("{")
|
||||
@ -252,7 +281,7 @@ def generate_native_binding_cpp_and_hpp_files(functions_per_namespaces):
|
||||
for namespace_name, native_funcs in functions_per_namespaces.items():
|
||||
|
||||
|
||||
file_name_cpp = "lua_native_binding_" + namespace_name + ".cpp"
|
||||
file_name_cpp = "../src/lua/natives/lua_native_binding_" + namespace_name + ".cpp"
|
||||
if os.path.exists(file_name_cpp):
|
||||
os.remove(file_name_cpp)
|
||||
f = open(file_name_cpp, "a")
|
||||
@ -262,6 +291,8 @@ def generate_native_binding_cpp_and_hpp_files(functions_per_namespaces):
|
||||
|
||||
file_buffer += '#include "lua_native_binding.hpp"\n'
|
||||
file_buffer += '#include "natives.hpp"\n'
|
||||
if namespace_name == "FIRE":
|
||||
file_buffer += '#include "util/explosion_anti_cheat_bypass.hpp"\n'
|
||||
file_buffer += "\n"
|
||||
file_buffer += "namespace lua::native\n"
|
||||
file_buffer += "{\n"
|
||||
@ -301,7 +332,7 @@ def generate_native_binding_cpp_and_hpp_files(functions_per_namespaces):
|
||||
generate_native_binding_cpp_and_hpp_files(functions_per_namespaces)
|
||||
|
||||
def write_cpp_code(cpp_print_buf):
|
||||
file_name = "lua_native_binding.cpp"
|
||||
file_name = "../src/lua/natives/lua_native_binding.cpp"
|
||||
if os.path.exists(file_name):
|
||||
os.remove(file_name)
|
||||
f = open(file_name, "a")
|
||||
@ -310,7 +341,7 @@ def write_cpp_code(cpp_print_buf):
|
||||
|
||||
|
||||
def write_hpp_code(hpp_print_buf):
|
||||
file_name = "lua_native_binding.hpp"
|
||||
file_name = "../src/lua/natives/lua_native_binding.hpp"
|
||||
if os.path.exists(file_name):
|
||||
os.remove(file_name)
|
||||
f = open(file_name, "a")
|
@ -1,15 +0,0 @@
|
||||
include(FetchContent)
|
||||
|
||||
message("zydis")
|
||||
|
||||
set(ZYDIS_BUILD_DOXYGEN OFF CACHE BOOL "Zydis Build Doxygen")
|
||||
set(ZYDIS_FEATURE_ENCODER OFF CACHE BOOL "Zydis Feature Encoder")
|
||||
|
||||
FetchContent_Declare(
|
||||
zydis
|
||||
GIT_REPOSITORY https://github.com/zyantific/zydis.git
|
||||
GIT_TAG 8948d9a8f493330d27a0e7bbebf40f0391e45f1b
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(zydis)
|
||||
set_property(TARGET Zydis PROPERTY CXX_STANDARD 23)
|
@ -13,6 +13,7 @@
|
||||
#include "services/tunables/tunables_service.hpp"
|
||||
#include "services/vehicle/vehicle_control_service.hpp"
|
||||
#include "services/vehicle/xml_vehicles_service.hpp"
|
||||
#include "services/xml_maps/xml_map_service.hpp"
|
||||
#include "thread_pool.hpp"
|
||||
|
||||
|
||||
@ -27,6 +28,7 @@ namespace big
|
||||
|
||||
g_squad_spawner_service.fetch_squads();
|
||||
g_xml_vehicles_service->fetch_xml_files();
|
||||
g_xml_map_service->fetch_xml_files();
|
||||
g_custom_teleport_service.fetch_saved_locations();
|
||||
g_ped_animation_service.fetch_saved_animations();
|
||||
|
||||
@ -117,6 +119,7 @@ namespace big
|
||||
while (g_running)
|
||||
{
|
||||
looped::hud_transition_state();
|
||||
looped::hud_disable_input();
|
||||
looped::session_pop_multiplier_areas();
|
||||
looped::session_force_thunder();
|
||||
looped::session_randomize_ceo_colors();
|
||||
|
@ -145,6 +145,33 @@ namespace big
|
||||
break;
|
||||
}
|
||||
|
||||
auto compare_by_substring_match = [](command*& a, command*& b, const std::string& sub) -> bool {
|
||||
std::string cmd_name_a = a->get_name();
|
||||
std::string cmd_name_b = b->get_name();
|
||||
|
||||
if (cmd_name_a == sub && cmd_name_b != sub)
|
||||
return true;
|
||||
if (cmd_name_b == sub && cmd_name_a != sub)
|
||||
return false;
|
||||
|
||||
auto pos_a = cmd_name_a.find(sub);
|
||||
auto pos_b = cmd_name_b.find(sub);
|
||||
|
||||
if (pos_a != std::string::npos && pos_b != std::string::npos)
|
||||
{
|
||||
if (pos_a != pos_b)
|
||||
return pos_a < pos_b;
|
||||
|
||||
return cmd_name_a.length() < cmd_name_b.length();
|
||||
}
|
||||
|
||||
return pos_a < pos_b;
|
||||
};
|
||||
|
||||
std::sort(result_cmds.begin(), result_cmds.end(), [&search, &compare_by_substring_match](command*& a, command*& b) {
|
||||
return compare_by_substring_match(a, b, search);
|
||||
});
|
||||
|
||||
return result_cmds;
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,13 @@ namespace big
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
const size_t arg_count = 3;
|
||||
const size_t arg_count = 4;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::NetworkBail,
|
||||
(int64_t)self::id,
|
||||
1 << player->id(),
|
||||
scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::NetworkBail);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -19,9 +19,9 @@ namespace big
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
if (!scripts::force_host(RAGE_JOAAT("freemode")))
|
||||
if (!scripts::force_host("freemode"_J))
|
||||
{
|
||||
g_notification_service->push_error("Kick", "Force script host failed!");
|
||||
g_notification_service->push_error("END_KICK"_T.data(), "BACKEND_END_SESSION_KICK_FORCE_SCRIPT_HOST_FAILED"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -33,4 +33,4 @@ namespace big
|
||||
};
|
||||
|
||||
end_session_kick g_end_session_kick("endkick", "END_KICK", "END_KICK_DESC", 0, false);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace big
|
||||
return;
|
||||
if (!g_player_service->get_self()->is_host())
|
||||
{
|
||||
g_notification_service->push_error("Host kick", "Host kick failed");
|
||||
g_notification_service->push_error("HOST_KICK"_T.data(), "BACKEND_HOST_KICK_FAILED"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,19 +17,19 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("oomkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("endkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get("nfkick"_J))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get("oomkick"_J))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get("endkick"_J))->call(player, {});
|
||||
script::get_current()->yield(700ms);
|
||||
|
||||
if (g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("hostkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get("hostkick"_J))->call(player, {});
|
||||
|
||||
if (player && !g_player_service->get_self()->is_host() && player->is_valid() && !player->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("desync")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get("desync"_J))->call(player, {});
|
||||
|
||||
if (g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {}),
|
||||
dynamic_cast<player_command*>(command::get("breakup"_J))->call(player, {}),
|
||||
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
|
||||
}
|
||||
};
|
||||
|
@ -18,10 +18,10 @@ namespace big
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
const size_t arg_count = 15;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, (int64_t)(int)-1};
|
||||
const size_t arg_count = 16;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, 1 << player->id(), (int64_t)(int)-1};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace big
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
if (!scripts::force_host(RAGE_JOAAT("freemode")))
|
||||
if (!scripts::force_host("freemode"_J))
|
||||
{
|
||||
g_notification_service->push_error("Kick", "Force script host failed!");
|
||||
return;
|
||||
@ -30,4 +30,4 @@ namespace big
|
||||
};
|
||||
|
||||
script_host_kick g_script_host_kick("shkick", "SCRIPT_HOST_KICK", "SCRIPT_HOST_KICK_DESC", 0, false);
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ namespace big
|
||||
int id = player->id();
|
||||
if (scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PropertyData.Index != -1)
|
||||
{
|
||||
const size_t arg_count = 9;
|
||||
const size_t arg_count = 10;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Teleport,
|
||||
self::id,
|
||||
1 << self::id,
|
||||
(int64_t)player->id(),
|
||||
(int64_t)(int)-1,
|
||||
1,
|
||||
@ -29,7 +30,7 @@ namespace big
|
||||
0,
|
||||
1};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << self::id);
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << self::id, (int)eRemoteEvent::Teleport);
|
||||
}
|
||||
else if (scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index != eSimpleInteriorIndex::SIMPLE_INTERIOR_INVALID)
|
||||
{
|
||||
@ -43,7 +44,7 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx->report_error("Player does not appear to be in an interior");
|
||||
ctx->report_error("BACKEND_ENTER_INTERIOR_NOT_IN_INTERIOR"_T.data());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
g_pickup_service->give_player_health(player->id());
|
||||
g_pickup_service->give_player_ammo(player->id());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
g_pickup_service->give_armour(player->id());
|
||||
g_pickup_service->give_player_armour(player->id());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -25,19 +25,23 @@ namespace big
|
||||
|
||||
else if (leader == player->id())
|
||||
{
|
||||
const size_t arg_count = 2;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::CeoKick, (int64_t)self::id};
|
||||
const size_t arg_count = 3;
|
||||
int64_t args[arg_count] = {
|
||||
(int64_t)eRemoteEvent::CeoKick,
|
||||
(int64_t)self::id,
|
||||
1 << player->id(),
|
||||
};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::CeoKick);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// use a more private method to remove associate
|
||||
const size_t arg_count = 3;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::MarkPlayerAsBeast, (int64_t)self::id, leader};
|
||||
const size_t arg_count = 4;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::MarkPlayerAsBeast, (int64_t)self::id, 1 << player->id(), leader};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::MarkPlayerAsBeast);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -16,10 +16,10 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 3;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::ForceMission, (int64_t)self::id, 0};
|
||||
const size_t arg_count = 4;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::ForceMission, (int64_t)self::id, 1 << self::id, 0};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::ForceMission);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,13 +1,8 @@
|
||||
#include "backend/player_command.hpp"
|
||||
#include "core/scr_globals.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "gta/net_object_mgr.hpp"
|
||||
#include "gta/script_handler.hpp"
|
||||
#include "hooking.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "services/script_connection/script_connection_service.hpp"
|
||||
#include "util/scripts.hpp"
|
||||
|
||||
#include <script/globals/GPBD_FM.hpp>
|
||||
#include <script/globals/GlobalPlayerBD.hpp>
|
||||
@ -44,10 +39,11 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
const size_t arg_count = 8;
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count]{
|
||||
(int64_t)eRemoteEvent::KickFromInterior,
|
||||
(int64_t)self::id,
|
||||
1 << player->id(),
|
||||
(int64_t)scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()
|
||||
->Entries[player->id()]
|
||||
.SimpleInteriorData.Index,
|
||||
@ -56,7 +52,7 @@ namespace big
|
||||
.SimpleInteriorData.InstanceId,
|
||||
};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::KickFromInterior);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -21,10 +21,10 @@ namespace big
|
||||
if (!vehicle || !vehicle->m_net_object)
|
||||
{
|
||||
// vehicle hasn't synced yet, use TSE
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::VehicleKick, self::id, 0, 0, 0, 0, 0, 0, 0};
|
||||
const size_t arg_count = 10;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::VehicleKick, self::id, 1 << player->id(), 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::VehicleKick);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ namespace big
|
||||
player->get_ped()->m_navigation->get_position(),
|
||||
0,
|
||||
true,
|
||||
RAGE_JOAAT("weapon_explosion"),
|
||||
"weapon_explosion"_J,
|
||||
10000.0f,
|
||||
2,
|
||||
0,
|
||||
@ -40,4 +40,4 @@ namespace big
|
||||
};
|
||||
|
||||
kill_player g_kill_player("kill", "KILL_PLAYER", "KILL_PLAYER_DESC", 0);
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,12 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 8;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id};
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id, 1 << player->id()};
|
||||
|
||||
strcpy((char*)&args[2], "HUD_ROSBANPERM");
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::SendTextLabelSMS);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -22,13 +22,13 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 8;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id};
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id, 1 << player->id()};
|
||||
|
||||
strcpy((char*)&args[2],
|
||||
(std::string("SXT_") + strippers[rand() % strippers.size()] + "_" + sext_types[rand() % sext_types.size()])
|
||||
.data());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::SendTextLabelSMS);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -16,10 +16,19 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Teleport, self::id, (int64_t)player->id(), (int64_t)(int)-1, 1, (int64_t)_args.get<int64_t>(0), 1, 1, 1};
|
||||
const size_t arg_count = 10;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Teleport,
|
||||
self::id,
|
||||
1 << player->id(),
|
||||
(int64_t) player->id(),
|
||||
(int64_t)(int)-1,
|
||||
1,
|
||||
(int64_t)_args.get<int64_t>(0),
|
||||
1,
|
||||
1,
|
||||
1};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::Teleport);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -17,9 +17,10 @@ namespace big
|
||||
{
|
||||
float max = 1e+38f;
|
||||
auto coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()), FALSE);
|
||||
const size_t arg_count = 15;
|
||||
const size_t arg_count = 16;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl,
|
||||
(int64_t)self::id,
|
||||
1 << player->id(),
|
||||
(int64_t)_args.get<int>(0),
|
||||
(int64_t)self::id,
|
||||
(int64_t) false,
|
||||
@ -34,7 +35,7 @@ namespace big
|
||||
(int64_t) true,
|
||||
-1};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -16,10 +16,15 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 6;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TeleportToWarehouse, self::id, (int64_t)player->id(), 1, (int64_t)_args.get<int>(0)};
|
||||
const size_t arg_count = 7;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TeleportToWarehouse,
|
||||
self::id,
|
||||
1 << player->id(),
|
||||
(int64_t) player->id(),
|
||||
1,
|
||||
(int64_t)_args.get<int>(0)};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::TeleportToWarehouse);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace big
|
||||
|
||||
if (level < 0 || level > 5)
|
||||
{
|
||||
ctx->report_error(std::format("Wanted level {} is invalid [0 - 5]", level));
|
||||
ctx->report_error(std::format("{}: '{}' {} [0 - 5]", "WANTED_LEVEL"_T, level, "VIEW_MODEL_SWAPPER_INVALID_INDEX"_T));
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,10 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx)override
|
||||
{
|
||||
const size_t arg_count = 8;
|
||||
const size_t arg_count = 9;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TransactionError,
|
||||
(int64_t)self::id,
|
||||
1 << player->id(),
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
@ -28,7 +29,7 @@ namespace big
|
||||
*scr_globals::gsbd_fm_events.at(9).as<int*>(),
|
||||
*scr_globals::gsbd_fm_events.at(10).as<int*>()};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::TransactionError);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -20,8 +20,8 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 25;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id};
|
||||
const size_t arg_count = 26;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id, 1 << player->id()};
|
||||
|
||||
args[2] = scriptId;
|
||||
strcpy((char*)&args[2 + 3], "0");
|
||||
@ -30,27 +30,27 @@ namespace big
|
||||
args[2 + 19] = arg19;
|
||||
args[24] = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter;
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::StartScriptBegin);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
const size_t arg_count_2 = 25;
|
||||
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id};
|
||||
const size_t arg_count_2 = 26;
|
||||
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id, 1 << player->id()};
|
||||
args_2[2 + 17] = 1337;
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args_2, arg_count_2, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args_2, arg_count_2, 1 << player->id(), (int)eRemoteEvent::StartScriptProceed);
|
||||
|
||||
script::get_current()->yield(20ms);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
start_script<20> g_start_tutorial("tutorial", "Start Tutorial", "Plays that unskippable cutscene used in the tutorial", 0);
|
||||
start_script<200> g_start_golf("golf", "Start Golf", "Starts golf", 0);
|
||||
start_script<203> g_start_flight_school("flightschool", "Start Flight School", "Teleports player to the airport and starts flight school", 0);
|
||||
start_script<9> g_start_darts("darts", "Start Darts", "Starts darts in a Sandy Shores bar", 0);
|
||||
start_script<218> g_start_badlands("badlands", "Start Badlands Revenge II", "Starts the arcade game Badlands Revenge II in fullscreen", 0);
|
||||
start_script<223> g_start_space_monkey("spacemonkey", "Start Space Monkey 3", "Starts the arcade game Space Monkey 3 in fullscreen", 0);
|
||||
start_script<219> g_start_wizards_ruin("wizard", "Start The Wizard's Ruin", "Starts the arcade game The Wizard's Ruin in fullscreen", 0);
|
||||
start_script<224> g_start_qub3d("qub3d", "Start Qub3D", "Starts the arcade game Qub3D in fullscreen", 0);
|
||||
start_script<225> g_start_camhedz("camhedz", "Start Camhedz", "Starts the arcade game Camhedz in fullscreen", 0);
|
||||
start_script<20> g_start_tutorial("tutorial", "BACKEND_START_SCRIPT_START_TUTORIAL", "BACKEND_START_SCRIPT_START_TUTORIAL_DESC", 0);
|
||||
start_script<200> g_start_golf("golf", "BACKEND_START_SCRIPT_START_GOLF", "BACKEND_START_SCRIPT_START_GOLF_DESC", 0);
|
||||
start_script<203> g_start_flight_school("flightschool", "BACKEND_START_SCRIPT_START_FLIGHT_SCHOOL", "BACKEND_START_SCRIPT_START_FLIGHT_SCHOOL_DESC", 0);
|
||||
start_script<9> g_start_darts("darts", "BACKEND_START_SCRIPT_START_DARTS", "BACKEND_START_SCRIPT_START_DARTS_DESC", 0);
|
||||
start_script<218> g_start_badlands("badlands", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II_DESC", 0);
|
||||
start_script<223> g_start_space_monkey("spacemonkey", "BACKEND_START_SCRIPT_START_SPACE_MONKEY", "BACKEND_START_SCRIPT_START_SPACE_MONKEY_DESC", 0);
|
||||
start_script<219> g_start_wizards_ruin("wizard", "BACKEND_START_SCRIPT_START_WIZARD", "BACKEND_START_SCRIPT_START_WIZARD_DESC", 0);
|
||||
start_script<224> g_start_qub3d("qub3d", "BACKEND_START_SCRIPT_START_QUB3D", "BACKEND_START_SCRIPT_START_QUB3D_DESC", 0);
|
||||
start_script<225> g_start_camhedz("camhedz", "BACKEND_START_SCRIPT_START_CAMHEDZ", "BACKEND_START_SCRIPT_START_CAMHEDZ_DESC", 0);
|
||||
}
|
@ -15,10 +15,10 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 3;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TriggerCEORaid, (int64_t)self::id, 0};
|
||||
const size_t arg_count = 4;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TriggerCEORaid, (int64_t)self::id, 1 << player->id(), 0};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::TriggerCEORaid);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -23,11 +23,11 @@ namespace big
|
||||
{
|
||||
if (!NETWORK::NETWORK_IS_PLAYER_A_PARTICIPANT_ON_SCRIPT(id, "am_launcher", -1))
|
||||
{
|
||||
g_notification_service->push_error("Turn to Beast", "Cannot start the Hunt the Beast event, player not a participant of am_launcher");
|
||||
g_notification_service->push_error("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_CANNOT_START_AM_LAUNCHER"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
g_notification_service->push("Turn to Beast", "Starting Hunt The Beast event. Please wait...");
|
||||
g_notification_service->push("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_STARTING"_T.data());
|
||||
|
||||
scripts::start_launcher_script(47);
|
||||
|
||||
@ -35,7 +35,7 @@ namespace big
|
||||
{
|
||||
if (i >= 1000)
|
||||
{
|
||||
g_notification_service->push_error("Turn to Beast", "Failed to start the Hunt The Beast event");
|
||||
g_notification_service->push_error("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_FAILED"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -46,13 +46,13 @@ namespace big
|
||||
if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(id))
|
||||
return;
|
||||
|
||||
if (!scripts::force_host(RAGE_JOAAT("am_hunt_the_beast")))
|
||||
if (!scripts::force_host("am_hunt_the_beast"_J))
|
||||
{
|
||||
g_notification_service->push_error("Turn to Beast", "Failed to take control of am_hunt_the_beast");
|
||||
g_notification_service->push_error("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_FAILED_CONTROL"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
auto thread = gta_util::find_script_thread(RAGE_JOAAT("am_hunt_the_beast"));
|
||||
auto thread = gta_util::find_script_thread("am_hunt_the_beast"_J);
|
||||
auto stack = thread->m_stack;
|
||||
auto net_component = (CGameScriptHandlerNetComponent*)thread->m_net_component;
|
||||
auto idx = scr_locals::am_hunt_the_beast::broadcast_idx;
|
||||
@ -85,11 +85,11 @@ namespace big
|
||||
{
|
||||
scripts::start_launcher_script(47);
|
||||
|
||||
for (int i = 0; !scripts::is_running(RAGE_JOAAT("am_launcher")); i++)
|
||||
for (int i = 0; !scripts::is_running("am_launcher"_J); i++)
|
||||
{
|
||||
if (i >= 7000)
|
||||
{
|
||||
g_notification_service->push_error("Turn to Beast", "Failed to start the Hunt The Beast event");
|
||||
g_notification_service->push_error("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_FAILED"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -98,15 +98,15 @@ namespace big
|
||||
|
||||
script::get_current()->yield(500ms);
|
||||
|
||||
if (!scripts::force_host(RAGE_JOAAT("am_hunt_the_beast")))
|
||||
if (!scripts::force_host("am_hunt_the_beast"_J))
|
||||
{
|
||||
g_notification_service->push_error("Turn to Beast", "Failed to take control of am_hunt_the_beast");
|
||||
g_notification_service->push_error("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_FAILED_CONTROL"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
script::get_current()->yield(3s);
|
||||
|
||||
auto thread = gta_util::find_script_thread(RAGE_JOAAT("am_hunt_the_beast"));
|
||||
auto thread = gta_util::find_script_thread("am_hunt_the_beast"_J);
|
||||
|
||||
if (!thread)
|
||||
return;
|
||||
@ -149,4 +149,4 @@ namespace big
|
||||
|
||||
turn_into_beast g_turn_into_beast("beast", "TURN_INTO_BEAST", "TURN_INTO_BEAST_DESC", 0, false);
|
||||
turn_into_beast_all g_turn_into_beast_all("beastall", "TURN_INTO_BEAST_ALL", "TURN_INTO_BEAST_ALL_DESC", 0);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace big
|
||||
|
||||
if (entity::take_control_of(vehicle))
|
||||
{
|
||||
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 79);
|
||||
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, VEHICLE::GET_VEHICLE_ESTIMATED_MAX_SPEED(vehicle));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -32,5 +32,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
boost_vehicle g_boost_vehicle("boostveh", "Boost Vehicle", "Boosts their car very fast.", 0);
|
||||
boost_vehicle g_boost_vehicle("boostveh", "BACKEND_BOOST_VEHICLE", "BACKEND_BOOST_VEHICLE_DESC", 0);
|
||||
}
|
@ -42,5 +42,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
break_doors g_break_doors("breakdoors", "Break Vehicle Doors", "Breaks all vehicle doors", 0);
|
||||
break_doors g_break_doors("breakdoors", "BACKEND_BREAK_VEHICLE_DOORS", "BACKEND_BREAK_VEHICLE_DOORS_DESC", 0);
|
||||
}
|
@ -33,5 +33,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
burst_tyres g_burst_tyres("burstwheels", "Burst Vehicle Tyres", "Removes their tyres", 0);
|
||||
burst_tyres g_burst_tyres("burstwheels", "BACKEND_BURST_VEHICLE_TIRES", "BACKEND_BURST_VEHICLE_TIRES_DESC", 0);
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle.");
|
||||
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_FAILED_TO_TAKE_CONTROL"_T.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
close_doors g_close_doors("closedoors", "Close Vehicle Doors", "Closes all vehicle doors", 0);
|
||||
close_doors g_close_doors("closedoors", "BACKEND_CLOSE_VEHICLE_DOORS", "BACKEND_CLOSE_VEHICLE_DOORS_DESC", 0);
|
||||
}
|
@ -33,5 +33,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
downgrade_vehicle g_downgrade_vehicle("downgradeveh", "Downgrade Vehicle", "Removes all upgrades", 0);
|
||||
downgrade_vehicle g_downgrade_vehicle("downgradeveh", "BACKEND_DOWNGRADE_VEHICLE", "BACKEND_DOWNGRADE_VEHICLE_DESC", 0);
|
||||
}
|
@ -40,7 +40,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
flip_180
|
||||
g_flip_180("flip180", "Rotate 180", "Rotates the player's car around", 0)
|
||||
;
|
||||
flip_180 g_flip_180("flip180", "BACKEND_FLIP", "BACKEND_FLIP_DESC", 0);
|
||||
}
|
@ -29,5 +29,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
flying_vehicle g_flying_vehicle("flyingveh", "Flying Vehicle", "Catapults the player's car to the sky", 0);
|
||||
flying_vehicle g_flying_vehicle("flyingveh", "BACKEND_FLYING_VEHICLE", "BACKEND_FLYING_VEHICLE_DESC", 0);
|
||||
}
|
@ -25,11 +25,11 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle.");
|
||||
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_FAILED_TO_TAKE_CONTROL"_T.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
kill_engine g_kill_engine("killengine", "Kill Vehicle Engine", "Breaks their engine", 0);
|
||||
kill_engine g_kill_engine("killengine", "BACKEND_KILL_VEHICLE_ENGINE", "BACKEND_KILL_VEHICLE_ENGINE_DESC", 0);
|
||||
}
|
@ -11,9 +11,7 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
int lockStatus = VEHICLE::GET_VEHICLE_DOOR_LOCK_STATUS(player->id());
|
||||
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
|
||||
|
||||
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
|
||||
if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true))
|
||||
{
|
||||
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
|
||||
@ -23,13 +21,10 @@ namespace big
|
||||
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(ped, false);
|
||||
|
||||
if (entity::take_control_of(veh))
|
||||
{
|
||||
entity::take_control_of(veh);
|
||||
VEHICLE::SET_VEHICLE_DOORS_LOCKED(veh, 4);
|
||||
}
|
||||
VEHICLE::SET_VEHICLE_DOORS_LOCKED(veh, (int)eVehicleLockState::VEHICLELOCK_LOCKOUT_PLAYER_ONLY);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
lock_vehicle g_lock_vehicle("lockveh", "Lock Vehicle", "Locks vehicle doors", 0);
|
||||
lock_vehicle g_lock_vehicle("lockveh", "BACKEND_LOCK_VEHICLE", "BACKEND_LOCK_VEHICLE_DESC", 0);
|
||||
}
|
@ -29,11 +29,11 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_warning("Toxic", "Failed to take control of vehicle");
|
||||
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_FAILED_TO_TAKE_CONTROL"_T.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
open_doors g_open_doors("opendoors", "Opens Vehicle Doors", "Opens all vehicle doors", 0);
|
||||
open_doors g_open_doors("opendoors", "BACKEND_OPEN_VEHICLE_DOORS", "BACKEND_OPEN_VEHICLE_DOORS_DESC", 0);
|
||||
}
|
@ -15,9 +15,9 @@ namespace big
|
||||
if (veh == 0)
|
||||
{
|
||||
if (g.player.spectating)
|
||||
g_notification_service->push_warning("Remote Control", "Player not in a vehicle");
|
||||
g_notification_service->push_warning("REMOTE_CONTROL"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
|
||||
else
|
||||
g_notification_service->push_warning("Remote Control", "Player not in a vehicle, try spectating the player");
|
||||
g_notification_service->push_warning("REMOTE_CONTROL"_T.data(), std::format("{} {}", "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T, "BACKEND_REMOTE_CONTROL_VEHICLE_SPECTATE"_T).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -26,5 +26,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
remote_control_vehicle g_remote_control_vehicle("rcplayer", "Remote Control Vehicle", "Take control of the player's vehicle. Spectate the player beforehand for best results", 0, false);
|
||||
remote_control_vehicle g_remote_control_vehicle("rcplayer", "BACKEND_REMOTE_CONTROL_VEHICLE", "BACKEND_REMOTE_CONTROL_VEHICLE_DESC", 0, false);
|
||||
}
|
@ -29,5 +29,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
smash_windows g_smash_windows("smashwindows", "Smash Vehicle Windows", "Smashes all their windows", 0);
|
||||
smash_windows g_smash_windows("smashwindows", "BACKEND_SMASH_VEHICLE_WINDOWS", "BACKEND_SMASH_VEHICLE_WINDOWS_DESC", 0);
|
||||
}
|
@ -24,8 +24,8 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
vehicle_special_ability<0> g_special_jump_vehicle("svehjump", "Special: Jump", "Activates the vehicle jump on the player's vehicle. This may cause undefined behavior if the vehicle cannot jump", 0);
|
||||
vehicle_special_ability<1> g_special_boost_vehicle("svehboost", "Special: Boost", "Activates the boost on the player's vehicle. This may cause undefined behavior if the vehicle cannot boost", 0);
|
||||
vehicle_special_ability<3> g_special_shunt_left("sshuntleft", "Special: Shunt Left", "Shunts the player's vehicle to the left", 0);
|
||||
vehicle_special_ability<2> g_special_shunt_right("sshuntright", "Special: Shunt Right", "Shunts the player's vehicle to the right", 0);
|
||||
vehicle_special_ability<0> g_special_jump_vehicle("svehjump", "BACKEND_SPECIAL_ABILITY_JUMP", "BACKEND_SPECIAL_ABILITY_JUMP_DESC", 0);
|
||||
vehicle_special_ability<1> g_special_boost_vehicle("svehboost", "BACKEND_SPECIAL_ABILITY_BOOST", "BACKEND_SPECIAL_ABILITY_BOOST_DESC", 0);
|
||||
vehicle_special_ability<3> g_special_shunt_left("sshuntleft", "BACKEND_SPECIAL_ABILITY_LEFT", "BACKEND_SPECIAL_ABILITY_LEFT_DESC", 0);
|
||||
vehicle_special_ability<2> g_special_shunt_right("sshuntright", "BACKEND_SPECIAL_ABILITY_RIGHT", "BACKEND_SPECIAL_ABILITY_RIGHT_DESC", 0);
|
||||
}
|
@ -25,11 +25,11 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle.");
|
||||
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_FAILED_TO_TAKE_CONTROL"_T.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
stop_vehicle g_stop_vehicle("stopveh", "Stop Vehicle", "Stops the player's vehicle", 0);
|
||||
stop_vehicle g_stop_vehicle("stopveh", "BACKEND_STOP_VEHICLE", "BACKEND_STOP_VEHICLE_DESC", 0);
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
#include "natives.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "util/teleport.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class unlock_vehicle : player_command
|
||||
@ -10,13 +11,20 @@ namespace big
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
if (PED::IS_PED_IN_ANY_VEHICLE(player->id(), false))
|
||||
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
|
||||
if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true))
|
||||
{
|
||||
if (entity::take_control_of(PED::GET_VEHICLE_PED_IS_USING(player->id())))
|
||||
VEHICLE::SET_VEHICLE_DOORS_LOCKED(PED::GET_VEHICLE_PED_IS_USING(player->id()), 0);
|
||||
g_notification_service->push_warning("VEHICLE"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(ped, false);
|
||||
|
||||
if (entity::take_control_of(veh))
|
||||
VEHICLE::SET_VEHICLE_DOORS_LOCKED(veh, (int)eVehicleLockState::VEHICLELOCK_UNLOCKED);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
unlock_vehicle g_unlock_vehicle("unlockveh", "Unlock Vehicle Doors", "Unlocks all vehicle doors", 0);
|
||||
unlock_vehicle g_unlock_vehicle("unlockveh", "BACKEND_UNLOCK_DOORS", "BACKEND_UNLOCK_DOORS_DESC", 0);
|
||||
}
|
@ -26,5 +26,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
upgrade_vehicle g_upgrade_vehicle("upgradeveh", "Upgrade Vehicle", "Upgrades players vehicle", 0);
|
||||
upgrade_vehicle g_upgrade_vehicle("upgradeveh", "MAX_VEHICLE", "BACKEND_UPGRADE_VEHICLE_DESC", 0);
|
||||
}
|
@ -24,5 +24,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
black_tint g_black_tint("blacktint", "Black Window Tint", "Makes the player's vehicle windows black", 0);
|
||||
black_tint g_black_tint("blacktint", "WINDOW_TINT", "BACKEND_WINDOW_TINT_DESC", 0);
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
#include "backend/command.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "util/local_player.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -10,15 +9,21 @@ namespace big
|
||||
|
||||
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
std::string mpPrefix = local_player::get_mp_prefix();
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "NO_BOUGHT_YUM_SNACKS"), 30, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "NO_BOUGHT_HEALTH_SNACKS"), 15, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "NO_BOUGHT_EPIC_SNACKS"), 5, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "MP_CHAR_ARMOUR_1_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "MP_CHAR_ARMOUR_2_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "MP_CHAR_ARMOUR_3_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "MP_CHAR_ARMOUR_4_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(mpPrefix + "MP_CHAR_ARMOUR_5_COUNT"), 10, true);
|
||||
std::string prefix = "MP" + std::to_string(self::char_index) + "_";
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NO_BOUGHT_YUM_SNACKS"), 30, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NO_BOUGHT_HEALTH_SNACKS"), 15, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NO_BOUGHT_EPIC_SNACKS"), 5, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NUMBER_OF_CHAMP_BOUGHT"), 5, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NUMBER_OF_ORANGE_BOUGHT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NUMBER_OF_BOURGE_BOUGHT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "NUMBER_OF_SPRUNK_BOUGHT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "MP_CHAR_ARMOUR_1_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "MP_CHAR_ARMOUR_2_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "MP_CHAR_ARMOUR_3_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "MP_CHAR_ARMOUR_4_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "MP_CHAR_ARMOUR_5_COUNT"), 10, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "CIGARETTES_BOUGHT"), 20, true);
|
||||
STATS::STAT_SET_INT(rage::joaat(prefix + "BREATHING_APPAR_BOUGHT"), 20, true);
|
||||
}
|
||||
};
|
||||
|
||||
|
6
src/backend/commands/self/graceful_landing.cpp
Normal file
6
src/backend/commands/self/graceful_landing.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "backend/bool_command.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool_command g_graceful_landing("gracefullanding", "GRACEFUL_LANDING", "GRACEFUL_LANDING_DESC", g.self.graceful_landing);
|
||||
}
|
@ -9,7 +9,7 @@ namespace big
|
||||
|
||||
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
ENTITY::SET_ENTITY_HEALTH(self::ped, PED::GET_PED_MAX_HEALTH(self::ped), 0);
|
||||
ENTITY::SET_ENTITY_HEALTH(self::ped, PED::GET_PED_MAX_HEALTH(self::ped), 0, 0);
|
||||
PED::SET_PED_ARMOUR(self::ped, PLAYER::GET_PLAYER_MAX_ARMOUR(self::id));
|
||||
}
|
||||
};
|
||||
|
@ -94,6 +94,16 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
class request_gun_van : command
|
||||
{
|
||||
using command::command;
|
||||
|
||||
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
mobile::mobile_misc::request_gun_van();
|
||||
}
|
||||
};
|
||||
|
||||
boat_pickup g_boat_pickup("boatpickup", "REQUEST_BOAT", "REQUEST_BOAT_DESC", 0);
|
||||
ballistic_armor g_ballistic_armor("ballisticarmor", "REQUEST_BALLISTIC", "REQUEST_BALLISTIC_DESC", 0);
|
||||
request_avenger g_request_avenger("avenger", "REQUEST_AVENGER", "REQUEST_AVENGER_DESC", 0);
|
||||
@ -103,4 +113,5 @@ namespace big
|
||||
request_acidlab g_request_acidlab("acidlab", "REQUEST_ACIDLAB", "REQUEST_ACIDLAB_DESC", 0);
|
||||
request_acidlab_bike g_request_acidlab_bike("acidbike", "REQUEST_ACIDBIKE", "REQUEST_ACIDBIKE_DESC", 0);
|
||||
request_taxi g_request_taxi("taxi", "REQUEST_TAXI", "REQUEST_TAXI_DESC", 0);
|
||||
request_gun_van g_request_gun_van("gunvan", "REQUEST_GUN_VAN", "REQUEST_GUN_VAN_DESC", 0);
|
||||
}
|
@ -9,7 +9,7 @@ namespace big
|
||||
|
||||
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
ENTITY::SET_ENTITY_HEALTH(self::ped, 0, 0);
|
||||
ENTITY::SET_ENTITY_HEALTH(self::ped, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -85,5 +85,5 @@ namespace big
|
||||
session::join_type(args.shift<eSessionType>());
|
||||
}
|
||||
};
|
||||
switch_session g_switch_session("joinsession", "Join Session", "Join a specific session type.", 1);
|
||||
switch_session g_switch_session("joinsession", "JOIN_SESSION", "BACKEND_SESSION_JOIN_SESSION_DESC", 1);
|
||||
}
|
@ -15,8 +15,8 @@ namespace big
|
||||
{
|
||||
player_mgr->RemovePlayer(plyr->get_net_game_player());
|
||||
}
|
||||
g_notification_service->push("Empty Session", "Completed");
|
||||
g_notification_service->push("EMPTY_SESSION"_T.data(), "BACKEND_WIPE_SESSION_COMPLETE"_T.data());
|
||||
}
|
||||
};
|
||||
empty_session g_empty_session("emptysession", "EMPTY_SESSION", "Removes everyone from the session", 0);
|
||||
empty_session g_empty_session("emptysession", "EMPTY_SESSION", "BACKEND_WIPE_SESSION_DESC", 0);
|
||||
}
|
@ -25,10 +25,10 @@ namespace big
|
||||
|
||||
virtual void execute(const command_arguments& args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const auto hash = args.get<rage::joaat_t>(0);
|
||||
if (!STREAMING::IS_MODEL_IN_CDIMAGE(hash) || !STREAMING::IS_MODEL_A_VEHICLE(hash))
|
||||
const auto hash = args.get<rage::joaat_t>(0);
|
||||
if (!entity::request_model(hash))
|
||||
{
|
||||
ctx->report_error("Specified model is invalid");
|
||||
ctx->report_error("BACKEND_SPAWN_VEHICLE_INVALID_MODEL"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ namespace big
|
||||
|
||||
if (veh == 0)
|
||||
{
|
||||
g_notification_service->push_error("Vehicle", "Unable to spawn vehicle");
|
||||
g_notification_service->push_error("GUI_TAB_SPAWN_VEHICLE"_T.data(), "UNABLE_TO_SPAWN_VEHICLE"_T.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -60,9 +60,7 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
spawn_vehicle g_spawn_vehicle("spawn", "Spawn Vehicle", "Spawn a vehicle with the specified model", 1);
|
||||
bool_command g_spawn_maxed("spawnmaxed", "SPAWN_MAXED", "SPAWN_MAXED_DESC",
|
||||
g.spawn_vehicle.spawn_maxed);
|
||||
bool_command g_spawn_inside("spawnin", "SPAWN_IN", "SPAWN_IN_DESC",
|
||||
g.spawn_vehicle.spawn_inside);
|
||||
spawn_vehicle g_spawn_vehicle("spawn", "GUI_TAB_SPAWN_VEHICLE", "BACKEND_SPAWN_VEHICLE_DESC", 1);
|
||||
bool_command g_spawn_maxed("spawnmaxed", "SPAWN_MAXED", "SPAWN_MAXED_DESC", g.spawn_vehicle.spawn_maxed);
|
||||
bool_command g_spawn_inside("spawnin", "SPAWN_IN", "SPAWN_IN_DESC", g.spawn_vehicle.spawn_inside);
|
||||
}
|
||||
|
17
src/backend/commands/system/external_console.cpp
Normal file
17
src/backend/commands/system/external_console.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "backend/bool_command.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class external_console : bool_command
|
||||
{
|
||||
using bool_command::bool_command;
|
||||
|
||||
virtual void refresh() override
|
||||
{
|
||||
g_log.toggle_external_console(m_toggle);
|
||||
}
|
||||
};
|
||||
|
||||
external_console
|
||||
g_external_console("external_console", "BACKEND_EXTERNAL_CONSOLE", "BACKEND_EXTERNAL_CONSOLE_DESC", g.debug.external_console);
|
||||
}
|
@ -12,5 +12,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
fast_quit g_fast_quit("fastquit", "Rage Quit", "We all have bad times sometimes. Close your GTA instant.", 0);
|
||||
fast_quit g_fast_quit("fastquit", "VIEW_HOTKEY_SETTINGS_RAGE_QUIT", "BACKEND_FAST_QUIT_DESC", 0);
|
||||
}
|
||||
|
@ -25,6 +25,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
window_hook g_window_hook("windowhook", "GTA Window Hook", "Only enable this if you know what you are doing, this will prevent AHK scripts from working.",
|
||||
g.debug.window_hook);
|
||||
window_hook g_window_hook("windowhook", "BACKEND_GTA_WINDOW_HOOK", "BACKEND_GTA_WINDOW_HOOK_DESC", g.debug.window_hook);
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
bring_personal_vehicle g_bring_personal_vehicle("bringpv", "Bring Personal Vehicle", "Teleports your PV near you", 0);
|
||||
bring_personal_vehicle g_bring_personal_vehicle("bringpv", "BRING_PV", "BACKEND_BRING_PERSONAL_VEHICLE_DESC", 0);
|
||||
}
|
@ -14,5 +14,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
teleport_to_highlighted_blip g_teleport_to_highlighted_blip("highlighttp", "Teleport to Selected Blip", "Teleports you to whichever blip you have in your crosshairs on the map.", 0);
|
||||
teleport_to_highlighted_blip g_teleport_to_highlighted_blip("highlighttp", "VIEW_HOTKEY_SETTINGS_TELEPORT_TO_SELECTED", "BACKEND_TELEPORT_TO_HIGHLIGHTED_BLIP_DESC", 0);
|
||||
}
|
@ -18,5 +18,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
teleport_to_last_vehicle g_teleport_to_last_vehicle("lastvehtp", "Teleport To Last Vehicle", "Teleports you into your last driven vehicle", 0);
|
||||
teleport_to_last_vehicle g_teleport_to_last_vehicle("lastvehtp", "BACKEND_TELEPORT_TO_LAST_VEHICLE", "BACKEND_TELEPORT_TO_LAST_VEHICLE_DESC", 0);
|
||||
}
|
@ -14,5 +14,5 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
teleport_to_objective g_teleport_to_objective("objectivetp", "Teleport To Objective", "Teleports you to your mission objective", 0);
|
||||
teleport_to_objective g_teleport_to_objective("objectivetp", "VIEW_HOTKEY_SETTINGS_TELEPORT_TO_OBJECTIVE", "BACKEND_TELEPORT_TO_OBJECTIVE_DESC", 0);
|
||||
}
|
@ -12,9 +12,10 @@ namespace big
|
||||
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
Vehicle veh = mobile::mechanic::get_personal_vehicle();
|
||||
teleport::into_vehicle(veh);
|
||||
if (self::veh != veh)
|
||||
teleport::into_vehicle(veh);
|
||||
}
|
||||
};
|
||||
|
||||
teleport_to_personal_vehicle g_teleport_to_personal_vehicle("pvtp", "Teleport To Personal Vehicle", "Teleports you into your PV", 0);
|
||||
teleport_to_personal_vehicle g_teleport_to_personal_vehicle("pvtp", "TP_IN_PV", "BACKEND_TELEPORT_TO_PERSONAL_VEHICLE", 0);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user