Commit Graph

70 Commits

Author SHA1 Message Date
8f980ff1ac feat(lua): Expose Script Patches & Functions (#3393) 2024-07-22 10:16:48 +02:00
796f6209f5 more player stats lua bindings (#3325)
Some checks failed
Nightly Build / Check Recent Commit (push) Failing after 7s
Nightly Build / Build Nightly (push) Has been skipped
Nightly Build / Recreate Release (push) Has been skipped
get_player_money
get_player_wallet
get_player_bank
get_player_language_id
get_player_language_name
2024-07-13 13:41:58 +02:00
8b7cbda946 fix self doc (#3319)
Some checks failed
Nightly Build / Check Recent Commit (push) Failing after 5s
Nightly Build / Build Nightly (push) Has been skipped
Nightly Build / Recreate Release (push) Has been skipped
2024-07-09 18:42:32 +02:00
64faa400b1 lua doc: add self table doc and update doc for previous changes that forgot to run the doc gen script (#3318) 2024-07-09 18:14:15 +02:00
6bbaaa398e feat: dynamicly calling x64 functions from lua at runtime with arbitrary signatures. (#3311) 2024-07-09 17:48:24 +02:00
014281d3e9 feat: dynamicly hooking x64 functions from lua at runtime with arbitrary signatures. (#3301)
* feat: dynamicly hooking x64 functions from lua at runtime with arbitrary signatures.

* fix missing include

* c/c++ include system is a good system
2024-07-08 14:15:18 +02:00
61ddba1634 Update for b3258 (#3288)
* fix: update script names
* fix: use original chat sender
* feat(tunables): fix tunable service
* fix: explode patch (thanks @Mr-X-GTA)
* fix: fix compile errors
* fix: use unique_ptr
* Added 1.69 vehicles.
* Added new weather for 1.69 and updated stack sizes.
* Fixed garage.
* Made Unload button a developer-only feature. (Disabled on Release)
* Redesigned Network tab to not be a giant mess.
* Added new json_serializer code from @tupoy-ya.
* chore: correct dependency

------

Co-authored-by: maybegreat48 <email@hostname>
Co-authored-by: Andreas Maerten <24669514+Yimura@users.noreply.github.com>
Co-authored-by: gir489returns <redacted@example.com>
2024-07-03 23:04:06 +02:00
a40f4a4956 add show_success lua binding (#3249) 2024-06-19 11:37:38 +02:00
155ffebe11 Make Player Stats Retrievable Within Lua (#3199)
Some checks are pending
Nightly Build / Check Recent Commit (push) Successful in 34s
Nightly Build / Build Nightly (push) Waiting to run
Nightly Build / Recreate Release (push) Blocked by required conditions
2024-06-01 12:57:21 +02:00
78b4302721 Chat spam to reaction (#3192) 2024-05-30 20:24:33 +02:00
10bec398bb fix(lua): fix pointer.allocate allocating the wrong number of bytes (#2941) 2024-04-13 17:41:04 +02:00
0dc5ad6137 fix(lua): better error reporting when calling player commands (#2932) 2024-04-10 11:43:55 +02:00
7e7bcb155a Refactor and fix send chat (#2864)
* feat(chat): refactor and fix send chat
* fix(chat): fixes
* fix(chat): fix team chat

Co-authored-by: DayibBaba <79384354+DayibBaba@users.noreply.github.com>
2024-03-23 17:37:51 +01:00
cba19d0c33 refactor!: Rewrite of the old notification service (#2866)
The main goal was improving the readability of the original code however some ugliness remains.

- Swapped from pointer singleton to instance singleton
- Actually make use of the alpha logic that used to be present
- Added a counter to notifications to indicate if something is being spammed
- Notification timeouts reset if they're sent to the queue again
2024-03-23 00:04:49 +01:00
95259faf59 add lua api: script.execute_as_script (#2824)
Co-authored-by: xiaoxiao921 <xiaoxiao921@hotmail.fr>
2024-03-21 11:20:22 +01:00
e07601347d refactor: switch RAGE_JOAAT with string literal functions (#2806)
Why? Shorter to write and removes the macro usage

I used the following regex to find all occurrences:
```r
RAGE_JOAAT\("(.*?)"\)
```
then the following to replace it all:
```r
"$1"_J
```
2024-03-12 09:42:11 +01:00
903c5273ed lua natives: try to handle Any* parameters properly (#2785) 2024-02-28 23:47:33 +01:00
530617755e lua io.exists (#2771) 2024-02-24 11:10:58 +01:00
cde5563204 lua: fix enabling/disabling (#2745) 2024-02-21 13:05:01 +01:00
2d55470e10 lua: allow functions to be called without giving all of its args (#2744)
This makes usage of native functions that normally use pointer args easier to deal with.
2024-02-21 13:02:29 +01:00
ec7735cb3a fixed bool_masked (#2708) 2024-02-12 18:26:07 +01:00
96048fa0f6 feat(lua): expose the self class and add new menu events (#2656) 2024-01-28 15:18:44 +01:00
e005640c75 fix(lua): allow natives to be called with nil strings. (#2652) 2024-01-17 11:08:35 +01:00
8ecbdaf7c0 refactor!: repo cleanup (#2650)
- Move cmake files to dedicated cmake folder
- Move scattered python files to `scripts/` folder
- Update CMakeLists.txt to reflect changes
* feat(scripts): add README to folder
2023-12-30 16:05:18 +01:00
1127e51a52 Optimizations (#2649)
* fix(Respawn): fix respawn in SP
* fix: re-enable bigobj
* fix: update creator's stack size
* fix: use BOOLs instead of bools
* fix(gitignore): hide .pyc files
2023-12-29 17:07:00 +01:00
5324d0a244 feat(cmake): update ImGui to latest release (#2621) 2023-12-21 16:01:47 +01:00
8b62dadcd5 Update crossmap and natives.hpp to 3095. (#2565) 2023-12-15 16:01:57 +01:00
2def629d3c feat(LuaMgr): Disable and Enable scripts from UI and prevent crash when renaming the scripts/ dir. (#2493) 2023-12-13 23:19:52 +01:00
b7b901d77f Fixed TRIGGER_SCRIPT_EVENT for 3095. (#2527) 2023-12-13 19:32:26 +01:00
a2eff686cb Enabled strict sol for type safety and function enforcement. (#2502) 2023-12-10 12:51:29 +01:00
bb5dfd1484 feat(lua): expose io.open (limited to scripts_config folder) (#2495) 2023-12-08 09:14:57 +01:00
b432407dce fix(lua): add default handler to every protected function calls, until now there was none/scuffed and nothing was getting output to the user making debugging very difficult (#2494) 2023-12-08 09:11:36 +01:00
11d48f49f9 feat(lua): added weapon and vehicle cache bindings (#2477)
* Replaced bad example in entities documentation.
* Updated Lua documentation for vehicles/weapons to allow for auto generation.
* Added Vector3 support to the Lua globals/locals class.
* Fixed a bug with get_float in globals/locals returning an int instead of a float.
* Fixed globals get_uint/set_uint using signed types for the return/parameter.
* Added unsigned int helpers to the locals Lua class.
2023-12-05 09:58:35 +01:00
f0302ab135 Added packed stats handler to the stats Lua class. (#2460) 2023-11-29 23:15:10 +01:00
5d538cf53c Rewrite AC bypass (#2430)
* fix(anticheat): rewrite AC bypass again (the old one isn't detected but this is cleaner)
* fix(chat): some chat tweaks
* fix(anticheat): fix memory leak
* feat(lua): add is_player_friend
* fix(protections): fix possible false positives with the vehicle task mismatch protection
* feat(protections): add debug logs to trace false positive
* fix(spam): add some more stuff
2023-11-19 23:20:15 +01:00
3914ebee72 feat(lua): add tunable overloads for getting / setting values through the already joaated tunable value. (#2417) 2023-11-14 20:21:03 +01:00
d2acc65af0 fix(lua): small lua / lau doc fixes (#2415)
* fix(lua): small lua / lau doc fixes: expose stats.get_character_index like intended. also add a bit of doc to button and sameline pages so that the user is correctly refered to the tab class doc
2023-11-14 20:20:45 +01:00
c38e42a488 Feat(lua-doc): Make sure that the MPX -> MP0/MP1 behavior for stats function is documented. (#2251) 2023-10-13 00:14:02 +02:00
0bb5b3bda6 feat(lua): expose take_control_of (#2249) 2023-10-13 00:13:39 +02:00
94838af288 feat(lua): Allow lua scripts to flag modders with a custom reason if needed. (#2248) 2023-10-13 00:11:37 +02:00
7ad35bb3d7 Fix lua explosion bypass (#2255)
* move explosion_anti_cheat_bypass to its own file

* fix(lua): make sure lua user don't get tapped by game ac when using ADD_OWNED_EXPLOSION
2023-10-12 23:34:46 +02:00
afd3a5e943 Add Garage drop-down to Spawn PV menu (#2171)
* Fixed edge case where a garage that contained only banned vehicles would show if the user was using Spawn Clone.
Refactored a large portion of the garage code to be production ready.
Formatting changes.

* Added singular garage items to the m_garage setter like the Terrorbyte.

* Fixed is_blacklisted_vehicle returning an inverted condition.
Fixed Garage drop-down not updating properly.

* Separated out m_garage's setter into a ctor function.
Replaced the 4 singular garages that use an overloaded index with a define to be able to shift them easier when new properties are added.

* Removed obsolete and incorrect player.character_slot config entry.
Removed deprecated local_player.hpp.
Added self::char_slot that is guaranteed to be correct.

* Removed extraneous semi-colon.

* Added more stuff to fillsnacks.
Removed more extraneous usages of MPPLY_LAST_MP_CHAR.

* Added the vehicle's name to player info.

* Fixed get_property_garage_size returning the incorrect size for the facility.
Fixed get_static_property_name returning the Nightclub's name instead of Nightclub Service Entrance to maintain consistency with the Mechanic.
Fixed garage_slot_iterator not starting and ending at the correct indexes.

* Shifted the singular properties down one to compensate for the new math.

* Fixed backwards math on Terrorbyte and Nightclub B1.

* Fixed garage not being updated when the player moved the vehicle.

* Fixed backwards comments.
2023-09-22 23:16:33 +02:00
1817ee9fda fix(lua): Fix crash when trying to reload a non-existent script. (#2151) (#2162) 2023-09-20 14:51:23 +02:00
5eead0436f Huge protection improvements and other stuff (#1963)
* feat(protections): add a fuzzer
* feat(protections): improve protections
* feat(spoofing): add warning
* feat(world): force object cleanup
* fix(weapons): fix custom weapon code
* fix(weapons): fix for #1983
2023-08-19 13:01:08 +02:00
c54be57469 fix(lua): fix script array iterator being potentially invalidated while iterating due to new scripts that could be added and the vector getting reallocated due to it. (#1883) 2023-07-29 11:22:04 +02:00
fb0fb191e7 fix(lua): input_float:get_value() was returning the wrong type (#1879) 2023-07-28 13:59:22 +02:00
93966dc3b1 Feat lua stats (#1875) 2023-07-28 10:07:17 +02:00
96493b5a22 refactor!: Modify command argument handling and move on_ method to bool_command (#1826) 2023-07-26 22:22:40 +02:00
fa8043be2a lua: sub folders support, check for .lua file extension, refactor and simplify internals. (#1775) 2023-07-22 13:05:43 +02:00
093abc72da feat(lua): Add entities.get_all_vehicles_as_handles() Add entities.get_all_peds_as_handles() Add entities.get_all_objects_as_handles() (#1795) 2023-07-21 21:21:51 +02:00