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>
This commit is contained in:
maybegreat48 2024-07-03 21:04:06 +00:00 committed by GitHub
parent 50da01eb22
commit 61ddba1634
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 133419 additions and 132578 deletions

View File

@ -79,5 +79,7 @@ if(MSVC)
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})
else()
add_compile_definitions(YIM_DEV)
endif()
endif()

View File

@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
gtav_classes
GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git
GIT_TAG 68551ec2e5b09d6fe629abb7726148127d9f9e6f
GIT_TAG 3d41688e9b74a1adb33a90bf529a647177fa486c
GIT_PROGRESS TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View File

@ -6565,4 +6565,31 @@
0x690B76BD2763E068,0x340CF8A9750C3D1A
0x40EB1EFD921822BC,0xFAF127E6FF05E72E
0x340A36A700E99699,0xA759D3AD1579CBCB
0x8E580AB902917360,0x3AABE0CD8115D72E
0x8E580AB902917360,0x3AABE0CD8115D72E
0xEB7D0E1FCC8FE17A,0xEB7D0E1FCC8FE17A
0xDDA77EE33C005AAF,0xDDA77EE33C005AAF
0x34CFC4C2A38E83E3,0x34CFC4C2A38E83E3
0x710286BC5EF4D6E1,0x710286BC5EF4D6E1
0xB09D42557C45EBA1,0xB09D42557C45EBA1
0x338ECE3637937BC2,0x338ECE3637937BC2
0x62E29CDA11F9C230,0x62E29CDA11F9C230
0x9F633448E4C73207,0x9F633448E4C73207
0xCFE359CCCFE359CC,0xCFE359CCCFE359CC
0x527803286A8B6C81,0x527803286A8B6C81
0x014A73449675121D,0x014A73449675121D
0x0C87C83C8950432B,0x0C87C83C8950432B
0xB327CF1B8C2C0EA3,0xB327CF1B8C2C0EA3
0x0D94071E55F4C9CE,0x0D94071E55F4C9CE
0x367E5E33E7F0DD1A,0x367E5E33E7F0DD1A
0xE9D0244ACBEE1BC4,0xE9D0244ACBEE1BC4
0x9BA54B3CFB82ADDD,0x9BA54B3CFB82ADDD
0xB39F03368DB0CAA2,0xB39F03368DB0CAA2
0xC73EFFC5E043A8BA,0xC73EFFC5E043A8BA
0x69AA35F3F391CDBA,0x69AA35F3F391CDBA
0x75CC8931A11128C9,0x75CC8931A11128C9
0x75CC8931A11128C9,0x75CC8931A11128C9
0xAA434D7D0A89A95C,0xAA434D7D0A89A95C
0xE6D323A5E9EFFB76,0xE6D323A5E9EFFB76
0xBEB0D930B3CCE4D5,0xBEB0D930B3CCE4D5
0x1FCB07FE230B6639,0x1FCB07FE230B6639
0x1423725069EE1D14,0x1423725069EE1D14

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ 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 = 4;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::ForceMission, (int64_t)self::id, 1 << self::id, 0};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::ForceMission, (int64_t)self::id, 1 << player->id(), 0};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::ForceMission);
}

View File

@ -3,12 +3,13 @@
#include "natives.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "util/scripts.hpp"
#include <script/globals/GPBD_FM_3.hpp>
namespace big
{
template<int scriptId, int arg19 = 0>
template<rage::joaat_t script_hash>
class start_script : player_command
{
using player_command::player_command;
@ -20,38 +21,17 @@ 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 = 27;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id, 1 << player->id()};
args[3] = scriptId;
strcpy((char*)&args[3 + 3], "0");
args[3 + 16] = -1;
args[3 + 17] = 1337;
args[3 + 19] = arg19;
args[25] = 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(), (int)eRemoteEvent::StartScriptBegin);
for (int i = 0; i < 2; i++)
{
const size_t arg_count_2 = 27;
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id, 1 << player->id()};
args_2[3 + 17] = 1337;
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);
}
scripts::force_script_on_player(player, script_hash);
}
};
// Scripts should be up-to-date as of 5/5/2024
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<230> g_start_badlands("badlands", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II_DESC", 0);
start_script<235> g_start_space_monkey("spacemonkey", "BACKEND_START_SCRIPT_START_SPACE_MONKEY", "BACKEND_START_SCRIPT_START_SPACE_MONKEY_DESC", 0);
start_script<231> g_start_wizards_ruin("wizard", "BACKEND_START_SCRIPT_START_WIZARD", "BACKEND_START_SCRIPT_START_WIZARD_DESC", 0);
start_script<236> g_start_qub3d("qub3d", "BACKEND_START_SCRIPT_START_QUB3D", "BACKEND_START_SCRIPT_START_QUB3D_DESC", 0); // puzzle
start_script<237> g_start_camhedz("camhedz", "BACKEND_START_SCRIPT_START_CAMHEDZ", "BACKEND_START_SCRIPT_START_CAMHEDZ_DESC", 0);
start_script<"fm_intro"_J> g_start_tutorial("tutorial", "BACKEND_START_SCRIPT_START_TUTORIAL", "BACKEND_START_SCRIPT_START_TUTORIAL_DESC", 0);
start_script<"golf_mp"_J> g_start_golf("golf", "BACKEND_START_SCRIPT_START_GOLF", "BACKEND_START_SCRIPT_START_GOLF_DESC", 0);
start_script<"Pilot_School_MP"_J> g_start_flight_school("flightschool", "BACKEND_START_SCRIPT_START_FLIGHT_SCHOOL", "BACKEND_START_SCRIPT_START_FLIGHT_SCHOOL_DESC", 0);
start_script<"AM_Darts"_J> g_start_darts("darts", "BACKEND_START_SCRIPT_START_DARTS", "BACKEND_START_SCRIPT_START_DARTS_DESC", 0);
start_script<"gunslinger_arcade"_J> g_start_badlands("badlands", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II", "BACKEND_START_SCRIPT_START_BADLANDS_REVENGE_II_DESC", 0);
start_script<"ggsm_arcade"_J> g_start_space_monkey("spacemonkey", "BACKEND_START_SCRIPT_START_SPACE_MONKEY", "BACKEND_START_SCRIPT_START_SPACE_MONKEY_DESC", 0);
start_script<"wizard_arcade"_J> g_start_wizards_ruin("wizard", "BACKEND_START_SCRIPT_START_WIZARD", "BACKEND_START_SCRIPT_START_WIZARD_DESC", 0);
start_script<"puzzle"_J> g_start_qub3d("qub3d", "BACKEND_START_SCRIPT_START_QUB3D", "BACKEND_START_SCRIPT_START_QUB3D_DESC", 0);
start_script<"camhedz_arcade"_J> g_start_camhedz("camhedz", "BACKEND_START_SCRIPT_START_CAMHEDZ", "BACKEND_START_SCRIPT_START_CAMHEDZ_DESC", 0);
}

View File

@ -29,7 +29,7 @@ namespace big
g_notification_service.push("TURN_INTO_BEAST"_T.data(), "BACKEND_TURN_INTO_BEAST_STARTING"_T.data());
scripts::start_launcher_script(47);
scripts::start_launcher_script("AM_HUNT_THE_BEAST"_J);
for (int i = 0; !NETWORK::NETWORK_IS_PLAYER_A_PARTICIPANT_ON_SCRIPT(id, "am_hunt_the_beast", -1); i++)
{
@ -83,7 +83,7 @@ namespace big
virtual void execute(const command_arguments& _args, const std::shared_ptr<command_context> ctx)
{
scripts::start_launcher_script(47);
scripts::start_launcher_script("AM_HUNT_THE_BEAST"_J);
for (int i = 0; !scripts::is_running("am_launcher"_J); i++)
{

View File

@ -50,7 +50,7 @@ namespace big
if (rotate_cam_bits)
{
const size_t arg_count = 4;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TSECommand, (int64_t)self::id, (int64_t)eRemoteEvent::TSECommandRotateCam, rotate_cam_bits};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TSECommand, (int64_t)self::id, (int64_t)rotate_cam_bits, (int64_t)eRemoteEvent::TSECommandRotateCam};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, rotate_cam_bits, (int)eRemoteEvent::TSECommand);
}

View File

@ -28,7 +28,7 @@ namespace big
g_script_patcher_service->add_patch({"carmod_shop"_J, "disable camera", "2D 01 0A 00 00 4F ? ? 40 ? 41 ? 39 03", 5, {0x2E, 0x01, 0x00}, &g.vehicle.ls_customs}); // disable camera
g_script_patcher_service->add_patch({"carmod_shop"_J, "carmod_shop1", "2D 02 10 00 00 2C", 5, {0x71, 0x2E, 0x02, 0x01}, &g.vehicle.ls_customs});
g_script_patcher_service->add_patch({"carmod_shop"_J, "carmod_shop2", "2D 00 B8 00 00", 5, {0x2E, 0x00, 0x00}, &g.vehicle.ls_customs});
g_script_patcher_service->add_patch({"carmod_shop"_J, "allow all vehicles", "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, nullptr}); // allow all vehicles
//g_script_patcher_service->add_patch({"carmod_shop"_J, "allow all vehicles", "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, nullptr}); // allow all vehicles
g_script_patcher_service->add_patch({"carmod_shop"_J, "allow all vehicles 2", "2D 03 07 00 00 71 38 02", 5, {0x72, 0x2E, 0x03, 0x01}, nullptr}); // allow all vehicles 2
for (auto& entry : *g_pointers->m_gta.m_script_program_table)

View File

@ -25,7 +25,7 @@ namespace big
explosion_anti_cheat_bypass::m_can_blame_others =
memory::byte_patch::make(g_pointers->m_gta.m_blame_explode.as<uint16_t*>(), 0xE990).get();
explosion_anti_cheat_bypass::m_set_script_flag =
memory::byte_patch::make(g_pointers->m_gta.m_blame_explode.sub(0x12).as<uint32_t*>(), 0x90909090).get();
memory::byte_patch::make(g_pointers->m_gta.m_blame_explode.sub(0x63).as<uint32_t*>(), 0x90909090).get();
explosion_anti_cheat_bypass::m_can_use_blocked_explosions =
memory::byte_patch::make(g_pointers->m_gta.m_explosion_patch.sub(12).as<uint16_t*>(), 0x9090).get();
@ -40,12 +40,6 @@ namespace big
// Disable cheat activated netevent when creator warping
memory::byte_patch::make(g_pointers->m_gta.m_creator_warp_cheat_triggered_patch.as<uint8_t*>(), 0xEB)->apply();
// Setup inline hook for sound overload crash protection
g_sound_overload_ret_addr = g_pointers->m_gta.m_sound_overload_detour.add(13 + 15).as<decltype(g_sound_overload_ret_addr)>();
std::vector<byte> bytes = {0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90}; // far jump opcode + a nop opcode
*(void**)(bytes.data() + 6) = sound_overload_detour;
memory::byte_patch::make(g_pointers->m_gta.m_sound_overload_detour.add(13).as<void*>(), bytes)->apply();
// Disable collision when enabled
vehicle::disable_collisions::m_patch =
memory::byte_patch::make(g_pointers->m_gta.m_disable_collision.sub(2).as<uint8_t*>(), 0xEB).get();

View File

@ -178,6 +178,7 @@ namespace big
"fm_content_bank_shootout"_J,
"fm_content_armoured_truck"_J,
"fm_content_ghosthunt"_J,
"fm_content_ufo_abduction"_J,
"fm_content_smuggler_sell"_J,
"fm_content_smuggler_resupply"_J,
"fm_content_smuggler_ops"_J,
@ -195,6 +196,10 @@ namespace big
"fm_content_vehrob_arena"_J,
"fm_content_vehrob_casino_prize"_J,
"fm_content_vehrob_submarine"_J,
"fm_content_bounty_targets"_J,
"fm_content_daily_bounty"_J,
"fm_content_dispatch_work"_J,
"fm_content_pizza_delivery"_J,
"AM_BOAT_TAXI"_J,
"AM_HELI_TAXI"_J,
"fm_hold_up_tut"_J,
@ -339,6 +344,7 @@ namespace big
"am_mp_armory_aircraft",
"am_mp_armory_truck",
"am_mp_auto_shop",
"am_mp_bail_office",
"am_mp_biker_warehouse",
"am_mp_boardroom_seating",
"am_mp_bunker",
@ -382,6 +388,7 @@ namespace big
"am_mp_vehicle_reward",
"am_mp_vehicle_weapon",
"am_mp_vinewood_premium_garage",
"am_mp_vinewood_premium_modshop",
"am_mp_warehouse",
"am_mp_yacht",
"am_npc_invites",
@ -401,6 +408,7 @@ namespace big
"apparcadebusiness",
"apparcadebusinesshub",
"appavengeroperations",
"appbailoffice",
"appbikerbusiness",
"appbroadcast",
"appbunkerbusiness",
@ -431,6 +439,7 @@ namespace big
"appsmuggler",
"apptextmessage",
"apptrackify",
"appvinewoodmenu",
"appvlsi",
"appzit",
"arcade_seating",
@ -456,6 +465,7 @@ namespace big
"bailbond3",
"bailbond4",
"bailbond_launcher",
"bail_office_seating",
"barry1",
"barry2",
"barry3",
@ -672,6 +682,7 @@ namespace big
"fm_content_bar_resupply",
"fm_content_bicycle_time_trial",
"fm_content_bike_shop_delivery",
"fm_content_bounty_targets",
"fm_content_business_battles",
"fm_content_cargo",
"fm_content_cerberus",
@ -682,6 +693,8 @@ namespace big
"fm_content_club_source",
"fm_content_convoy",
"fm_content_crime_scene",
"fm_content_daily_bounty",
"fm_content_dispatch_work",
"fm_content_drug_lab_work",
"fm_content_drug_vehicle",
"fm_content_export_cargo",
@ -698,6 +711,7 @@ namespace big
"fm_content_parachuter",
"fm_content_payphone_hit",
"fm_content_phantom_car",
"fm_content_pizza_delivery",
"fm_content_possessed_animals",
"fm_content_robbery",
"fm_content_security_contract",
@ -715,6 +729,7 @@ namespace big
"fm_content_test",
"fm_content_tow_truck_work",
"fm_content_tuner_robbery",
"fm_content_ufo_abduction",
"fm_content_vehicle_list",
"fm_content_vehrob_arena",
"fm_content_vehrob_cargo_ship",
@ -942,6 +957,7 @@ namespace big
"letterscraps",
"line_activation_test",
"liverecorder",
"localpopulator",
"locates_tester",
"luxe_veh_activity",
"magdemo",
@ -976,6 +992,7 @@ namespace big
"mission_triggerer_b",
"mission_triggerer_c",
"mission_triggerer_d",
"mmmm",
"mpstatsinit",
"mptestbed",
"mp_awards",
@ -1119,6 +1136,7 @@ namespace big
"profiler_registration",
"prologue1",
"prop_drop",
"public_mission_creator",
"puzzle",
"racetest",
"rampage1",
@ -1130,6 +1148,7 @@ namespace big
"randomchar_controller",
"range_modern",
"range_modern_mp",
"rcpdata",
"replay_controller",
"rerecord_recording",
"respawn_controller",
@ -1301,6 +1320,7 @@ namespace big
"vehicle_stealth_mode",
"vehrob_planning",
"veh_play_widget",
"vinewood_premium_garage_carmod",
"walking_ped",
"wardrobe_mp",
"wardrobe_sp",

View File

@ -11,26 +11,26 @@ namespace big
{"FRIEND", 2050},
{"SHOP", 2324},
{"CELLPHONE", 2552},
{"VEHICLE_SPAWN", 3868},
{"VEHICLE_SPAWN", 3568},
{"CAR_MOD_SHOP", 3750},
{"PAUSE_MENU_SCRIPT", 3076},
{"APP_INTERNET", 4592},
{"MULTIPLAYER_MISSION", 5050},
{"CONTACTS_APP", 4000},
{"INTERACTION_MENU", 9800},
{"SCRIPT_XML", 8500},
{"SCRIPT_XML", 8344},
{"PROPERTY_INT", 19400},
{"ACTIVITY_CREATOR_INT", 15900},
{"SMPL_INTERIOR", 6500},
{"SMPL_INTERIOR", 2512},
{"WAREHOUSE", 14100},
{"IE_DELIVERY", 2324},
{"SHOP_CONTROLLER", 3800},
{"AM_MP_YACHT", 5000},
{"INGAMEHUD", 4600},
{"TRANSITION", 8032},
{"FMMC_LAUNCHER", 26000},
{"MULTIPLAYER_FREEMODE", 82500},
{"MISSION", 60500},
{"MP_LAUNCH_SCRIPT", 37500},
{"FMMC_LAUNCHER", 27000},
{"MULTIPLAYER_FREEMODE", 85000},
{"MISSION", 62500},
{"MP_LAUNCH_SCRIPT", 34750},
};
}

View File

@ -2,5 +2,5 @@
namespace big
{
static constexpr inline auto weathers = std::to_array({"EXTRASUNNY", "CLEAR", "CLOUDS", "SMOG", "FOGGY", "OVERCAST", "RAIN", "THUNDER", "CLEARING", "NEUTRAL", "SNOW", "BLIZZARD", "SNOWLIGHT", "XMAS", "HALLOWEEN"});
static constexpr inline auto weathers = std::to_array({"EXTRASUNNY", "CLEAR", "CLOUDS", "SMOG", "FOGGY", "OVERCAST", "RAIN", "THUNDER", "CLEARING", "NEUTRAL", "SNOW", "BLIZZARD", "SNOWLIGHT", "XMAS", "HALLOWEEN", "SNOW_HALLOWEEN", "RAIN_HALLOWEEN"});
}

View File

@ -10,12 +10,12 @@ namespace big::scr_globals
static inline const script_global gsbd_fm_events(1916617);
static inline const script_global gsbd_block_c(2657971);
static inline const script_global gsbd_property_instances(1936863);
static inline const script_global globalplayer_bd(2657971);
static inline const script_global gpbd_fm_3(1887305);
static inline const script_global gpbd_fm_1(1845281);
static inline const script_global interiors(1943520);
static inline const script_global launcher_global(2699171);
static inline const script_global sp(114370); // check flow_controller
@ -40,7 +40,7 @@ namespace big::scr_globals
static inline const script_global spawn_global(2696212);
static inline const script_global dance_state(1943520);
static inline const script_global transaction_overlimit(20913);
static inline const script_global stats(2359296);
@ -53,16 +53,17 @@ namespace big::scr_globals
static inline const script_global session6(2696130); // freemode -> if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
static inline const script_global interaction_menu_access(2710429); // am_pi_menu -> if (NETWORK::NETWORK_IS_SIGNED_ONLINE()) first global after that
static inline const script_global disable_wasted_sound(2707679); // freemode -> AUDIO::PLAY_SOUND_FRONTEND(-1, "Wasted", "POWER_PLAY_General_Soundset", true);
static inline const script_global passive(1574582); // if (((!PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED(bVar1), false) || Global_
static inline const script_global property_garage(1586521);
static inline const script_global property_garage(1937684);
static inline const script_global property_names(1312298);
static inline const script_global reset_clothing(104077); // freemode 75, &iLocal_.*, 2\);
static inline const script_global gun_van(1949748); // return -29.532f, 6435.136f, 31.162f;
}

View File

@ -11,7 +11,8 @@ namespace rage
uint32_t curlen; // 0x10
uint32_t maxlen; // 0x14
uint32_t unk4; // 0x18
uint8_t flags; // 0x1C
uint32_t unk5; // 0x1C
uint8_t flags; // 0x20
public:
json_serializer(char* _buffer, uint32_t _length) :
@ -22,6 +23,7 @@ namespace rage
unk1 = 0;
curlen = 0;
unk4 = 1;
unk5 = 0;
flags = 0;
}
@ -30,6 +32,6 @@ namespace rage
return buffer;
}
};
static_assert(sizeof(json_serializer) == 0x1D); // size is actually 0x20
static_assert(sizeof(json_serializer) == 0x21); // size is actually 0x28
#pragma pack(pop)
}

View File

@ -3659,6 +3659,85 @@ static bool GetVehicleInfoForClanLogo(Hash vehicleModel, rage::fvector3& x, rage
z = {0.0f, -1.0f, 0.0f};
scale = 0.5f;
return true;
case VEHICLE_VORSCHLAGHAMMER:
case VEHICLE_DRIFTVORSCHLAG:
x = {0.f, 1.141f, 1.f};
y = {0.f, 0.f, -1.f};
z = {-1.f, 0.f, 0.f};
scale = 0.25f;
return true;
case VEHICLE_POLIMPALER5:
x = {-1.f, 0.16f, 0.295f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.43f;
return true;
case VEHICLE_CASTIGATOR:
x = {-1.f, 0.315f, 0.1587f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.0455f};
scale = 0.4f;
return true;
case VEHICLE_POLIMPALER6:
x = {-1.f, 0.216f, 0.124f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.41f;
return true;
case VEHICLE_PIPISTRELLO:
x = {-1.f, -0.0897f, 0.f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.2375f;
return true;
case VEHICLE_ENVISAGE:
x = {-1.f, 0.f, 0.2702f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.43f;
return true;
case VEHICLE_DOMINATOR10:
x = {-1.f, 0.f, 0.0653f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.5f;
return true;
case VEHICLE_YOSEMITE1500:
x = {-1.229f, 0.6f, 0.361f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.3f;
return true;
case VEHICLE_EUROSX32:
x = {0.f, 1.71f, 1.f};
y = {0.f, 0.f, -1.f};
z = {-1.f, 0.f, 0.f};
scale = 0.3f;
return true;
case VEHICLE_NIOBE:
x = {-1.f, 0.175f, 0.22f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.35f;
return true;
case VEHICLE_COQUETTE5:
x = {-1.f, 0.f, 0.075f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.5f;
return true;
case VEHICLE_PARAGON3:
x = {-1.f, 0.f, 0.175f};
y = {1.f, 0.f, 0.f};
z = {0.f, -1.f, 0.f};
scale = 0.5f;
return true;
case VEHICLE_PIZZABOY:
x = {0.f, 1.0569f, 1.f};
y = {0.f, -0.5995f, -1.f};
z = {-0.4071f, 0.f, 0.f};
scale = 0.2f;
return true;
default: return false;
}
}

View File

@ -964,3 +964,30 @@ enum Scrapyard : Hash
VEHICLE_VIGERO3 = "VIGERO3"_J,
VEHICLE_VIVANITE = "VIVANITE"_J
};
enum Bottomdollar : Hash
{
VEHICLE_CASTIGATOR = "CASTIGATOR"_J,
VEHICLE_COQUETTE5 = "COQUETTE5"_J,
VEHICLE_DOMINATOR10 = "DOMINATOR10"_J,
VEHICLE_DRIFTCYPHER = "DRIFTCYPHER"_J,
VEHICLE_DRIFTNEBULA = "DRIFTNEBULA"_J,
VEHICLE_DRIFTSENTINEL = "DRIFTSENTINEL"_J,
VEHICLE_DRIFTVORSCHLAG = "DRIFTVORSCHLAG"_J,
VEHICLE_ENVISAGE = "ENVISAGE"_J,
VEHICLE_EUROSX32 = "EUROSX32"_J,
VEHICLE_EUROSX32_HSW = "EUROSX32_HSW"_J,
VEHICLE_NIOBE = "NIOBE"_J,
VEHICLE_NIOBE_HSW = "NIOBE_HSW"_J,
VEHICLE_PARAGON3 = "PARAGON3"_J,
VEHICLE_PIPISTRELLO = "PIPISTRELLO"_J,
VEHICLE_PIZZABOY = "PIZZABOY"_J,
VEHICLE_POLDOMINATOR10 = "POLDOMINATOR10"_J,
VEHICLE_POLDORADO = "POLDORADO"_J,
VEHICLE_POLGREENWOOD = "POLGREENWOOD"_J,
VEHICLE_POLICET3 = "POLICET3"_J,
VEHICLE_POLIMPALER5 = "POLIMPALER5"_J,
VEHICLE_POLIMPALER6 = "POLIMPALER6"_J,
VEHICLE_VORSCHLAGHAMMER = "VORSCHLAGHAMMER"_J,
VEHICLE_YOSEMITE1500 = "YOSEMITE1500"_J
};

View File

@ -58,8 +58,6 @@ namespace big
memory::handle m_creator_warp_cheat_triggered_patch;
memory::handle m_sound_overload_detour;
memory::handle m_disable_collision;
memory::handle m_crash_trigger;

View File

@ -14,11 +14,11 @@ namespace big
if (g.session.chat_commands && message[0] == g.session.chat_command_prefix)
command::process(std::string(message + 1), std::make_shared<chat_command_context>(g_player_service->get_self()));
chat::send_message(message, nullptr, false, is_team);
// chat::send_message(message, nullptr, false, is_team);
if (g.session.log_chat_messages)
chat::log_chat(message, g_player_service->get_self(), SpamReason::NOT_A_SPAMMER, is_team);
return true;
return g_hooking->get_original<hooks::send_chat_message>()(team_mgr, local_gamer_info, message, is_team);
}
}

View File

@ -404,8 +404,11 @@ namespace big
if (player->m_radio_request_rate_limit.exceeded_last_process())
{
session::add_infraction(player, Infraction::TRIED_KICK_PLAYER);
auto p_name = player->get_name();
g_notification_service.push_error("PROTECTIONS"_T.data(),
std::vformat("OOM_KICK"_T, std::make_format_args(player->get_name())));
std::vformat("OOM_KICK"_T, std::make_format_args(p_name)));
player->block_radio_requests = true;
}
return true;
@ -657,9 +660,11 @@ namespace big
{
if (player->m_host_migration_rate_limit.exceeded_last_process())
{
auto p_name = player->get_name();
session::add_infraction(player, Infraction::TRIED_KICK_PLAYER);
g_notification_service.push_error("PROTECTIONS"_T.data(),
std::vformat("OOM_KICK"_T, std::make_format_args(player->get_name())));
std::vformat("OOM_KICK"_T, std::make_format_args(p_name)));
}
return true;
}

View File

@ -372,9 +372,11 @@ namespace big
&& player->m_player_info->m_ped && player->m_player_info->m_ped->m_net_object
&& ownerNetId != player->m_player_info->m_ped->m_net_object->m_object_id)
{
auto p_name = player->get_name();
g_notification_service.push_error("WARNING"_T.data(),
std::vformat("BLAMED_FOR_EXPLOSION"_T,
std::make_format_args(player->get_name(),
std::make_format_args(p_name,
reinterpret_cast<CPed*>(entity)->m_player_info->m_net_player_data.m_name)));
session::add_infraction(g_player_service->get_by_id(player->m_player_id), Infraction::BLAME_EXPLOSION_DETECTED);
LOGF(stream::net_events, WARNING, "{} sent an EXPLOSION_EVENT with addOwnedExplosion enabled and with the wrong owner", player->get_name());

View File

@ -1,21 +0,0 @@
EXTERN g_sound_overload_ret_addr: DQ
.CODE
sound_overload_detour PROC
movzx eax, r8w
lea rdx, [rcx + rcx * 2]
cmp rdx, 190
jle label_1
mov rdx, 0
jmp label_2
label_1:
inc ecx
cmp r8w, [rbx + 28]
label_2:
push 0
mov r11, g_sound_overload_ret_addr
mov [rsp], r11
ret
sound_overload_detour ENDP
END

View File

@ -12,11 +12,18 @@ namespace big
{
unsigned int hooks::broadcast_net_array(rage::netArrayHandlerBase* _this, CNetGamePlayer* target, rage::datBitBuffer* bit_buffer, uint16_t counter, uint32_t* elem_start, bool silent)
{
int orig_mission_id;
int orig_mission_plyr;
int orig_mission_inst;
bool orig_mission_started;
int orig_gsbd;
Player orig_player;
int orig_participant;
bool need_to_spoof_mission_data = false;
auto plyr = g_player_service->get_by_id(target->m_player_id);
bool need_to_use_end_session_kick = plyr && plyr->is_valid()
@ -35,6 +42,19 @@ namespace big
bool need_to_randomize_replay_protection =
g.session.block_ceo_money && _this->m_array == scr_globals::gsbd_fm_events.as<void*>();
if (_this->m_array == scr_globals::gsbd_fm_events.as<void*>())
{
// TODO: we don't need this if we can consistently get arrays to sync
for (auto& player : g_player_service->players())
{
if (player.second->script_host_mission.has_value())
{
need_to_spoof_mission_data = true;
break;
}
}
}
if (need_to_use_end_session_kick)
{
orig_gsbd = *scr_globals::gsbd.as<int*>();
@ -76,6 +96,27 @@ namespace big
broadcast_net_array::m_patch->apply();
}
if (need_to_spoof_mission_data)
{
orig_mission_id = *scr_globals::gsbd_fm_events.at(11).at(144).as<int*>();
orig_mission_plyr = *scr_globals::gsbd_fm_events.at(11).at(145).as<int*>();
orig_mission_inst = *scr_globals::gsbd_fm_events.at(11).at(143).as<int*>();
orig_mission_started = *scr_globals::gsbd_fm_events.at(11).at(146).as<bool*>();
if (plyr->script_host_mission.has_value())
{
*scr_globals::gsbd_fm_events.at(11).at(145).as<int*>() = plyr->id();
*scr_globals::gsbd_fm_events.at(11).at(144).as<int*>() = plyr->script_host_mission.value();
*scr_globals::gsbd_fm_events.at(11).at(146).as<bool*>() = false;
*scr_globals::gsbd_fm_events.at(11).at(143).as<int*>() = -1;
}
else
{
*scr_globals::gsbd_fm_events.at(11).at(146).as<bool*>() = true;
}
broadcast_net_array::m_patch->apply();
}
int ret = g_hooking->get_original<hooks::broadcast_net_array>()(_this, target, bit_buffer, counter, elem_start, silent);
if (need_to_use_end_session_kick)
@ -101,6 +142,15 @@ namespace big
broadcast_net_array::m_patch->restore();
}
if (need_to_spoof_mission_data)
{
*scr_globals::gsbd_fm_events.at(11).at(144).as<int*>() = orig_mission_id;
*scr_globals::gsbd_fm_events.at(11).at(145).as<int*>() = orig_mission_plyr;
*scr_globals::gsbd_fm_events.at(11).at(143).as<int*>() = orig_mission_inst;
*scr_globals::gsbd_fm_events.at(11).at(144).as<bool*>() = orig_mission_started;
broadcast_net_array::m_patch->restore();
}
return ret;
}
}

File diff suppressed because one or more lines are too long

View File

@ -952,9 +952,9 @@ namespace lua::native
MONEY::NETWORK_SPEND_GANGOPS_REPAIR_COST(p0, p1, p2);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_NIGHTCLUB(Any p0)
static void LUA_NATIVE_MONEY_NETWORK_EARN_NIGHTCLUB(Any p0, Any p1)
{
MONEY::NETWORK_EARN_NIGHTCLUB(p0);
MONEY::NETWORK_EARN_NIGHTCLUB(p0, p1);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_NIGHTCLUB_DANCING(Any p0)
@ -1202,9 +1202,9 @@ namespace lua::native
MONEY::NETWORK_EARN_UPGRADE_ARCADE(p0, p1, p2);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_ARCADE(Any p0, Any p1, Any p2, Any p3, Any p4)
static void LUA_NATIVE_MONEY_NETWORK_EARN_ARCADE(Any p0, Any p1, Any p2, Any p3, Any p4, Any p5)
{
MONEY::NETWORK_EARN_ARCADE(p0, p1, p2, p3, p4);
MONEY::NETWORK_EARN_ARCADE(p0, p1, p2, p3, p4, p5);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_COLLECTABLES(Any p0, Any p1, Any p2)
@ -1427,9 +1427,9 @@ namespace lua::native
MONEY::NETWORK_SPEND_GUNRUNNING(p0, p1, p2, p3);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_AGENCY_SAFE(Any p0)
static void LUA_NATIVE_MONEY_NETWORK_EARN_AGENCY_SAFE(Any p0, Any p1)
{
MONEY::NETWORK_EARN_AGENCY_SAFE(p0);
MONEY::NETWORK_EARN_AGENCY_SAFE(p0, p1);
}
static void LUA_NATIVE_MONEY_NETWORK_EARN_AWARD_CONTRACT(Any p0, Any p1)

View File

@ -1517,9 +1517,9 @@ namespace lua::native
return retval;
}
static void LUA_NATIVE_NETWORK_NETWORK_ADD_INVALID_OBJECT_MODEL(Hash modelHash)
static void LUA_NATIVE_NETWORK_NETWORK_ADD_INVALID_OBJECT_MODEL(Hash modelHash, Any p1)
{
NETWORK::NETWORK_ADD_INVALID_OBJECT_MODEL(modelHash);
NETWORK::NETWORK_ADD_INVALID_OBJECT_MODEL(modelHash, p1);
}
static void LUA_NATIVE_NETWORK_NETWORK_REMOVE_INVALID_OBJECT_MODEL(Hash modelHash)

View File

@ -9,9 +9,9 @@ namespace lua::native
return retval;
}
static Object LUA_NATIVE_OBJECT_CREATE_OBJECT_NO_OFFSET(Hash modelHash, float x, float y, float z, bool isNetwork, bool bScriptHostObj, bool dynamic)
static Object LUA_NATIVE_OBJECT_CREATE_OBJECT_NO_OFFSET(Hash modelHash, float x, float y, float z, bool isNetwork, bool bScriptHostObj, bool dynamic, Any p7)
{
auto retval = OBJECT::CREATE_OBJECT_NO_OFFSET(modelHash, x, y, z, isNetwork, bScriptHostObj, dynamic);
auto retval = OBJECT::CREATE_OBJECT_NO_OFFSET(modelHash, x, y, z, isNetwork, bScriptHostObj, dynamic, p7);
return retval;
}
@ -126,9 +126,9 @@ namespace lua::native
OBJECT::PLAY_OBJECT_AUTO_START_ANIM(p0);
}
static void LUA_NATIVE_OBJECT_ADD_DOOR_TO_SYSTEM(Hash doorHash, Hash modelHash, float x, float y, float z, bool p5, bool scriptDoor, bool isLocal)
static void LUA_NATIVE_OBJECT_ADD_DOOR_TO_SYSTEM(Hash doorHash, Hash modelHash, float x, float y, float z, bool p5, bool scriptDoor, bool isLocal, Any p8)
{
OBJECT::ADD_DOOR_TO_SYSTEM(doorHash, modelHash, x, y, z, p5, scriptDoor, isLocal);
OBJECT::ADD_DOOR_TO_SYSTEM(doorHash, modelHash, x, y, z, p5, scriptDoor, isLocal, p8);
}
static void LUA_NATIVE_OBJECT_REMOVE_DOOR_FROM_SYSTEM(Hash doorHash, Any p1)

View File

@ -672,12 +672,6 @@ namespace lua::native
PLAYER::SET_PLAYER_TARGETING_MODE(targetMode);
}
static int LUA_NATIVE_PLAYER_GET_PLAYER_TARGETING_MODE()
{
auto retval = PLAYER::GET_PLAYER_TARGETING_MODE();
return retval;
}
static void LUA_NATIVE_PLAYER_SET_PLAYER_TARGET_LEVEL(int targetLevel)
{
PLAYER::SET_PLAYER_TARGET_LEVEL(targetLevel);
@ -1489,7 +1483,6 @@ namespace lua::native
PLAYER.set_function("GIVE_PLAYER_RAGDOLL_CONTROL", LUA_NATIVE_PLAYER_GIVE_PLAYER_RAGDOLL_CONTROL);
PLAYER.set_function("SET_PLAYER_LOCKON", LUA_NATIVE_PLAYER_SET_PLAYER_LOCKON);
PLAYER.set_function("SET_PLAYER_TARGETING_MODE", LUA_NATIVE_PLAYER_SET_PLAYER_TARGETING_MODE);
PLAYER.set_function("GET_PLAYER_TARGETING_MODE", LUA_NATIVE_PLAYER_GET_PLAYER_TARGETING_MODE);
PLAYER.set_function("SET_PLAYER_TARGET_LEVEL", LUA_NATIVE_PLAYER_SET_PLAYER_TARGET_LEVEL);
PLAYER.set_function("GET_IS_USING_FPS_THIRD_PERSON_COVER", LUA_NATIVE_PLAYER_GET_IS_USING_FPS_THIRD_PERSON_COVER);
PLAYER.set_function("GET_IS_USING_HOOD_CAMERA", LUA_NATIVE_PLAYER_GET_IS_USING_HOOD_CAMERA);

View File

@ -1617,11 +1617,6 @@ namespace lua::native
STATS::PLAYSTATS_NJVS_VOTE(p0);
}
static void LUA_NATIVE_STATS_PLAYSTATS_KILL_YOURSELF()
{
STATS::PLAYSTATS_KILL_YOURSELF();
}
static void LUA_NATIVE_STATS_PLAYSTATS_FM_MISSION_END(Any p0, Any p1, Any p2, Any p3)
{
STATS::PLAYSTATS_FM_MISSION_END(p0, p1, p2, p3);
@ -2060,7 +2055,6 @@ namespace lua::native
STATS.set_function("PLAYSTATS_QUIT_MODE", LUA_NATIVE_STATS_PLAYSTATS_QUIT_MODE);
STATS.set_function("PLAYSTATS_MISSION_VOTE", LUA_NATIVE_STATS_PLAYSTATS_MISSION_VOTE);
STATS.set_function("PLAYSTATS_NJVS_VOTE", LUA_NATIVE_STATS_PLAYSTATS_NJVS_VOTE);
STATS.set_function("PLAYSTATS_KILL_YOURSELF", LUA_NATIVE_STATS_PLAYSTATS_KILL_YOURSELF);
STATS.set_function("PLAYSTATS_FM_MISSION_END", LUA_NATIVE_STATS_PLAYSTATS_FM_MISSION_END);
STATS.set_function("PLAYSTATS_HEIST4_PREP", LUA_NATIVE_STATS_PLAYSTATS_HEIST4_PREP);
STATS.set_function("PLAYSTATS_HEIST4_FINALE", LUA_NATIVE_STATS_PLAYSTATS_HEIST4_FINALE);

View File

@ -150,9 +150,9 @@ namespace big
add_native_detour("fm_survival_creator"_J, NativeIndex::GET_USED_CREATOR_BUDGET, creator::GET_USED_CREATOR_BUDGET);
add_native_detour("tuneables_processing"_J, NativeIndex::WAIT, tunables::WAIT);
add_native_detour("tuneables_processing"_J, NativeIndex::NETWORK_ACCESS_TUNABLE_INT_HASH, tunables::NETWORK_ACCESS_TUNABLE_INT_HASH);
add_native_detour("tuneables_processing"_J, NativeIndex::NETWORK_ACCESS_TUNABLE_BOOL_MODIFICATION_DETECTION_REGISTRATION_HASH, tunables::NETWORK_ACCESS_TUNABLE_BOOL_MODIFICATION_DETECTION_REGISTRATION_HASH);
add_native_detour("tuneables_processing"_J, NativeIndex::NETWORK_ACCESS_TUNABLE_FLOAT_HASH, tunables::NETWORK_ACCESS_TUNABLE_FLOAT_HASH);
add_native_detour("tuneables_processing"_J, NativeIndex::_NETWORK_GET_TUNABLES_REGISTRATION_INT, tunables::_NETWORK_GET_TUNABLES_REGISTRATION_INT);
add_native_detour("tuneables_processing"_J, NativeIndex::_NETWORK_GET_TUNABLES_REGISTRATION_BOOL, tunables::_NETWORK_GET_TUNABLES_REGISTRATION_BOOL);
add_native_detour("tuneables_processing"_J, NativeIndex::_NETWORK_GET_TUNABLES_REGISTRATION_FLOAT, tunables::_NETWORK_GET_TUNABLES_REGISTRATION_FLOAT);
// TODO: is this safe?
add_native_detour("arena_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.

View File

@ -1,5 +1,6 @@
#pragma once
#include "services/tunables/tunables_service.hpp"
#include "natives.hpp"
namespace big
{
@ -13,22 +14,37 @@ namespace big
SYSTEM::WAIT(src->get_arg<int>(0));
}
inline void NETWORK_ACCESS_TUNABLE_INT_HASH(rage::scrNativeCallContext* src)
inline void _NETWORK_GET_TUNABLES_REGISTRATION_INT(rage::scrNativeCallContext* src)
{
g_tunables_service->register_tunable(src->get_arg<Hash>(1), src->get_arg<int*>(2));
src->set_return_value<BOOL>(NETWORK::NETWORK_ACCESS_TUNABLE_INT_HASH(src->get_arg<Hash>(0), src->get_arg<Hash>(1), src->get_arg<int*>(2)));
if (g_tunables_service->caching_tunables())
{
g_tunables_service->m_junk_values.emplace(g_tunables_service->m_current_junk_val, src->get_arg<Hash>(0));
src->set_return_value<int>(g_tunables_service->m_current_junk_val++);
return;
}
src->set_return_value<int>(NETWORK::_NETWORK_GET_TUNABLES_REGISTRATION_INT(src->get_arg<Hash>(0), src->get_arg<int>(1)));
};
inline void NETWORK_ACCESS_TUNABLE_BOOL_MODIFICATION_DETECTION_REGISTRATION_HASH(rage::scrNativeCallContext* src)
inline void _NETWORK_GET_TUNABLES_REGISTRATION_BOOL(rage::scrNativeCallContext* src)
{
g_tunables_service->register_tunable(src->get_arg<Hash>(1), src->get_arg<bool*>(2));
src->set_return_value<BOOL>(NETWORK::NETWORK_ACCESS_TUNABLE_BOOL_MODIFICATION_DETECTION_REGISTRATION_HASH(src->get_arg<Hash>(0), src->get_arg<Hash>(1), src->get_arg<BOOL*>(2)));
if (g_tunables_service->caching_tunables())
{
g_tunables_service->m_junk_values.emplace(g_tunables_service->m_current_junk_val, src->get_arg<Hash>(0));
src->set_return_value<int>(g_tunables_service->m_current_junk_val++);
return;
}
src->set_return_value<BOOL>(NETWORK::_NETWORK_GET_TUNABLES_REGISTRATION_BOOL(src->get_arg<Hash>(0), src->get_arg<BOOL>(1)));
};
inline void NETWORK_ACCESS_TUNABLE_FLOAT_HASH(rage::scrNativeCallContext* src)
inline void _NETWORK_GET_TUNABLES_REGISTRATION_FLOAT(rage::scrNativeCallContext* src)
{
g_tunables_service->register_tunable(src->get_arg<Hash>(1), src->get_arg<float*>(2));
src->set_return_value<BOOL>(NETWORK::NETWORK_ACCESS_TUNABLE_FLOAT_HASH(src->get_arg<Hash>(0), src->get_arg<Hash>(1), src->get_arg<float*>(2)));
if (g_tunables_service->caching_tunables())
{
g_tunables_service->m_junk_values.emplace(g_tunables_service->m_current_junk_val, src->get_arg<Hash>(0));
src->set_return_value<int>(g_tunables_service->m_current_junk_val++);
return;
}
src->set_return_value<float>(NETWORK::_NETWORK_GET_TUNABLES_REGISTRATION_FLOAT(src->get_arg<Hash>(0), src->get_arg<float>(1)));
};
}
}

File diff suppressed because it is too large Load Diff

View File

@ -548,7 +548,7 @@ namespace big
// Send Chat Message
{
"SCM",
"48 83 EC 20 48 8B F1 48 8B CA 41 8A E9",
"48 81 EC 80 00 00 00 48 8B E9 48 8B CA 41",
[](memory::handle ptr)
{
g_pointers->m_gta.m_send_chat_message = ptr.sub(21).as<functions::send_chat_message>();
@ -574,11 +574,11 @@ namespace big
},
// Start Matchmaking Find Sessions
{
"SGSBGH",
"E8 ? ? ? ? 84 C0 0F 84 F6 FE FF FF",
"SMFS",
"83 ? ? ? ? E8 ? ? ? ? 84 C0 0F 84 ? ? ? ? C7",
[](memory::handle ptr)
{
g_pointers->m_gta.m_start_matchmaking_find_sessions = ptr.add(1).rip().as<functions::start_matchmaking_find_sessions>();
g_pointers->m_gta.m_start_matchmaking_find_sessions = ptr.add(6).rip().as<functions::start_matchmaking_find_sessions>();
}
},
// Join Session By Info
@ -674,7 +674,7 @@ namespace big
// Player Info Gamer Info
{
"PIGI",
"E8 ? ? ? ? 48 8D 4D 20 48 8B D0 E8 ? ? ? ? 41 8A CF",
"E8 ? ? ? ? 48 8D 4B 20 48 8B D0 E8 ? ? ? ? 41 8A CF",
[](memory::handle ptr)
{
g_pointers->m_gta.m_player_info_gamer_info = ptr.add(1).rip().add(3).rip().as<rage::rlGamerInfo*>();
@ -800,10 +800,10 @@ namespace big
// Handle Remove Gamer Command
{
"HRGC",
"48 85 D2 0F 84 0E 04",
"74 74 33 FF",
[](memory::handle ptr)
{
g_pointers->m_gta.m_handle_remove_gamer_cmd = ptr.as<functions::handle_remove_gamer_cmd>();
g_pointers->m_gta.m_handle_remove_gamer_cmd = ptr.sub(0x3B).as<functions::handle_remove_gamer_cmd>();
}
},
// Broadcast Net Array
@ -1198,10 +1198,10 @@ namespace big
// NetFilter Handle Message
{
"NHM",
"E9 ? ? ? ? 48 8D 81 ? ? ? ? 4C 39 08",
"EB 2E 49 8D 82 ? ? ? ? 4C",
[](memory::handle ptr)
{
g_pointers->m_gta.m_netfilter_handle_message = ptr.add(1).rip().as<PVOID>();
g_pointers->m_gta.m_netfilter_handle_message = ptr.sub(4).rip().as<PVOID>();
}
},
// Handle Chat Message
@ -1481,15 +1481,6 @@ namespace big
g_pointers->m_gta.m_creator_warp_cheat_triggered_patch = ptr;
}
},
// Sound Overload Detour
{
"SOD",
"66 45 3B C1 74 38",
[](memory::handle ptr)
{
g_pointers->m_gta.m_sound_overload_detour = ptr;
}
},
// Disable Collision
{
"DC",
@ -1753,7 +1744,7 @@ namespace big
// Write Node
{
"WN",
"49 89 43 C8 E8 E2 FB 50 00",
"49 89 43 C8 E8 ? ? ? ? 84 C0 0F 95 C0 48 83 C4 ? C3 4C 8B DC",
[](memory::handle ptr)
{
g_pointers->m_gta.m_write_node = ptr.sub(0x49).as<PVOID>();
@ -1798,7 +1789,7 @@ namespace big
// Send Session Detail Msg
{
"SSDM",
"4C 8D 85 F0 01 00 00 49 8B D5", // unstable
"4C 8D 85 ? ? 00 00 49 8B D5 49", // unstable
[](memory::handle ptr)
{
g_pointers->m_gta.m_send_session_detail_msg = ptr.add(0xE).rip().as<PVOID>();
@ -1807,7 +1798,7 @@ namespace big
// Session Request Patch
{
"SRP",
"48 8B 9D 60 01 00 00 E9 FF 00 00 00",
"48 8B BD 70 01 00 00 E9 FF 00 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_session_request_patch = ptr.add(0x13).as<PVOID>();

View File

@ -39,6 +39,7 @@ namespace big
NETWORK,
CHAT,
NETWORK_CONTROLS,
MISSIONS,
SPOOFING,
PLAYER_DATABASE,
@ -141,6 +142,7 @@ namespace big
view::network,
{
{TAB_DECL(CHAT), view::chat}},
{TAB_DECL(NETWORK_CONTROLS), view::network_controls}},
{TAB_DECL(MISSIONS), view::missions}},
{TAB_DECL(SPOOFING), view::spoofing}},
{TAB_DECL(PLAYER_DATABASE), view::player_database}},

View File

@ -5,7 +5,7 @@
#include "script.hpp"
#include "util/mobile.hpp"
#define MAX_GARAGE_NUM 30
#define MAX_GARAGE_NUM 32
namespace big
{
@ -43,6 +43,7 @@ namespace big
case 27: return 337;
case 28: return 350;
case 29: return 363;
case 31: return 515;
case MAX_GARAGE_NUM+0: return 156; //Mobile Operations Center
case MAX_GARAGE_NUM+1: return 224; //Nightclub B1
case MAX_GARAGE_NUM+2: return 223; //Terrorbyte
@ -59,6 +60,7 @@ namespace big
case MAX_GARAGE_NUM+2: //Terrorbyte
case MAX_GARAGE_NUM+3: //Kosatka
case 14: return 1;
case 31: return 2;
case MAX_GARAGE_NUM+1: return 3; //Nightclub B1
case 11: return 8;
case 6:
@ -127,10 +129,12 @@ namespace big
case 27: stat = self::char_index ? "MP1_MULTI_PROPERTY_8"_J : "MP0_MULTI_PROPERTY_8"_J; break;
case 28: stat = self::char_index ? "MP1_MULTI_PROPERTY_9"_J : "MP0_MULTI_PROPERTY_9"_J; break;
case 29: stat = self::char_index ? "MP1_MULTSTOREY_GAR_OWNED"_J : "MP0_MULTSTOREY_GAR_OWNED"_J; break;
case 31: stat = self::char_index ? "MP1_PROP_BAIL_OFFICE"_J : "MP0_PROP_BAIL_OFFICE"_J; break;
case MAX_GARAGE_NUM+0:
case MAX_GARAGE_NUM+1:
case MAX_GARAGE_NUM+2:
case MAX_GARAGE_NUM+3: return 1;
default: return -1;
}
if (stat == NULL)
{
@ -150,7 +154,7 @@ namespace big
{
case 12: //Hangar
{
auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 877).at(267).at(295).as<PINT>();
auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 883).at(268).at(297).as<PINT>();
switch (hangar_id)
{
case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_HANGAR_1"); //LSIA Hangar 1
@ -163,7 +167,7 @@ namespace big
}
case 13: //Facility
{
auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 877).at(267).at(302).as<PINT>();
auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 883).at(268).at(304).as<PINT>();
switch (facility_id)
{
case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_DBASE_1"); //Grand Senora Desert Facility
@ -190,6 +194,7 @@ namespace big
case 25: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("AUT_SHP_GAR"); //Auto Shop
case 26: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("FIXER_GARNAME"); //Agency
case 29: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("WIN22_GARNAME"); //Eclipse Blvd Garage
case 31: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("BO_GARNAME"); //Bail Office
case MAX_GARAGE_NUM+0: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("GRTRUCK"); //Mobile Operations Center
case MAX_GARAGE_NUM+1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_BHUB_GAR0"); //Nightclub B1
case MAX_GARAGE_NUM+2: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_BHUB_CLUBT"); //Terrorbyte

View File

@ -87,6 +87,7 @@ namespace big
std::optional<uint32_t> time_difference;
std::optional<std::chrono::time_point<std::chrono::steady_clock>> last_message_time;
uint32_t num_time_syncs_sent = 9999;
std::optional<int> script_host_mission;
bool block_explosions = false;
bool block_clone_create = false;

View File

@ -4,6 +4,7 @@
#include "natives.hpp"
#include "script.hpp"
#include "util/scripts.hpp"
#include "packet.hpp"
#include <script/globals/GPBD_FM_3.hpp>
@ -47,33 +48,14 @@ namespace big
if (m_debug_logging)
LOG(VERBOSE) << "Starting " << m_script_name << " using am_launcher";
scripts::start_launcher_script(scripts::launcher_index_from_hash(m_script_hash));
scripts::start_launcher_script(m_script_hash);
}
else
{
if (m_debug_logging)
LOG(VERBOSE) << "Starting " << m_script_name << " using TSEs";
const size_t arg_count = 26;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id, 1 << m_target->get()->id()};
args[3] = scripts::launcher_index_from_hash(m_script_hash);
strcpy((char*)&args[3 + 3], "0");
args[3 + 16] = -1;
args[3 + 17] = 1337;
args[25] = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[m_target->get()->id()].ScriptEventReplayProtectionCounter;
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << m_target->get()->id(), (int)eRemoteEvent::StartScriptBegin);
for (int i = 0; i < 2; i++)
{
const size_t arg_count_2 = 26;
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id, 1 << m_target->get()->id()};
args_2[3 + 17] = 1337;
g_pointers->m_gta.m_trigger_script_event(1, args_2, arg_count_2, 1 << m_target->get()->id(), (int)eRemoteEvent::StartScriptProceed);
script::get_current()->yield(20ms);
}
scripts::force_script_on_player(m_target.value(), m_script_hash);
}
}
@ -94,7 +76,7 @@ namespace big
bool script_connection::set_script_as_networked()
{
gta_util::execute_as_script(m_thread, [this] {
NETWORK::NETWORK_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(32, true, m_instance_id);
NETWORK::NETWORK_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(m_max_players, false, m_instance_id);
});
for (int i = 0; i < 100; i++)
@ -132,7 +114,7 @@ namespace big
memset(m_host_broadcast_data, 0, m_host_broadcast_size * sizeof(uint64_t));
}
if (m_player_broadcast_data)
if (m_player_broadcast_size)
{
m_player_broadcast_data = new uint64_t[m_player_broadcast_size];
@ -203,7 +185,7 @@ namespace big
bool script_connection::wait_for_connection_to_remote()
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 3000; i++)
{
bool is_a_participant = false;
gta_util::execute_as_script(m_thread, [&is_a_participant, this] {
@ -213,7 +195,7 @@ namespace big
if (is_a_participant)
return true;
script::get_current()->yield(25ms);
script::get_current()->yield();
}
return false;
@ -279,6 +261,7 @@ namespace big
if (need_to_create && m_target && !wait_for_connection_to_remote())
{
force_host_of_script();
if (m_debug_logging)
LOG(FATAL) << "Failed to connect to remote";
@ -360,8 +343,7 @@ namespace big
return true;
}
#if 0
if (m_target && m_target->get()->is_valid())
if (m_startup_done && m_target && m_target->get()->is_valid())
{
bool is_a_participant = false;
@ -377,7 +359,6 @@ namespace big
return true;
}
}
#endif
bool might_cleanup = m_quick_cleanup || MISC::GET_NUMBER_OF_FREE_STACKS_OF_THIS_SIZE(DEFAULT_STACK_SIZE) < 5;
@ -392,4 +373,46 @@ namespace big
return false;
}
void script_connection::give_host()
{
if (!m_thread)
return;
auto handler = static_cast<CGameScriptHandlerNetComponent*>(m_thread->m_net_component);
if (!handler)
return;
if (!handler->is_local_player_host())
{
// grab host first
handler->do_host_migration(g_player_service->get_self()->get_net_game_player(), 1, true);
packet pack;
pack.write_message(rage::eNetMessage::MsgScriptVerifyHostAck);
handler->m_script_handler->get_id()->serialize(&pack.m_buffer);
pack.write<bool>(true, 1);
pack.write<bool>(true, 1);
pack.write<std::uint16_t>(1, 16);
for (auto& player : g_player_service->players())
{
if (player.second->get_net_game_player())
pack.send(player.second->get_net_game_player()->m_msg_id);
}
script::get_current()->yield(500ms);
}
if (!m_thread)
return;
// give host
packet pack;
pack.write_message(rage::eNetMessage::MsgScriptMigrateHost);
handler->m_script_handler->get_id()->serialize(&pack.m_buffer);
pack.write<std::uint16_t>(handler->m_host_token + 2, 16);
pack.write<std::uint32_t>(0xFFFFFFFF, 32);
pack.send(m_target->get()->get_net_game_player()->m_msg_id);
}
}

View File

@ -22,6 +22,7 @@ namespace big
bool m_quick_cleanup = false;
std::optional<int> m_host_broadcast_default_data_address = std::nullopt;
std::optional<int> m_player_broadcast_default_data_address = std::nullopt;
int m_max_players = 32;
std::function<void(rage::scrThread*, uint64_t*, uint64_t*)> m_broadcast_setup_callback{};
std::function<void(rage::scrThread*, uint64_t*, uint64_t*)> m_broadcast_modify_callback{};
@ -48,6 +49,7 @@ namespace big
void start();
void cleanup();
bool should_cleanup();
void give_host();
// clang-format off
@ -63,6 +65,7 @@ namespace big
inline void set_quick_cleanup(bool enabled) { m_quick_cleanup = enabled; }
inline void set_host_broadcast_default_data_address(int data_address) { m_host_broadcast_default_data_address = data_address; }
inline void set_player_broadcast_default_data_address(int data_address) { m_player_broadcast_default_data_address = data_address; }
inline void set_max_players(int num) { m_max_players = num; }
// thread, host_broadcast_data, player_broadcast_data
inline void set_broadcast_setup_callback(std::function<void(rage::scrThread*, uint64_t*, uint64_t*)> cb) { m_broadcast_setup_callback = std::move(cb); }

View File

@ -48,9 +48,12 @@ namespace big
if (!m_script_started)
{
SCRIPT::REQUEST_SCRIPT_WITH_NAME_HASH("tuneables_processing"_J);
SCRIPT::REQUEST_SCRIPT_WITH_NAME_HASH("tunables_registration"_J);
if (SCRIPT::HAS_SCRIPT_WITH_NAME_HASH_LOADED("tuneables_processing"_J))
if (SCRIPT::HAS_SCRIPT_WITH_NAME_HASH_LOADED("tuneables_processing"_J) && SCRIPT::HAS_SCRIPT_WITH_NAME_HASH_LOADED("tunables_registration"_J))
{
m_num_tunables = gta_util::find_script_program("tunables_registration"_J)->m_global_count - 0x40000;
uint64_t args[] = {6, 27}; // TODO: check args
int id = SYSTEM::START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS("tuneables_processing"_J, (Any*)args, sizeof(args) / 8, DEFAULT_STACK_SIZE);
@ -61,29 +64,38 @@ namespace big
return;
}
SCRIPT::SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED("tuneables_processing"_J);
m_script_started = true;
m_tunables_backup = std::make_unique<std::uint64_t[]>(m_num_tunables);
memcpy(m_tunables_backup.get(), script_global(0x40000).as<void*>(), m_num_tunables * 8);
g_script_patcher_service->add_patch({"tuneables_processing"_J, "tuneables_processing1", "2E ? ? 55 ? ? 38 06", 0, std::vector<uint8_t>(17, 0x0), &m_script_started}); // bool tunables registration hack
if (auto program = gta_util::find_script_program("tuneables_processing"_J))
g_script_patcher_service->on_script_load(program);
SCRIPT::SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED("tuneables_processing"_J);
SCRIPT::SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED("tunables_registration"_J);
m_script_started = true;
}
}
else
{
if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH("tuneables_processing"_J) == 0)
{
for (int i = 0; i < m_num_tunables; i++)
{
auto value = *script_global(0x40000).at(i).as<int*>();
if (auto it = m_junk_values.find(value); it != m_junk_values.end())
{
m_tunables.emplace(it->second, 0x40000 + i);
}
}
memcpy(script_global(0x40000).as<void*>(), m_tunables_backup.get(), m_num_tunables * 8);
if (m_tunables.size() == 0)
{
LOG(FATAL) << "Failed to cache tunables";
g_script_patcher_service->update();
return;
}
m_script_started = false;
m_initialized = true;
LOG(INFO) << "Saving " << m_tunables.size() << " tunables to cache";
g_script_patcher_service->update();
m_tunables_backup.release();
save();
}
}
@ -99,11 +111,11 @@ namespace big
*(uint32_t*)data_ptr = m_tunables.size();
data_ptr += sizeof(uint32_t);
for (auto& [hash, ptr] : m_tunables)
for (auto& [hash, val] : m_tunables)
{
auto save_struct = (tunable_save_struct*)data_ptr;
save_struct->hash = hash;
save_struct->offset = ((std::int64_t*)ptr) - g_pointers->m_gta.m_script_globals[1];
save_struct->offset = val;
data_ptr += sizeof(tunable_save_struct);
}
@ -122,7 +134,7 @@ namespace big
for (int i = 0; i < num_tunables; i++)
{
auto save_struct = (tunable_save_struct*)data;
m_tunables.emplace(save_struct->hash, (void*)(g_pointers->m_gta.m_script_globals[1] + save_struct->offset));
m_tunables.emplace(save_struct->hash, save_struct->offset);
data += sizeof(tunable_save_struct);
}

View File

@ -2,6 +2,7 @@
#include "fiber_pool.hpp"
#include "script.hpp"
#include "services/gta_data/cache_file.hpp"
#include "script_global.hpp"
namespace big
{
@ -30,16 +31,11 @@ namespace big
return m_initialized;
}
inline void register_tunable(rage::joaat_t hash, void* pointer)
{
m_tunables.emplace(hash, pointer);
}
template<typename T>
inline std::enable_if_t<std::is_pointer_v<T>, T> get_tunable(rage::joaat_t hash)
{
if (auto it = m_tunables.find(hash); it != m_tunables.end())
return reinterpret_cast<T>(it->second);
return reinterpret_cast<T>(script_global(it->second).as<void*>());
return nullptr;
}
@ -73,6 +69,9 @@ namespace big
}
}
int m_current_junk_val = 0x1000000;
std::unordered_map<int, rage::joaat_t> m_junk_values{};
private:
bool m_initialized = false;
bool m_loading = false;
@ -80,7 +79,9 @@ namespace big
cache_file m_cache_file;
std::unordered_map<rage::joaat_t, void*> m_tunables{};
std::unordered_map<rage::joaat_t, int> m_tunables{};
std::unique_ptr<uint64_t[]> m_tunables_backup;
int m_num_tunables;
void save();
void load();

View File

@ -55,10 +55,14 @@ namespace big::entity
ent = NULL;
return;
}
if (!force && !take_control_of(ent))
if (auto ptr = g_pointers->m_gta.m_handle_to_ptr(ent))
{
LOG(VERBOSE) << "Failed to take control of entity before deleting";
return;
if (ptr->m_net_object)
{
force_remove_network_entity(ptr, true);
return;
}
}
if (ENTITY::IS_ENTITY_A_VEHICLE(ent))

View File

@ -11,6 +11,7 @@
#include "services/players/player_service.hpp"
#include <memory/pattern.hpp>
#include <script/globals/GPBD_FM_3.hpp>
namespace big::scripts
{
@ -90,8 +91,10 @@ namespace big::scripts
// force launcher script over the lobby, take two
// try to get am_launcher in a consistent state before trying to start the script taking account of all participants
inline void start_launcher_script(int script_id)
inline void start_launcher_script(rage::joaat_t script_hash)
{
auto script_id = launcher_index_from_hash(script_hash);
static auto check_players_in_state = [](GtaThread* launcher, int state) -> bool {
bool set = false;
@ -102,7 +105,7 @@ namespace big::scripts
{
if (((CGameScriptHandlerNetComponent*)launcher->m_net_component)->is_player_a_participant(plyr->get_net_game_player()))
{
if (*script_local(launcher->m_stack, 236).at(plyr->id(), 3).at(2).as<int*>() == state)
if (*script_local(launcher->m_stack, 238).at(plyr->id(), 3).at(2).as<int*>() == state)
{
set = true;
break;
@ -170,7 +173,7 @@ namespace big::scripts
// 6) Actually get the script to start
misc::set_bit(scr_globals::launcher_global.at(1).as<int*>(), 1); // run immediately
*scr_globals::launcher_global.at(2).as<int*>() = 6; // will change to 7 shortly but that's fine as players are guaranteed not to be in the waiting stage
*script_local(launcher->m_stack, 236).at(self::id, 3).at(2).as<int*>() = 6;
*script_local(launcher->m_stack, 238).at(self::id, 3).at(2).as<int*>() = 6;
*scr_globals::launcher_global.at(3).at(1).as<int*>() = script_id;
launcher->m_context.m_state = rage::eThreadState::running;
@ -182,6 +185,31 @@ namespace big::scripts
}
}
inline void force_script_on_player(player_ptr player, rage::joaat_t script_hash, int instance = -1)
{
const size_t arg_count = 27;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id, 1 << player->id()};
args[3] = scripts::launcher_index_from_hash(script_hash);
strcpy((char*)&args[3 + 3], "0");
args[3 + 16] = instance;
args[3 + 17] = 1337;
args[3 + 19] = 0;
args[25] = 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(), (int)eRemoteEvent::StartScriptBegin);
for (int i = 0; i < 2; i++)
{
const size_t arg_count_2 = 27;
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id, 1 << player->id()};
args_2[3 + 17] = 1337;
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);
}
}
inline const std::optional<uint32_t> get_code_location_by_pattern(rage::scrProgram* program, const memory::pattern& pattern)
{
uint32_t code_size = program->m_code_size;

View File

@ -72,8 +72,8 @@ namespace big::session
{
int idx = index / 32;
int bit = index % 32;
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(361).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(353).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(379).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(370).at(idx, 1).as<int*>(), bit);
misc::set_bit((int*)&scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.ActiveFreemodeEvents[idx], bit);
}
@ -81,8 +81,8 @@ namespace big::session
{
int idx = index / 32;
int bit = index % 32;
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(361).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(353).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(379).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(370).at(idx, 1).as<int*>(), bit);
misc::clear_bit((int*)&scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.ActiveFreemodeEvents[idx], bit);
}

View File

@ -19,36 +19,19 @@ namespace big
g_local_player->m_player_info->m_net_player_data.m_name);
ImGui::PopStyleColor();
ImGui::EndGroup();
#ifdef YIM_DEV
ImGui::SameLine();
ImGui::SetCursorPos(
{(300.f * g.window.gui_scale) - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x,
ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2)});
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
ImGui::BeginDisabled(g_pointers && *g_pointers->m_gta.m_is_session_started);
if (components::nav_button("UNLOAD"_T))
{
// allow to unload in the main title screen.
if (g_script_mgr.can_tick())
{
// empty the pool, we want the that job below run no matter what for clean up purposes.
g_fiber_pool->reset();
g_fiber_pool->queue_job([] {
g_lua_manager->trigger_event<menu_event::MenuUnloaded>();
for (auto& command : g_looped_commands)
if (command->is_enabled())
command->on_disable();
g_running = false;
});
}
else
{
g_lua_manager->trigger_event<menu_event::MenuUnloaded>();
g_running = false;
}
g_lua_manager->trigger_event<menu_event::MenuUnloaded>();
g_running = false;
}
ImGui::EndDisabled();
ImGui::PopStyleColor();
#endif
}
ImGui::End();
}

View File

@ -213,7 +213,7 @@ namespace big
return;
}
scripts::start_launcher_script(idx);
scripts::start_launcher_script(hash);
});
if (*g_pointers->m_gta.m_game_state != eGameState::Invalid && std::chrono::high_resolution_clock::now() - last_stack_update_time > 100ms)

View File

@ -0,0 +1,262 @@
#include "core/data/apartment_names.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/warehouse_names.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "hooking/hooking.hpp"
#include "util/scripts.hpp"
#include "util/session.hpp"
#include "util/troll.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
#include "backend/bool_command.hpp"
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
struct SessionType
{
eSessionType id;
const char* name;
};
void render_player_options()
{
ImGui::SeparatorText("PLAYER_OPTIONS"_T.data());
ImGui::BeginGroup();
components::command_button<"killall">({}, "KILL_ALL"_T);
components::command_button<"explodeall">({}, "EXPLODE_ALL"_T);
components::command_button<"beastall">({});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"bringall">({});
components::command_button<"giveweapsall">({});
components::command_button<"remweapsall">({});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::command_button<"ceokickall">({});
components::command_button<"vehkickall">({});
components::command_button<"deletevehall">({});
components::command_button<"ragdollall">({}, "RAGDOLL_PLAYERS"_T);
components::command_button<"intkickall">({}, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::command_button<"errorall">({});
components::command_button<"ceoraidall">({});
components::button("TRIGGER_MC_RAID"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
components::button("TRIGGER_BUNKER_RAID"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
ImGui::EndGroup();
components::small_text("BOUNTY"_T);
static int value = 10000;
ImGui::SetNextItemWidth(300);
ImGui::SliderInt("##bountyvalue", &value, 0, 10000);
components::command_checkbox<"anonbounty">();
components::button("Bounty All", [] {
g_player_service->iterate([](auto& plyr) {
troll::set_bounty_on_player(plyr.second, value, g.session.anonymous_bounty);
});
});
}
void render_session_control()
{
ImGui::SeparatorText("SESSION_CONTROL"_T.data());
ImGui::BeginGroup();
ImGui::Checkbox("SCRIPT_BLOCK_AMMUNATION"_T.data(), &g.session.script_block_opts.ammunation);
ImGui::Checkbox("SCRIPT_BLOCK_ATMS"_T.data(), &g.session.script_block_opts.atms);
ImGui::Checkbox("SCRIPT_BLOCK_ARCADE_GAMES"_T.data(), &g.session.script_block_opts.arcade_games);
ImGui::Checkbox("SCRIPT_BLOCK_CASINO_GAMES"_T.data(), &g.session.script_block_opts.casino_games);
ImGui::Checkbox("SCRIPT_BLOCK_DRONES"_T.data(), &g.session.script_block_opts.drones);
ImGui::Checkbox("SCRIPT_BLOCK_GANG_ATTACKS"_T.data(), &g.session.script_block_opts.gang_attacks);
ImGui::Checkbox("SCRIPT_BLOCK_IMPROMPTU_DEATHMATCHES"_T.data(), &g.session.script_block_opts.impromptu_dm);
ImGui::Checkbox("SCRIPT_BLOCK_IMPROMPTU_RACES"_T.data(), &g.session.script_block_opts.impromptu_race);
ImGui::Checkbox("SCRIPT_BLOCK_INTERIORS"_T.data(), &g.session.script_block_opts.interiors);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SCRIPT_BLOCK_INTERIORS_DESC"_T.data());
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("SCRIPT_BLOCK_LSC"_T.data(), &g.session.script_block_opts.lsc);
ImGui::Checkbox("SCRIPT_BLOCK_MOVIES"_T.data(), &g.session.script_block_opts.movies);
ImGui::Checkbox("SCRIPT_BLOCK_PROSTITUTES"_T.data(), &g.session.script_block_opts.prostitutes);
ImGui::Checkbox("SCRIPT_BLOCK_SITTING"_T.data(), &g.session.script_block_opts.sitting);
ImGui::Checkbox("SCRIPT_BLOCK_SLEEPING"_T.data(), &g.session.script_block_opts.sleeping);
ImGui::Checkbox("SCRIPT_BLOCK_STORES"_T.data(), &g.session.script_block_opts.stores);
ImGui::Checkbox("SCRIPT_BLOCK_STREET_DEALER"_T.data(), &g.session.script_block_opts.street_dealer);
ImGui::Checkbox("SCRIPT_BLOCK_STRIP_CLUB"_T.data(), &g.session.script_block_opts.strip_club);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SCRIPT_BLOCK_STRIP_CLUB_DESC"_T.data());
ImGui::Checkbox("SCRIPT_BLOCK_VENDING_MACHINES"_T.data(), &g.session.script_block_opts.vending_machines);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::sub_title("REQUIRES_SCRIPT_HOST"_T);
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("DISABLE_CEO_MONEY_DESC"_T.data());
ImGui::Checkbox("BLOCK_JOBS"_T.data(), &g.session.block_jobs);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("BLOCK_JOBS_DESC"_T.data());
ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors);
components::script_patch_checkbox("BLOCK_MUGGERS"_T, &g.session.block_muggers, "BLOCK_MUGGERS_DESC"_T.data());
components::script_patch_checkbox("BLOCK_CEO_RAIDS"_T, &g.session.block_ceo_raids, "BLOCK_CEO_RAIDS_DESC"_T);
components::command_checkbox<"blockceos">();
ImGui::EndGroup();
}
void render_force_host_options()
{
ImGui::BeginGroup();
components::small_text("FORCE_HOST"_T);
static constexpr auto token_spoof_types = std::to_array({"SPOOF_HOST_TOKEN_OFF", "SPOOF_HOST_TOKEN_TYPE_LEGIT", "SPOOF_HOST_TOKEN_TYPE_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_EXTRA_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_CUSTOM"});
ImGui::BeginDisabled(gta_util::get_network()->m_game_session_state != 0);
ImGui::SetNextItemWidth(300);
if (ImGui::BeginCombo("HOST_TOKEN_SPOOFING"_T.data(),
g_translation_service.get_translation(token_spoof_types[g.session.spoof_host_token_type]).data()))
{
for (int i = 0; i < token_spoof_types.size(); i++)
{
if (ImGui::Selectable(g_translation_service.get_translation(token_spoof_types[i]).data(), i == g.session.spoof_host_token_type))
{
g.session.spoof_host_token_type = i;
g_fiber_pool->queue_job([] {
g.session.spoof_host_token_dirty = true;
}); // this part gets a bit racy so we're setting it in a fiber pool
}
if (i == g.session.spoof_host_token_type)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
if (g.session.spoof_host_token_type != 0)
{
ImGui::Checkbox("HIDE_TOKEN_SPOOFING_WHEN_HOST"_T.data(), &g.session.hide_token_spoofing_when_host);
}
if (g.session.spoof_host_token_type == 4)
{
ImGui::SetNextItemWidth(200);
if (ImGui::InputScalar("##token_input", ImGuiDataType_U64, &g.session.custom_host_token, nullptr, nullptr, "%p", ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
{
g.session.spoof_host_token_dirty = true;
}
}
ImGui::EndDisabled();
//if (g.session.force_session_host)
//{
// ImGui::SameLine();
// ImGui::Checkbox("KICK_HOST_ON_JOIN"_T.data(), &g.session.kick_host_when_forcing_host);
//}
ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_SCRIPT_HOST_DESC"_T.data());
ImGui::SameLine();
ImGui::Checkbox("FAST_JOIN"_T.data(), &g.session.fast_join);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FAST_JOIN_DESC"_T.data());
components::command_button<"emptysession">();
ImGui::EndGroup();
}
void render_session_globals()
{
// TODO: what are we doing with this?
ImGui::BeginGroup();
components::small_text("WARP_TIME"_T);
components::button("PLUS_1_MINUTE"_T, [] {
toxic::warp_time_forward_all(60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_5_MINUTES"_T, [] {
toxic::warp_time_forward_all(5 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_48_MINUTES"_T, [] {
toxic::warp_time_forward_all(48 * 60 * 1000);
});
components::button("PLUS_96_MINUTES"_T, [] {
toxic::warp_time_forward_all(96 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_200_MINUTES"_T, [] {
toxic::warp_time_forward_all(200 * 60 * 1000);
});
ImGui::SameLine();
components::button("STOP_TIME"_T, [] {
toxic::set_time_all(INT_MAX - 3000);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("STOP_TIME_DESC"_T.data());
ImGui::EndGroup();
ImGui::SameLine();
static int global_wanted_level = 0;
ImGui::BeginGroup();
components::small_text("WANTED_LVL"_T);
ImGui::SetNextItemWidth(150);
if (ImGui::SliderInt("##wantedlevel", &global_wanted_level, 0, 5))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::EndGroup();
}
void view::network_controls()
{
render_player_options();
render_session_control();
render_force_host_options();
render_session_globals();
}
}

View File

@ -32,19 +32,19 @@ namespace big
ImGui::BeginGroup();
components::button("VIEW_NET_MISSIONS_HOT_TARGET"_T, [] {
scripts::start_launcher_script(36);
scripts::start_launcher_script("AM_HOT_TARGET"_J);
});
components::button("KILL_LIST"_T, [] {
scripts::start_launcher_script(37);
scripts::start_launcher_script("AM_KILL_LIST"_J);
});
components::button("VIEW_NET_MISSIONS_CHECKPOINTS"_T, [] {
scripts::start_launcher_script(39);
scripts::start_launcher_script("AM_CP_COLLECTION"_J);
});
components::button("CHALLENGES"_T, [] {
scripts::start_launcher_script(40);
scripts::start_launcher_script("AM_CHALLENGES"_J);
});
components::button("PENNED_IN"_T, [] {
scripts::start_launcher_script(41);
scripts::start_launcher_script("AM_PENNED_IN"_J);
});
ImGui::EndGroup();
@ -52,19 +52,19 @@ namespace big
ImGui::BeginGroup();
components::button("HOT_PROPERTY"_T, [] {
scripts::start_launcher_script(43);
scripts::start_launcher_script("AM_HOT_PROPERTY"_J);
});
components::button("KING_OF_THE_CASTLE"_T, [] {
scripts::start_launcher_script(45);
scripts::start_launcher_script("AM_KING_OF_THE_CASTLE"_J);
});
components::button("CRIMINAL_DAMAGE"_T, [] {
scripts::start_launcher_script(46);
scripts::start_launcher_script("AM_CRIMINAL_DAMAGE"_J);
});
components::button("HUNT_THE_BEAST"_T, [] {
scripts::start_launcher_script(47);
scripts::start_launcher_script("AM_HUNT_THE_BEAST"_J);
});
components::button("BUSINESS_BATTLES"_T, [] {
scripts::start_launcher_script(114);
scripts::start_launcher_script("BUSINESS_BATTLES"_J);
});
ImGui::EndGroup();
@ -72,19 +72,19 @@ namespace big
ImGui::BeginGroup();
components::button("VIEW_NET_MISSIONS_ONE_ON_ONE_DEATHMATCH"_T, [] {
scripts::start_launcher_script(216);
scripts::start_launcher_script("FM_Impromptu_DM_Controler"_J);
});
components::button("VIEW_NET_MISSIONS_IMPROMTU_RACE"_T, [] {
scripts::start_launcher_script(16);
scripts::start_launcher_script("MG_RACE_TO_POINT"_J);
});
components::button("FLIGHT_SCHOOL"_T, [] {
scripts::start_launcher_script(215);
scripts::start_launcher_script("Pilot_School_MP"_J);
});
components::button("GOLF"_T, [] {
scripts::start_launcher_script(212);
scripts::start_launcher_script("golf_mp"_J);
});
components::button("TUTORIAL"_T, [] {
scripts::start_launcher_script(20);
scripts::start_launcher_script("FM_INTRO"_J);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("VIEW_NET_MISSIONS_ONLY_WORK_ON_JOINING"_T.data());
@ -94,19 +94,19 @@ namespace big
ImGui::BeginGroup();
components::button("VIEW_NET_MISSIONS_GUNSLINGER"_T, [] {
scripts::start_launcher_script(230);
scripts::start_launcher_script("gunslinger_arcade"_J);
});
components::button("VIEW_NET_MISSIONS_SPACE_MONKEY"_T, [] {
scripts::start_launcher_script(235);
scripts::start_launcher_script("ggsm_arcade"_J);
});
components::button("VIEW_NET_MISSIONS_WIZARD"_T, [] {
scripts::start_launcher_script(231);
scripts::start_launcher_script("wizard_arcade"_J);
});
components::button("VIEW_NET_MISSIONS_QUB3D"_T, [] {
scripts::start_launcher_script(236);
scripts::start_launcher_script("puzzle"_J);
});
components::button("VIEW_NET_MISSIONS_CAMHEDZ"_T, [] {
scripts::start_launcher_script(237);
scripts::start_launcher_script("camhedz_arcade"_J);
});
ImGui::EndGroup();

View File

@ -175,129 +175,6 @@ namespace big
ImGui::EndGroup();
}
void render_force_host_options()
{
ImGui::BeginGroup();
components::small_text("FORCE_HOST"_T);
static constexpr auto token_spoof_types = std::to_array({"SPOOF_HOST_TOKEN_OFF", "SPOOF_HOST_TOKEN_TYPE_LEGIT", "SPOOF_HOST_TOKEN_TYPE_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_EXTRA_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_CUSTOM"});
ImGui::BeginDisabled(gta_util::get_network()->m_game_session_state != 0);
ImGui::SetNextItemWidth(300);
if (ImGui::BeginCombo("HOST_TOKEN_SPOOFING"_T.data(),
g_translation_service.get_translation(token_spoof_types[g.session.spoof_host_token_type]).data()))
{
for (int i = 0; i < token_spoof_types.size(); i++)
{
if (ImGui::Selectable(g_translation_service.get_translation(token_spoof_types[i]).data(), i == g.session.spoof_host_token_type))
{
g.session.spoof_host_token_type = i;
g_fiber_pool->queue_job([] {
g.session.spoof_host_token_dirty = true;
}); // this part gets a bit racy so we're setting it in a fiber pool
}
if (i == g.session.spoof_host_token_type)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
if (g.session.spoof_host_token_type != 0)
{
ImGui::Checkbox("HIDE_TOKEN_SPOOFING_WHEN_HOST"_T.data(), &g.session.hide_token_spoofing_when_host);
}
if (g.session.spoof_host_token_type == 4)
{
ImGui::SetNextItemWidth(200);
if (ImGui::InputScalar("##token_input", ImGuiDataType_U64, &g.session.custom_host_token, nullptr, nullptr, "%p", ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
{
g.session.spoof_host_token_dirty = true;
}
}
ImGui::EndDisabled();
//if (g.session.force_session_host)
//{
// ImGui::SameLine();
// ImGui::Checkbox("KICK_HOST_ON_JOIN"_T.data(), &g.session.kick_host_when_forcing_host);
//}
ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_SCRIPT_HOST_DESC"_T.data());
ImGui::SameLine();
ImGui::Checkbox("FAST_JOIN"_T.data(), &g.session.fast_join);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FAST_JOIN_DESC"_T.data());
components::command_button<"emptysession">();
ImGui::EndGroup();
}
void render_player_options()
{
ImGui::SeparatorText("PLAYER_OPTIONS"_T.data());
ImGui::BeginGroup();
components::command_button<"killall">({}, "KILL_ALL"_T);
components::command_button<"explodeall">({}, "EXPLODE_ALL"_T);
components::command_button<"beastall">({});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"bringall">({});
components::command_button<"giveweapsall">({});
components::command_button<"remweapsall">({});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::command_button<"ceokickall">({});
components::command_button<"vehkickall">({});
components::command_button<"deletevehall">({});
components::command_button<"ragdollall">({}, "RAGDOLL_PLAYERS"_T);
components::command_button<"intkickall">({}, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::command_button<"errorall">({});
components::command_button<"ceoraidall">({});
components::button("TRIGGER_MC_RAID"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
components::button("TRIGGER_BUNKER_RAID"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
ImGui::EndGroup();
components::small_text("BOUNTY"_T);
static int value = 10000;
ImGui::SetNextItemWidth(300);
ImGui::SliderInt("##bountyvalue", &value, 0, 10000);
components::command_checkbox<"anonbounty">();
components::button("Bounty All", [] {
g_player_service->iterate([](auto& plyr) {
troll::set_bounty_on_player(plyr.second, value, g.session.anonymous_bounty);
});
});
}
void render_teleport_options()
{
ImGui::SeparatorText("TELEPORTS"_T.data());
@ -401,119 +278,10 @@ namespace big
ImGui::EndGroup();
}
void render_session_control()
{
ImGui::SeparatorText("SESSION_CONTROL"_T.data());
ImGui::BeginGroup();
ImGui::Checkbox("SCRIPT_BLOCK_AMMUNATION"_T.data(), &g.session.script_block_opts.ammunation);
ImGui::Checkbox("SCRIPT_BLOCK_ATMS"_T.data(), &g.session.script_block_opts.atms);
ImGui::Checkbox("SCRIPT_BLOCK_ARCADE_GAMES"_T.data(), &g.session.script_block_opts.arcade_games);
ImGui::Checkbox("SCRIPT_BLOCK_CASINO_GAMES"_T.data(), &g.session.script_block_opts.casino_games);
ImGui::Checkbox("SCRIPT_BLOCK_DRONES"_T.data(), &g.session.script_block_opts.drones);
ImGui::Checkbox("SCRIPT_BLOCK_GANG_ATTACKS"_T.data(), &g.session.script_block_opts.gang_attacks);
ImGui::Checkbox("SCRIPT_BLOCK_IMPROMPTU_DEATHMATCHES"_T.data(), &g.session.script_block_opts.impromptu_dm);
ImGui::Checkbox("SCRIPT_BLOCK_IMPROMPTU_RACES"_T.data(), &g.session.script_block_opts.impromptu_race);
ImGui::Checkbox("SCRIPT_BLOCK_INTERIORS"_T.data(), &g.session.script_block_opts.interiors);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SCRIPT_BLOCK_INTERIORS_DESC"_T.data());
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("SCRIPT_BLOCK_LSC"_T.data(), &g.session.script_block_opts.lsc);
ImGui::Checkbox("SCRIPT_BLOCK_MOVIES"_T.data(), &g.session.script_block_opts.movies);
ImGui::Checkbox("SCRIPT_BLOCK_PROSTITUTES"_T.data(), &g.session.script_block_opts.prostitutes);
ImGui::Checkbox("SCRIPT_BLOCK_SITTING"_T.data(), &g.session.script_block_opts.sitting);
ImGui::Checkbox("SCRIPT_BLOCK_SLEEPING"_T.data(), &g.session.script_block_opts.sleeping);
ImGui::Checkbox("SCRIPT_BLOCK_STORES"_T.data(), &g.session.script_block_opts.stores);
ImGui::Checkbox("SCRIPT_BLOCK_STREET_DEALER"_T.data(), &g.session.script_block_opts.street_dealer);
ImGui::Checkbox("SCRIPT_BLOCK_STRIP_CLUB"_T.data(), &g.session.script_block_opts.strip_club);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SCRIPT_BLOCK_STRIP_CLUB_DESC"_T.data());
ImGui::Checkbox("SCRIPT_BLOCK_STRIP_CLUB"_T.data(), &g.session.script_block_opts.vending_machines);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::sub_title("REQUIRES_SCRIPT_HOST"_T);
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("DISABLE_CEO_MONEY_DESC"_T.data());
ImGui::Checkbox("BLOCK_JOBS"_T.data(), &g.session.block_jobs);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("BLOCK_JOBS_DESC"_T.data());
ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors);
components::script_patch_checkbox("BLOCK_MUGGERS"_T, &g.session.block_muggers, "BLOCK_MUGGERS_DESC"_T.data());
components::script_patch_checkbox("BLOCK_CEO_RAIDS"_T, &g.session.block_ceo_raids, "BLOCK_CEO_RAIDS_DESC"_T);
components::command_checkbox<"blockceos">();
ImGui::EndGroup();
}
void render_session_globals()
{
// TODO: what are we doing with this?
ImGui::BeginGroup();
components::small_text("WARP_TIME"_T);
components::button("PLUS_1_MINUTE"_T, [] {
toxic::warp_time_forward_all(60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_5_MINUTES"_T, [] {
toxic::warp_time_forward_all(5 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_48_MINUTES"_T, [] {
toxic::warp_time_forward_all(48 * 60 * 1000);
});
components::button("PLUS_96_MINUTES"_T, [] {
toxic::warp_time_forward_all(96 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_200_MINUTES"_T, [] {
toxic::warp_time_forward_all(200 * 60 * 1000);
});
ImGui::SameLine();
components::button("STOP_TIME"_T, [] {
toxic::set_time_all(INT_MAX - 3000);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("STOP_TIME_DESC"_T.data());
ImGui::EndGroup();
ImGui::SameLine();
static int global_wanted_level = 0;
ImGui::BeginGroup();
components::small_text("WANTED_LVL"_T);
ImGui::SetNextItemWidth(150);
if (ImGui::SliderInt("##wantedlevel", &global_wanted_level, 0, 5))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::EndGroup();
}
void view::network()
{
render_join_game();
render_general_options();
render_session_globals();
render_force_host_options();
render_player_options();
render_teleport_options();
render_session_control();
}
}

View File

@ -1,5 +1,8 @@
#include "views/view.hpp"
#include "services/players/player_service.hpp"
#include "util/scripts.hpp"
#include "services/script_connection/script_connection_service.hpp"
#include "packet.hpp"
namespace big
{
@ -31,6 +34,30 @@ namespace big
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g_player_service->get_selected()->never_wanted);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g_player_service->get_selected()->semi_godmode);
ImGui::Checkbox("VIEW_NET_SESSION_FIX_VEHICLE"_T.data(), &g_player_service->get_selected()->fix_vehicle);
components::button("Trigger UFO Abduction", [] {
scripts::force_host("freemode"_J);
g_player_service->get_selected()->script_host_mission = 9999;
scripts::force_script_on_player(g_player_service->get_selected(), "fm_content_ufo_abduction"_J, g_player_service->get_selected()->id());
for (int i = 0; i < 10; i++)
{
memset(scr_globals::gsbd_fm_events.at(11).at(143).as<void*>(), __rdtsc(), sizeof(std::uint64_t) * 4);
script::get_current()->yield(30ms);
}
});
// Broken
components::button("Trigger Pizza Delivery", [] {
scripts::force_host("freemode"_J);
g_player_service->get_selected()->script_host_mission = 9999;
scripts::force_script_on_player(g_player_service->get_selected(), "fm_content_pizza_delivery"_J);
for (int i = 0; i < 10; i++)
{
memset(scr_globals::gsbd_fm_events.at(11).at(143).as<void*>(), __rdtsc(), sizeof(std::uint64_t) * 4);
script::get_current()->yield(30ms);
}
});
ImGui::EndGroup();
}
}

View File

@ -40,6 +40,7 @@ namespace big
static void self();
static void animations();
static void network();
static void network_controls();
static void chat();
static void missions();
static void player_database();