From a98f4bf357539150efb52b02174d1618447a7b3e Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 11 Nov 2021 01:14:22 +0100 Subject: [PATCH] fix(Natives): replace PLAYER_ID with GET_PLAYER_INDEX --- BigBaseV2/src/backend/looped/self/off_radar.cpp | 17 +---------------- .../src/backend/looped/weapons/cage_gun.cpp | 2 +- .../src/backend/looped/weapons/delete_gun.cpp | 2 +- .../src/backend/looped/weapons/gravity_gun.cpp | 2 +- .../src/backend/looped/weapons/repair_gun.cpp | 2 +- .../looped/weapons/steal_vehicle_gun.cpp | 2 +- .../src/backend/looped/weapons/vehicle_gun.cpp | 2 +- .../src/hooks/report_cash_spawn_handler.cpp | 2 +- 8 files changed, 8 insertions(+), 23 deletions(-) diff --git a/BigBaseV2/src/backend/looped/self/off_radar.cpp b/BigBaseV2/src/backend/looped/self/off_radar.cpp index c1b373b9..717dd718 100644 --- a/BigBaseV2/src/backend/looped/self/off_radar.cpp +++ b/BigBaseV2/src/backend/looped/self/off_radar.cpp @@ -9,22 +9,7 @@ namespace big { if (g.self.off_radar) { - /*Player playerId = PLAYER::PLAYER_ID(); - - int off_radar[] = { - (int)RemoteEvent::RemoteOffradar, - playerId, - NETWORK::GET_NETWORK_TIME(), - 0, - 0, - 0, - *script_global(1630816).at(playerId, 597).at(508).as() - }; - - g_pointers->m_trigger_script_event(1, off_radar, 7, 1 << playerId);*/ - //SCRIPT::TRIGGER_SCRIPT_EVENT(1, off_radar, 7, 1 << playerId); - - *script_global(2426865).at(PLAYER::PLAYER_ID(), 449).at(209).as() = true; + *script_global(2426865).at(PLAYER::GET_PLAYER_INDEX(), 449).at(209).as() = 1; *script_global(2441237).at(70).as() = NETWORK::GET_NETWORK_TIME() + 1; } } diff --git a/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp b/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp index 54210848..ee16a67d 100644 --- a/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp @@ -15,7 +15,7 @@ namespace big { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp b/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp index a841881f..85854ddb 100644 --- a/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp @@ -16,7 +16,7 @@ namespace big { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp index eacc838e..567a1a56 100644 --- a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp @@ -22,7 +22,7 @@ namespace big // ZOOMED IN if (bGravityGun && PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp index 47506ec6..57495b38 100644 --- a/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp @@ -16,7 +16,7 @@ namespace big { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp index 960ff26d..93f58f27 100644 --- a/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp @@ -18,7 +18,7 @@ namespace big if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp b/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp index 9601a54c..981967ba 100644 --- a/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp @@ -17,7 +17,7 @@ namespace big if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { - PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true); + PLAYER::DISABLE_PLAYER_FIRING(PLAYER::GET_PLAYER_INDEX(), true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); diff --git a/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp b/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp index 405f06e8..6a2d83f2 100644 --- a/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp +++ b/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp @@ -5,7 +5,7 @@ namespace big { bool hooks::report_cash_spawn_handler(__int64 creport_cash_spawn_event, CNetGamePlayer* source_player) { - if (source_player->player_id == PLAYER::PLAYER_ID()) + if (source_player->player_id == PLAYER::GET_PLAYER_INDEX()) { LOG(INFO) << "Blocked self report for spawning modded cash";