Fixes for b3095 (#2537)

* Refactored TRIGGER_SCRIPT_EVENT for the duplicate f_2 argument they added in 3095.
Fixed OOB gadget spam caused by the tow truck.
Increased max interiors in InteriorControl.
* Updated scripted_game_event.
* Update GTAV-Classes repo.
* Fixed locals for 3095.
* Bump project to Build 3095.
This commit is contained in:
gir489 2023-12-13 18:56:40 -05:00 committed by GitHub
parent 0eb7ab6c50
commit 228ce6b25e
27 changed files with 99 additions and 72 deletions

View File

@ -1,6 +1,6 @@
{
"game": {
"online": "1.67",
"build": "3028"
"online": "1.68",
"build": "3095"
}
}

View File

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

View File

@ -21,9 +21,10 @@ 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(), (int)eRemoteEvent::NetworkBail);

View File

@ -18,8 +18,8 @@ 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(), (int)eRemoteEvent::InteriorControl);
}

View File

@ -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,

View File

@ -25,8 +25,12 @@ 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(), (int)eRemoteEvent::CeoKick);
return;
@ -34,8 +38,8 @@ namespace big
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(), (int)eRemoteEvent::MarkPlayerAsBeast);
}

View File

@ -16,8 +16,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 = 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(), (int)eRemoteEvent::ForceMission);
}

View File

@ -44,10 +44,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,

View File

@ -21,8 +21,8 @@ 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(), (int)eRemoteEvent::VehicleKick);
}

View File

@ -18,8 +18,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 = 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");

View File

@ -22,8 +22,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 = 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()])

View File

@ -16,8 +16,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 = 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(), (int)eRemoteEvent::Teleport);
}

View File

@ -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,

View File

@ -16,8 +16,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 = 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(), (int)eRemoteEvent::TeleportToWarehouse);
}

View File

@ -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,

View File

@ -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");
@ -34,8 +34,8 @@ namespace big
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(), (int)eRemoteEvent::StartScriptProceed);

View File

@ -15,8 +15,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 = 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(), (int)eRemoteEvent::TriggerCEORaid);
}

View File

@ -52,8 +52,8 @@ namespace big
if (rotate_cam_bits)
{
const size_t arg_count = 3;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TSECommand, (int64_t)self::id, (int64_t)eRemoteEvent::TSECommandRotateCam};
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};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, rotate_cam_bits, (int)eRemoteEvent::TSECommand);
}

View File

@ -74,36 +74,36 @@ namespace big::scr_locals
{
namespace am_hunt_the_beast
{
constexpr static auto broadcast_idx = 600;
constexpr static auto player_broadcast_idx = 2584;
constexpr static auto broadcast_idx = 602;
constexpr static auto player_broadcast_idx = 2586;
}
namespace am_criminal_damage
{
constexpr static auto broadcast_idx = 111;
constexpr static auto score_idx = 106;
constexpr static auto broadcast_idx = 113;
constexpr static auto score_idx = 108;
}
namespace am_cp_collection
{
constexpr static auto broadcast_idx = 816;
constexpr static auto player_broadcast_idx = 3457;
constexpr static auto broadcast_idx = 818;
constexpr static auto player_broadcast_idx = 3459;
}
namespace am_king_of_the_castle
{
constexpr static auto broadcast_idx = 94;
constexpr static auto broadcast_idx = 96;
}
namespace fmmc_launcher
{
constexpr static auto broadcast_idx = 11629;
constexpr static auto broadcast_idx = 12327;
}
namespace fm_mobile
namespace freemode
{
// first uLocal_ in this function call
// func_\d+\((&.Local_\d+(, )?){9}\);
inline static script_local mobile(18717);
inline static script_local mobile(18955);
}
}

View File

@ -81,7 +81,7 @@ namespace big
switch (hash)
{
case eRemoteEvent::Bounty:
if (g.protections.script_events.bounty && args[2] == self::id)
if (g.protections.script_events.bounty && args[3] == self::id)
{
g.reactions.bounty.process(plyr);
return true;
@ -111,7 +111,7 @@ namespace big
break;
case eRemoteEvent::Crash: g.reactions.crash.process(plyr); return true;
case eRemoteEvent::Crash2:
if (args[2] > 32) // actual crash condition is if args[2] is above 255
if (args[3] > 32) // actual crash condition is if args[2] is above 255
{
g.reactions.crash.process(plyr);
return true;
@ -119,7 +119,7 @@ namespace big
break;
case eRemoteEvent::Crash3:
{
if (isnan(*(float*)&args[3]) || isnan(*(float*)&args[4]))
if (isnan(*(float*)&args[4]) || isnan(*(float*)&args[5]))
{
g.reactions.crash.process(plyr);
return true;
@ -128,7 +128,7 @@ namespace big
}
case eRemoteEvent::Notification:
{
switch (static_cast<eRemoteEvent>(args[2]))
switch (static_cast<eRemoteEvent>(args[3]))
{
case eRemoteEvent::NotificationMoneyBanked: // never used
case eRemoteEvent::NotificationMoneyRemoved:
@ -170,18 +170,18 @@ namespace big
}
break;
case eRemoteEvent::MCTeleport:
if (g.protections.script_events.mc_teleport && args[3] <= 32 && !is_player_our_boss(plyr->id()))
if (g.protections.script_events.mc_teleport && args[4] <= 32 && !is_player_our_boss(plyr->id()))
{
for (int i = 0; i < 32; i++)
{
if (args[4 + i] == NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(self::id))
if (args[5 + i] == NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(self::id))
{
g.reactions.mc_teleport.process(plyr);
return true;
}
}
}
else if (args[3] > 32)
else if (args[4] > 32)
{
g.reactions.crash.process(plyr);
return true;
@ -202,14 +202,14 @@ namespace big
}
break;
case eRemoteEvent::TSECommand:
if (g.protections.script_events.rotate_cam && static_cast<eRemoteEvent>(args[2]) == eRemoteEvent::TSECommandRotateCam && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
if (g.protections.script_events.rotate_cam && static_cast<eRemoteEvent>(args[3]) == eRemoteEvent::TSECommandRotateCam && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
{
g.reactions.rotate_cam.process(plyr);
return true;
}
break;
case eRemoteEvent::SendToCayoPerico:
if (g.protections.script_events.send_to_location && args[3] == 0)
if (g.protections.script_events.send_to_location && args[4] == 0)
{
g.reactions.send_to_location.process(plyr);
return true;
@ -229,9 +229,9 @@ namespace big
bool known_location = false;
if (args[2] == 0 && args[3] == 0)
if (args[3] == 0 && args[4] == 0)
{
if (args[4] == 4 && args[5] == 0)
if (args[5] == 4 && args[6] == 0)
{
known_location = true;
@ -241,7 +241,7 @@ namespace big
return true;
}
}
else if ((args[4] == 3 || args[4] == 4) && args[5] == 1)
else if ((args[5] == 3 || args[5] == 4) && args[6] == 1)
{
known_location = true;
@ -305,7 +305,7 @@ namespace big
break;
case eRemoteEvent::StartActivity:
{
eActivityType activity = static_cast<eActivityType>(args[2]);
eActivityType activity = static_cast<eActivityType>(args[3]);
if (g.protections.script_events.start_activity)
{
if (activity == eActivityType::Survival || activity == eActivityType::Mission || activity == eActivityType::Deathmatch || activity == eActivityType::BaseJump || activity == eActivityType::Race)
@ -328,7 +328,7 @@ namespace big
g.reactions.start_activity.process(plyr);
return true;
}
else if (activity == eActivityType::DefendSpecialCargo || activity == eActivityType::GunrunningDefend || activity == eActivityType::BikerDefend || args[2] == 238)
else if (activity == eActivityType::DefendSpecialCargo || activity == eActivityType::GunrunningDefend || activity == eActivityType::BikerDefend || args[3] == 238)
{
g.reactions.trigger_business_raid.process(plyr);
return true;
@ -350,8 +350,8 @@ namespace big
}
case eRemoteEvent::InteriorControl:
{
int interior = (int)args[2];
if (interior < 0 || interior > 161) // the upper bound will change after an update
int interior = (int)args[3];
if (interior < 0 || interior > 166) // the upper bound will change after an update
{
if (auto plyr = g_player_service->get_by_id(player->m_player_id))
session::add_infraction(plyr, Infraction::TRIED_KICK_PLAYER);

View File

@ -55,8 +55,8 @@ namespace big
if (m_debug_logging)
LOG(VERBOSE) << "Starting " << m_script_name << " using TSEs";
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 << m_target->get()->id()};
args[2] = scripts::launcher_index_from_hash(m_script_hash);
strcpy((char*)&args[2 + 3], "0");
@ -68,8 +68,8 @@ namespace big
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 << m_target->get()->id()};
args_2[2 + 17] = 1337;
g_pointers->m_gta.m_trigger_script_event(1, args_2, arg_count_2, 1 << m_target->get()->id(), (int)eRemoteEvent::StartScriptProceed);

View File

@ -11,9 +11,9 @@ namespace big::globals
{
inline void clear_wanted_player(Player target)
{
constexpr size_t arg_count = 3;
constexpr size_t arg_count = 4;
int64_t args[arg_count] = {static_cast<int64_t>(eRemoteEvent::ClearWantedLevel),
self::id,
self::id, 1 << target,
(int64_t)scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[target].ScriptEventReplayProtectionCounter};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << target, (int)eRemoteEvent::ClearWantedLevel);
@ -21,9 +21,10 @@ namespace big::globals
inline void give_remote_otr(Player target)
{
constexpr size_t arg_count = 7;
constexpr size_t arg_count = 8;
int64_t args[arg_count] = {static_cast<int64_t>(eRemoteEvent::RemoteOffradar),
(int64_t)self::id,
1 << target,
(int64_t)(NETWORK::GET_NETWORK_TIME() + 1),
0,
true,

View File

@ -171,7 +171,7 @@ namespace big::mobile
// \(func_\d{3}\(&\(uParam0->f_\d{3}\), \d+000, 0\) \|\| func
// or if you prefer a string "VD_FAIL4"
// or if you really prefer an image https://i.imgur.com/K8vMILe.png
*scr_locals::fm_mobile::mobile.set(freemode_thread).at(176).as<int*>() = 0; // spawn vehicle instantly
*scr_locals::freemode::mobile.set(freemode_thread).at(176).as<int*>() = 0; // spawn vehicle instantly
}
// blocking call till vehicle is delivered

View File

@ -211,10 +211,11 @@ namespace big::session
inline void give_collectible(Player target, eCollectibleType col, int index = 0, bool uncomplete = false)
{
const size_t arg_count = 7;
const size_t arg_count = 8;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::GiveCollectible,
(int64_t)self::id,
1 << target,
(int64_t)col, // iParam0
(int64_t)index, // iParam1
!uncomplete, // bParam2

View File

@ -45,8 +45,8 @@ namespace big::toxic
inline void start_activity(player_ptr target, eActivityType type)
{
const size_t arg_count = 4;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartActivity, (int64_t)self::id, (int64_t)type, (int64_t) true};
const size_t arg_count = 5;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartActivity, (int64_t)self::id, 1 << target->id(), (int64_t) type, (int64_t) true};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << target->id(), (int)eRemoteEvent::StartActivity);
}

View File

@ -9,9 +9,10 @@ namespace big::troll
{
inline void set_bounty_on_player(player_ptr target, int value, bool anonymous)
{
const size_t arg_count = 22;
const size_t arg_count = 23;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Bounty,
self::id,
-1,
target->id(),
1,
value,

View File

@ -56,6 +56,7 @@ namespace big
components::button("DEBUG_SCRIPT_EVENT_SEND_EVENT"_T, [] {
args[1] = self::id;// prevent detection from AC
args[2] = event_everyone ? -1 : 1 << event_player_bits,
g_pointers->m_gta.m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits, args[0]);
});