diff --git a/CameraMoveBtn.cpp b/CameraMoveBtn.cpp new file mode 100644 index 0000000..9d6a204 --- /dev/null +++ b/CameraMoveBtn.cpp @@ -0,0 +1,21 @@ +#include "pch.h" +#include "CameraMoveBtn.h" + +BEGIN_MESSAGE_MAP(CameraMoveBtn, CButton) + ON_WM_LBUTTONDOWN() + ON_WM_LBUTTONUP() +END_MESSAGE_MAP() + +void CameraMoveBtn::OnLButtonDown(UINT nFlags, CPoint point) +{ + CButton::OnLButtonDown(nFlags, point); + + GetParent()->SendMessage(WM_CAMERA_MOVE_BTN, GetDlgCtrlID(), TRUE); +} + +void CameraMoveBtn::OnLButtonUp(UINT nFlags, CPoint point) +{ + CButton::OnLButtonUp(nFlags, point); + + GetParent()->SendMessage(WM_CAMERA_MOVE_BTN, GetDlgCtrlID(), FALSE); +} diff --git a/CameraMoveBtn.h b/CameraMoveBtn.h new file mode 100644 index 0000000..d1f9ef1 --- /dev/null +++ b/CameraMoveBtn.h @@ -0,0 +1,16 @@ +#pragma once +#include +#include + +#define WM_CAMERA_MOVE_BTN (WM_USER + 1000) + +class CameraMoveBtn : public CButton +{ +public: + +protected: + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + + DECLARE_MESSAGE_MAP() +}; \ No newline at end of file diff --git a/CameraWindow.cpp b/CameraWindow.cpp new file mode 100644 index 0000000..b4aa17e --- /dev/null +++ b/CameraWindow.cpp @@ -0,0 +1,206 @@ +#include "pch.h" +#include "gta2dll.h" +#include "CameraWindow.h" +#include "gta2-helper.h" + +CameraWindow* camWnd = nullptr; + +IMPLEMENT_DYNAMIC(CameraWindow, CDialogEx) + +CameraWindow::CameraWindow(CWnd* pParent /*=nullptr*/) + : CDialogEx(IDD_PS, pParent) +{ + camWnd = this; +} + +CameraWindow::~CameraWindow() +{ + +} + +BEGIN_MESSAGE_MAP(CameraWindow, CDialogEx) + ON_EN_CHANGE(IDC_CAM_X, &CameraWindow::OnPositionInput) + ON_EN_CHANGE(IDC_CAM_Y, &CameraWindow::OnPositionInput) + ON_EN_CHANGE(IDC_CAM_Z, &CameraWindow::OnPositionInput) + ON_EN_CHANGE(IDC_CAM_ZOOM, &CameraWindow::OnPositionInput) + ON_BN_CLICKED(IDC_CAM_SYNC, &CameraWindow::OnGoToTargetClick) + ON_BN_CLICKED(IDC_CAM_FPL, &CameraWindow::OnCheckboxChange) + ON_BN_CLICKED(IDC_CAM_ZL, &CameraWindow::OnCheckboxChange) + ON_BN_CLICKED(IDC_CAM_ZOOML, &CameraWindow::OnCheckboxChange) + ON_BN_CLICKED(IDC_CAM_TARL, &CameraWindow::OnCheckboxChange) + ON_BN_CLICKED(IDC_CAM_TP, &CameraWindow::OnTeleport) + ON_MESSAGE(WM_CAMERA_MOVE_BTN, &CameraWindow::OnMoveButton) + ON_WM_HSCROLL() +END_MESSAGE_MAP() + + +void CameraWindow::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_CAM_X, m_xPos); + DDX_Text(pDX, IDC_CAM_Y, m_yPos); + DDX_Text(pDX, IDC_CAM_Z, m_zPos); + DDX_Text(pDX, IDC_CAM_ZOOM, m_zoom); + DDX_Check(pDX, IDC_CAM_FPL, m_followPlayer); + DDX_Check(pDX, IDC_CAM_ZL, m_lockZ); + DDX_Check(pDX, IDC_CAM_ZOOML, m_lockZoom); + DDX_Check(pDX, IDC_CAM_TARL, m_lockToTarget); + DDX_Control(pDX, IDC_CAM_SEN, m_sensitivitySlider); +} + +BOOL CameraWindow::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + m_moveBtns[0].SubclassDlgItem(IDC_CAM_UP, this); + m_moveBtns[1].SubclassDlgItem(IDC_CAM_DOWN, this); + m_moveBtns[2].SubclassDlgItem(IDC_CAM_LEFT, this); + m_moveBtns[3].SubclassDlgItem(IDC_CAM_RIGHT, this); + m_moveBtns[4].SubclassDlgItem(IDC_CAM_ZUP, this); + m_moveBtns[5].SubclassDlgItem(IDC_CAM_ZDOWN, this); + + m_sensitivitySlider.SetRange(1, 100); + m_sensitivitySlider.SetPos(m_sensitivity); + + return TRUE; +} + +int CameraWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CDialogEx::OnCreate(lpCreateStruct) == -1) + return -1; +} + +void CameraWindow::OnPositionInput() +{ + if (!m_player) return; + + UpdateData(TRUE); + + m_player->ph1.cameraPos.x = FloatEncode(m_xPos); + m_player->ph1.cameraPos.y = FloatEncode(m_yPos); + m_player->ph1.cameraPos.z = FloatEncode(m_zPos); + m_player->ph1.cameraPos.zoom = m_zoom; + + m_followPlayer = 0; + m_player->ph1.followedPedID = 0; + + UpdateData(FALSE); +} + +void CameraWindow::OnCheckboxChange() +{ + if (!m_player) return; + + UpdateData(TRUE); + m_player->ph1.followedPedID = m_followPlayer == 1 ? 1 : 0; +} + +void CameraWindow::OnGTAGameTick() +{ + if (!this->IsWindowVisible()) return; + + // Return if not in the game + if (*(DWORD*)ptrToPedManager == 0) + { + m_player = nullptr; + return; + } + + Game* pGame = (Game*)*(DWORD*)ptrToGame; + if (!pGame) return; + + m_player = pGame->CurrentPlayer; + if (!m_player) return; + + if (m_lockToTarget) { + m_player->ph1.cameraPos = m_player->ph1.cameraPosTarget; + } + + m_xPos = FloatDecode(m_player->ph1.cameraPos.x); + m_yPos = FloatDecode(m_player->ph1.cameraPos.y); + + if (m_lockZ) { + m_player->ph1.cameraPos.z = FloatEncode(m_zPos); + } + else { + m_zPos = FloatDecode(m_player->ph1.cameraPos.z); + } + + if (m_lockZoom) { + m_player->ph1.cameraPos.zoom = m_zoom; + } + else { + m_zoom = m_player->ph1.cameraPos.zoom; + } + + m_followPlayer = m_player->ph1.followedPedID == 1 ? 1 : 0; + + UpdateData(FALSE); + + HandleButtonMove(); +} + +void CameraWindow::HandleButtonMove() +{ + if (!m_player) return; + if (m_btnMoveDirection == 0) return; + float moveSpeed = m_sensitivity / 100.0f; + + switch (m_btnMoveDirection) + { + case IDC_CAM_UP: + m_yPos -= moveSpeed; + break; + case IDC_CAM_DOWN: + m_yPos += moveSpeed; + break; + case IDC_CAM_LEFT: + m_xPos -= moveSpeed; + break; + case IDC_CAM_RIGHT: + m_xPos += moveSpeed; + break; + case IDC_CAM_ZUP: + m_zPos += moveSpeed; + break; + case IDC_CAM_ZDOWN: + m_zPos -= moveSpeed; + break; + } + + UpdateData(FALSE); + OnPositionInput(); +} + +void CameraWindow::OnGoToTargetClick() +{ + if (!m_player) return; + + m_player->ph1.cameraPos = m_player->ph1.cameraPosTarget; +} + + +void CameraWindow::OnTeleport() +{ + if (!m_player) return; + + fnDoTeleport(m_player, m_xPos, m_yPos); +} + +void CameraWindow::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) +{ + if (pScrollBar->GetDlgCtrlID() == IDC_CAM_SEN) + { + m_sensitivity = ((CSliderCtrl*)pScrollBar)->GetPos(); + } + + CDialogEx::OnHScroll(nSBCode, nPos, pScrollBar); +} + +LRESULT CameraWindow::OnMoveButton(WPARAM wParam, LPARAM lParam) +{ + m_btnMoveDirection = lParam == TRUE ? (int)wParam : 0; + + return 0; +} \ No newline at end of file diff --git a/CameraWindow.h b/CameraWindow.h new file mode 100644 index 0000000..c0dbb29 --- /dev/null +++ b/CameraWindow.h @@ -0,0 +1,60 @@ +#pragma once + +// Ped spawner dialog +#include "gta2-helper.h" +#include "CameraMoveBtn.h" +#include + +extern class MainWindow; + +class CameraWindow : public CDialogEx +{ + DECLARE_DYNAMIC(CameraWindow) + +public: + CameraWindow(CWnd* pParent = nullptr); // standard constructor + virtual ~CameraWindow(); + + // Dialog Data +#ifdef AFX_DESIGN_TIME + enum { IDD = IDD_PS }; +#endif + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + + DECLARE_MESSAGE_MAP() + + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPositionInput(); + afx_msg void OnCheckboxChange(); + afx_msg void OnGoToTargetClick(); + afx_msg void OnTeleport(); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg LRESULT OnMoveButton(WPARAM wParam, LPARAM lParam); + + void HandleButtonMove(); + +public: + void OnGTAGameTick(); + + bool m_active = false; + MainWindow* m_mainWindow = nullptr; + +protected: + Player* m_player = nullptr; + + double m_xPos = 0; + double m_yPos = 0; + double m_zPos = 0; + int m_zoom = 0; + int m_followPlayer = 1; + int m_lockZ = 0; + int m_lockZoom = 0; + int m_lockToTarget = 0; + CameraMoveBtn m_moveBtns[6]; + UINT m_btnMoveDirection = 0; + CSliderCtrl m_sensitivitySlider; + int m_sensitivity = 10; +}; \ No newline at end of file diff --git a/LiveTable/LiveTableData.cpp b/LiveTable/LiveTableData.cpp index 43c75dd..dba4bf3 100644 --- a/LiveTable/LiveTableData.cpp +++ b/LiveTable/LiveTableData.cpp @@ -37,17 +37,17 @@ const LiveTableData ltPedData[] = { { L"Elvis something", 80, 4, LT_DATA_TYPE_ADDRESS, 1, new int[1] {0x2c} }, { L"Timer to action", 40, 2, LT_DATA_TYPE_UINT, 1, new int[1] {0x218} }, { L"Timer to action 2", 40, 1, LT_DATA_TYPE_UINT, 1, new int[1] {0x225} }, - { L"Bitstate", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x21c} }, - { L"Bitstate 2", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x238} }, - { L"Remap 2", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x26c} }, + { L"Bitstate", 50, 4, LT_DATA_TYPE_HEX, 1, new int[1] {0x21c} }, + { L"Bitstate 2", 50, 4, LT_DATA_TYPE_HEX, 1, new int[1] {0x238} }, + { L"Body shape", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x26c} }, { L"State 1", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x274} }, { L"State 1_2", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x27c} }, { L"State 2", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x278} }, { L"State 2_2", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x280} }, - { L"State 3", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x258} }, + { L"Objective", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x258} }, { L"State 4", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x284} }, - { L"State 5", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x288} }, - { L"Rel to multiplayer", 40, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x28c} } + { L"Threat search", 50, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x288} }, + { L"Threat reaction", 40, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x28c} } }; const int ltPedDataCount = sizeof(ltPedData) / sizeof(ltPedData[0]); @@ -65,7 +65,7 @@ const LiveTableData ltCarData[] = { { L"Engine state", 40, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x9C}, true }, { L"Car physics", 80, 4, LT_DATA_TYPE_ADDRESS, 1, new int[1] {0x58} }, { L"Sprite", 80, 4, LT_DATA_TYPE_ADDRESS, 1, new int[1] {0x50} }, - { L"Bitmask", 40, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x78} }, + { L"Physics bitmask", 40, 4, LT_DATA_TYPE_HEX, 1, new int[1] {0x78} }, { L"Mask", 40, 4, LT_DATA_TYPE_UINT, 1, new int[1] {0x88} }, { L"Brake", 20, 1, LT_DATA_TYPE_BOOLEAN, 2, new int[2] {0x58, 0x91} }, { L"Handbrake", 20, 1, LT_DATA_TYPE_BOOLEAN, 2, new int[2] {0x58, 0x92} }, diff --git a/MainWindow.cpp b/MainWindow.cpp index 9b277fe..7e81646 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -126,6 +126,10 @@ MainWindow::MainWindow(CWnd* pParent /*=nullptr*/) m_liveTableWindow->Create(IDD_LT, this); m_liveTableWindow->m_mainWindow = this; + m_cameraWindow = new CameraWindow(); + m_cameraWindow->Create(IDD_CAM, this); + m_cameraWindow->m_mainWindow = this; + HookFunction(pGameTick, (DWORD)gameTick); //HookFunction(pDrawChat, (DWORD)drawChat, 7); } @@ -160,13 +164,16 @@ void MainWindow::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_PEDHEALTH, m_pedHealth); DDX_Control(pDX, IDC_PEDARMOR, m_pedArmor); DDX_Control(pDX, IDC_PEDMONEY, m_pedMoney); - DDX_Control(pDX, IDC_PEDCLOTHV, m_pedClothes); - DDX_Control(pDX, IDC_PEDSHAPEV, m_pedShape); + DDX_Control(pDX, IDC_PREMAP_R, m_pedRemap); + DDX_Control(pDX, IDC_PREMAP_S, m_pedShape); DDX_Control(pDX, IDC_BIGTEXTTEXT, m_BigText); - DDX_Control(pDX, IDC_SPRUN, m_globalPedSpeeds[0]); - DDX_Control(pDX, IDC_SPWLK, m_globalPedSpeeds[1]); - DDX_Control(pDX, IDC_SPSTD, m_globalPedSpeeds[2]); DDX_Check(pDX, IDC_PASSENGER, m_enterAsPassenger); + DDX_Check(pDX, IDC_CARINVALL, m_carInvAll); + DDX_Check(pDX, IDC_CARINVBUL, m_carInvBullets); + DDX_Check(pDX, IDC_CARINVFLM, m_carInvFlames); + DDX_Check(pDX, IDC_CARINVRKT, m_carInvRockets); + DDX_Check(pDX, IDC_CARINVCOL, m_carInvCollisions); + DDX_Check(pDX, IDC_CARNOCOL, m_carNoCollisions); } @@ -180,6 +187,7 @@ BEGIN_MESSAGE_MAP(MainWindow, CDialogEx) ON_COMMAND(IDC_MOUSECTRL, &MainWindow::MouseControl) ON_COMMAND(ID_COMMANDS_TANK, &MainWindow::OnSpawnCarTank) ON_COMMAND(ID_COMMANDS_LIVETABLE, &MainWindow::OnShowLiveTable) + ON_COMMAND(ID_COMMANDS_CAMERA, &MainWindow::OnShowCamera) ON_WM_HOTKEY() ON_COMMAND_RANGE(ID_SPAWNCAR, ID_SPAWNOBJ - 1, &OnSpawnCarMenuClick) ON_COMMAND_RANGE(ID_SPAWNOBJ, ID_SPAWNPED - 1, &OnSpawnObjectMenuClick) @@ -197,17 +205,16 @@ BEGIN_MESSAGE_MAP(MainWindow, CDialogEx) ON_BN_CLICKED(IDC_CARVISFIX, &MainWindow::VisFixCar) ON_BN_CLICKED(IDC_CARVISBRK, &MainWindow::VisBreakCar) ON_BN_CLICKED(IDC_LOCKCOPLEVEL, &MainWindow::LockStars) - ON_BN_CLICKED(IDC_LOCKCARDAMAGE, &MainWindow::LockCarDamage) ON_BN_CLICKED(IDC_PEDS0TIME, &MainWindow::NoReloads) ON_BN_CLICKED(IDC_CARLASTTP, &MainWindow::TpToLastCar) ON_BN_CLICKED(IDC_CARINFO, &MainWindow::PrintCarInfo) ON_BN_CLICKED(IDC_PEDIMMORT, &MainWindow::PlayerImmortal) ON_BN_CLICKED(ID_COMMANDS_TPALLPEDS, &MainWindow::TeleportAllPeds) - ON_COMMAND_RANGE(3040, 3048, &GangRespect) - ON_COMMAND_RANGE(3075, 3078, &ToggleDoor) + ON_COMMAND_RANGE(IDC_GANG1M, IDC_GANG3P, &GangRespect) + ON_COMMAND_RANGE(IDC_DOOR1, IDC_DOOR4, &ToggleDoor) + ON_COMMAND_RANGE(IDC_CARINVALL, IDC_CARNOCOL, &CarPhysBitmaskSet) ON_BN_CLICKED(IDC_FREESHOP, &MainWindow::FreeShopping) ON_BN_CLICKED(IDC_BEAHUMAN, &MainWindow::WatchPeds) - ON_BN_CLICKED(IDC_TPPLAYER, &MainWindow::TeleportPlayer) ON_BN_CLICKED(IDC_EMBP, &MainWindow::CarEmblemPlus) ON_BN_CLICKED(IDC_EMBM, &MainWindow::CarEmblemMinus) ON_BN_CLICKED(IDC_CARCOLP, &MainWindow::CarColorPlus) @@ -217,15 +224,13 @@ BEGIN_MESSAGE_MAP(MainWindow, CDialogEx) ON_BN_CLICKED(IDC_CARTRCOLR, &MainWindow::SyncTrailerColor) ON_BN_CLICKED(IDC_GOSLOW, &MainWindow::GoSlow) ON_BN_CLICKED(IDC_PEDHAMSET, &MainWindow::SetHealthArmorMoney) - ON_BN_CLICKED(IDC_PEDCLOTHP, &MainWindow::PedClothesPlus) - ON_BN_CLICKED(IDC_PEDCLOTHM, &MainWindow::PedClothesMinus) - ON_BN_CLICKED(IDC_PEDSHAPEP, &MainWindow::PedShapePlus) - ON_BN_CLICKED(IDC_PEDSHAPEM, &MainWindow::PedShapeMinus) - ON_BN_CLICKED(IDC_PEDSHAPECLOTHR, &MainWindow::PedShapeClothesReset) ON_BN_CLICKED(IDC_BIGTEXTSHOW, &MainWindow::ShowBigText) - ON_BN_CLICKED(IDC_SPSET, &MainWindow::SetGlobalPedSpeeds) ON_BN_CLICKED(ID_COMMANDS_EXPLODECARS, &MainWindow::ExplodeCars) ON_BN_CLICKED(IDC_PASSENGER, &MainWindow::OnEnterAsPassengerToggle) + ON_CBN_SELCHANGE(IDC_PREMAP_R, &MainWindow::PedRemapShapeSet) + ON_CBN_SELCHANGE(IDC_PREMAP_S, &MainWindow::PedRemapShapeSet) + ON_BN_CLICKED(IDC_PREMAP_DEF, &MainWindow::PedRemapShapeDefault) + ON_BN_CLICKED(IDC_CARDUMMY, &MainWindow::CarMakeDummy) END_MESSAGE_MAP() // Close GTA2 on Trainer exit @@ -272,7 +277,6 @@ void MainWindow::AddMenuItems( } } -// Prepare things int MainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialogEx::OnCreate(lpCreateStruct) == -1) @@ -362,7 +366,6 @@ int MainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) std::map::iterator itr; // Create the "Spawn car" menu - CMenu* carMenu = menu->GetSubMenu(1)->GetSubMenu(0); AddCategorizedMenuItems( carMenu, @@ -375,7 +378,6 @@ int MainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) this->carHMenu = carMenu->m_hMenu; // Create the "Spawn object" menu - CMenu* objMenu = menu->GetSubMenu(1)->GetSubMenu(1); AddCategorizedMenuItems( objMenu, @@ -388,26 +390,22 @@ int MainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) this->objHMenu = objMenu->m_hMenu; // Create the "Get weapon" menu - CMenu* weapMenu = menu->GetSubMenu(2); AddMenuItems(weapMenu, weapons, sizeof(weapons) / sizeof(weapons[0]), ID_GETWEAP_START); // Create the "Get car weapon" menu - CMenu* carWeapMenu = new CMenu(); carWeapMenu->CreatePopupMenu(); AddMenuItems(carWeapMenu, carWeapons, sizeof(carWeapons) / sizeof(carWeapons[0]), ID_GETCARWEAP_START); AppendMenu(menu->m_hMenu, MF_POPUP, (UINT_PTR)carWeapMenu->m_hMenu, L"Get car weapon"); // Create the "Play vocal" menu - CMenu* vocalsMenu = new CMenu(); vocalsMenu->CreatePopupMenu(); AddMenuItems(vocalsMenu, vocals, sizeof(vocals) / sizeof(vocals[0]), ID_VOCALS_START); AppendMenu(menu->m_hMenu, MF_POPUP, (UINT_PTR)vocalsMenu->m_hMenu, L"Play vocal"); // Create the "Native cheats" menu - CMenu* nativeCheatsMenu = new CMenu(); nativeCheatsMenu->CreatePopupMenu(); AddMenuItems(nativeCheatsMenu, nativeCheats, sizeof(nativeCheats) / sizeof(nativeCheats[0]), ID_NATIVE_START); @@ -417,6 +415,24 @@ int MainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) return 0; } +BOOL MainWindow::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // Create "Player body shape / remap" comboboxes + m_pedShape.ResetContent(); + int shapesCount = sizeof(pedBodyShapes) / sizeof(pedBodyShapes[0]); + for (int i = 0; i < shapesCount; i++) + m_pedShape.AddString(pedBodyShapes[i].name); + + m_pedRemap.ResetContent(); + int remapsCount = sizeof(pedRemaps) / sizeof(pedRemaps[0]); + for (int i = 0; i < remapsCount; i++) + m_pedRemap.AddString(pedRemaps[i].name); + + return TRUE; +} + void MainWindow::OnPaint() { CPaintDC dc(this); // device context for painting @@ -591,12 +607,6 @@ void MainWindow::KeepLockedValues() currLastCarEmblemLPos = carEmblemPos; } - // Lock engine damage - if (carDamageLocked) - { - currLastCar->carDamage = startCarDamage; - } - // Lock doors for (int i = 0; i < 4; i++) { @@ -659,15 +669,6 @@ void MainWindow::KeepLockedValues() { log(L"\"Current / Last car\" changed"); - // Unlock engine damage lock if car changed - if (carDamageLocked) - { - ((CButton*)GetDlgItem(IDC_LOCKCARDAMAGE))->SetCheck(false); - carDamageLocked = false; - startCarDamage = 0; - log(L"Player has changed the car; Engine damage unlocked"); - } - // Reset door open locks if car changed for (int i = 0; i < 4; i++) { @@ -677,9 +678,9 @@ void MainWindow::KeepLockedValues() // Detect and prepare emblems if car changed m_carEmblemPos.SetRange(-8192, 8192, TRUE); currLastCarEmblemID = 0; - for (int i = 0; i < sizeof(emblems)/sizeof(emblems[0]); i++) + for (int i = 0; i < sizeof(carEmblems)/sizeof(carEmblems[0]); i++) { - currLastCarEmblem = getCarRoofWithSpriteIfExists(currLastCar->roof, emblems[i].id); + currLastCarEmblem = getCarRoofWithSpriteIfExists(currLastCar->roof, carEmblems[i].id); if (currLastCarEmblem && currLastCarEmblem->sprite->spriteType == 4) { currLastCarEmblemID = i; @@ -780,7 +781,7 @@ void MainWindow::SafeSpawnCars(WantToSpawn wtsArray[128], int* wtsArraySize) currentWTS.z, currentWTS.rot, (CAR_MODEL4)currentWTS.model, - (uint)(*(uint*)0x005e4d4c) + (uint)(*(uint*)0x005e4d4c) // global car scale ); if (car) @@ -789,7 +790,7 @@ void MainWindow::SafeSpawnCars(WantToSpawn wtsArray[128], int* wtsArraySize) short color = currentWTS.color; if (color != -1) { - car->sprite->lockPalleteMaybe = 3; + car->sprite->lockPalleteMaybe |= 1; car->sprite->carColor = (color == -2) ? rand() % 36 : color; } } @@ -1029,12 +1030,25 @@ void MainWindow::OnShowLiveTable() m_liveTableWindow->SetFocus(); } +void MainWindow::OnShowCamera() +{ + m_cameraWindow->m_active = true; + m_cameraWindow->ShowWindow(SW_SHOW); + m_cameraWindow->SetFocus(); +} + void MainWindow::CarEngineOff() { // Return if currLastCar doesn't exist if (!currLastCar) return; + if (currLastCar->engineState != CAR_ENGINE_STATE(ENGINE_ON)) + { + log(L"Engine is already off or broken"); + return; + } + currLastCar->engineState = CAR_ENGINE_STATE(TURNING_OFF); log(L"Engine turned off"); } @@ -1061,21 +1075,70 @@ void MainWindow::CarExplode() fnExplodeCar(currLastCar, 0, EXPLOSION_SIZE_MEDIUM); } -void MainWindow::LockCarDamage() +void MainWindow::CarPhysBitmaskSet(UINT nID) { + if(currLastCar == nullptr) return; + + UpdateData(true); - if (carDamageLocked) + if (nID == IDC_CARINVALL) { + m_carInvCollisions = m_carInvAll; + m_carInvBullets = m_carInvAll; + m_carInvRockets = m_carInvAll; + m_carInvFlames = m_carInvAll; + } + + SetCarPhysBitmask(0x8, m_carInvCollisions); + SetCarPhysBitmask(0x10, m_carNoCollisions); + SetCarPhysBitmask(0x100, m_carInvBullets); + SetCarPhysBitmask(0x200, m_carInvRockets); + SetCarPhysBitmask(0x400, m_carInvFlames); + + UpdateData(false); + + log(L"Car physics updated"); +} + +void MainWindow::SetCarPhysBitmask(uint bit, bool value) +{ + if (!currLastCar) return; + + if (value) { - log(L"Engine damage unlocked"); + currLastCar->physicsBitmask |= bit; } - else if (currLastCar) + else { - startCarDamage = currLastCar->carDamage; - log(L"Engine damage locked at %d", startCarDamage); + currLastCar->physicsBitmask &= ~bit; + } +} + +void MainWindow::CarPhysBitmaskUpdate() +{ + if (currLastCar == nullptr) { + m_carInvCollisions = 0; + m_carNoCollisions = 0; + m_carInvBullets = 0; + m_carInvRockets = 0; + m_carInvFlames = 0; + m_carInvAll = 0; + UpdateData(false); + return; } - carDamageLocked = !carDamageLocked; + m_carInvCollisions = currLastCar->physicsBitmask & 0x8 ? 1 : 0; + m_carNoCollisions = currLastCar->physicsBitmask & 0x10 ? 1 : 0; + m_carInvBullets = currLastCar->physicsBitmask & 0x100 ? 1 : 0; + m_carInvRockets = currLastCar->physicsBitmask & 0x200 ? 1 : 0; + m_carInvFlames = currLastCar->physicsBitmask & 0x400 ? 1 : 0; + + m_carInvAll = + m_carInvCollisions == 1 && + m_carInvBullets == 1 && + m_carInvRockets == 1 && + m_carInvFlames == 1 ? 1 : 0; + UpdateData(false); } void MainWindow::SetStars(UINT nID) @@ -1095,16 +1158,19 @@ void MainWindow::SetStars(UINT nID) void MainWindow::TpToLastCar() { - Ped* playerPed = fnGetPedByID(1); + Game* pGame = (Game*)*(DWORD*)ptrToGame; + if (!pGame) return; - if (currLastCar && playerPed && playerPed->gameObject) - { - playerPed->gameObject->sprite->x = currLastCar->sprite->x + 10; - playerPed->gameObject->sprite->y = currLastCar->sprite->y + 10; - playerPed->gameObject->sprite->z = currLastCar->sprite->z + 10; + Player* player = pGame->CurrentPlayer; + if (!player) return; - log(L"Teleported to the car!"); - } + if (!currLastCar || !currLastCar->sprite) return; + + player->ph2.cameraPos.x = currLastCar->sprite->x; + player->ph2.cameraPos.y = currLastCar->sprite->y; + fnDoTeleportRaw(player, 0); + + log(L"Teleported to the car!"); } void MainWindow::PrintCarInfo() @@ -1176,7 +1242,9 @@ void MainWindow::FixCar() return; currLastCar->carDamage = 0; - startCarDamage = 0; + currLastCar->fireState = 0; + fnExtinguishCar(currLastCar, 0); + fnFixCarBrokenEngine(currLastCar, 0); log(L"Fixed the engine"); } @@ -1221,33 +1289,7 @@ void MainWindow::PedInfo() WCHAR buf[256]; Ped* playerPed = fnGetPedByID(1); - // Global running speed - if ((int)*(DWORD*)0x66a504 != globalPedSpeedsOld[0]) - { - m_globalPedSpeeds[0].SetWindowTextW(L"0"); - swprintf(buf, 256, L"%d", (int)*(DWORD*)0x66a504); - m_globalPedSpeeds[0].SetWindowTextW(buf); - } - - // Global walking speed - if ((int)*(DWORD*)0x66a574 != globalPedSpeedsOld[1]) - { - m_globalPedSpeeds[1].SetWindowTextW(L"0"); - swprintf(buf, 256, L"%d", (int)*(DWORD*)0x66a574); - m_globalPedSpeeds[1].SetWindowTextW(buf); - } - - // Global standing speed (XD) - if ((int)*(DWORD*)0x66a634 != globalPedSpeedsOld[2]) - { - m_globalPedSpeeds[2].SetWindowTextW(L"0"); - swprintf(buf, 256, L"%d", (int)*(DWORD*)0x66a634); - m_globalPedSpeeds[2].SetWindowTextW(buf); - } - - globalPedSpeedsOld[0] = (int)*(DWORD*)0x66a504; - globalPedSpeedsOld[1] = (int)*(DWORD*)0x66a574; - globalPedSpeedsOld[2] = (int)*(DWORD*)0x66a634; + CarPhysBitmaskUpdate(); if (currLastCar) { @@ -1269,7 +1311,9 @@ void MainWindow::PedInfo() m_carVelocity.SetWindowTextW(buf); // Display currLastCar's color - swprintf(buf, 256, L"%d", currLastCar->sprite->carColor); + short color = currLastCar->sprite->carColor; + if (~currLastCar->sprite->lockPalleteMaybe & 1) color = -1; + swprintf(buf, 256, L"%d", color); m_carColor.SetWindowTextW(buf); } @@ -1281,13 +1325,12 @@ void MainWindow::PedInfo() } // Display emblem name - swprintf(buf, 256, L"%s", emblems[currLastCarEmblemID].name); + swprintf(buf, 256, L"%s", carEmblems[currLastCarEmblemID].name); m_carEmblem.SetWindowTextW(buf); // Display visual state swprintf(buf, 256, L"%X", currLastCar->carLights); m_carVisualData.SetWindowTextW(buf); - } else { @@ -1301,14 +1344,6 @@ void MainWindow::PedInfo() if (playerPed) { - // Display ped's clothes color - swprintf(buf, 256, L"%d", playerPed->remap); - m_pedClothes.SetWindowTextW(buf); - - // Display ped's body shape - swprintf(buf, 256, L"%d", playerPed->remap2); - m_pedShape.SetWindowTextW(buf); - // If player's health changed if (pedHOld != playerPed->health) { @@ -1358,20 +1393,12 @@ void MainWindow::PedInfo() m_gangRespect[i].SetWindowTextW(buf); } - // Calculate and display selected weapon ID - short* weapSTART = (short*)(&playerPed->playerWeapons->weapons[0]->ammo); - short* weapCURR = (short*)(&playerPed->selectedWeapon->ammo); - int weapID = (weapCURR - weapSTART) / 48; - if (weapID >= 0) - { - swprintf(buf, 256, L"%d", weapID); - m_pedSType.SetWindowTextW(buf); - } - else m_pedSType.SetWindowTextW(L""); - // Display current weapon's ammo and reload time if (playerPed->selectedWeapon) { + swprintf(buf, 256, L"%d", playerPed->selectedWeapon->id); + m_pedSType.SetWindowTextW(buf); + float ammowithcomma = playerPed->selectedWeapon->ammo / 10.0f; swprintf(buf, 256, L"%f", ammowithcomma); m_pedSAmmo.SetWindowTextW(buf); @@ -1383,39 +1410,23 @@ void MainWindow::PedInfo() { m_pedSAmmo.SetWindowTextW(L""); m_pedSTime.SetWindowTextW(L""); + m_pedSType.SetWindowTextW(L""); } // If player in the car, display it's coords if (playerPed->currentCar) { - if (playerPed->currentCar->sprite->x != pedXOld) - { - swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->x / 16384.0); - m_pedX.SetWindowTextW(buf); - pedXOld = playerPed->currentCar->sprite->x; - } + swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->x / 16384.0); + m_pedX.SetWindowTextW(buf); - if (playerPed->currentCar->sprite->y != pedYOld) - { - swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->y / 16384.0); - m_pedY.SetWindowTextW(buf); - pedYOld = playerPed->currentCar->sprite->y; - } + swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->y / 16384.0); + m_pedY.SetWindowTextW(buf); - if (playerPed->currentCar->sprite->z != pedZOld) - { - swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->z / 16384.0); - m_pedZ.SetWindowTextW(buf); - pedZOld = playerPed->currentCar->sprite->z; - } + swprintf(buf, 256, L"%.2f", playerPed->currentCar->sprite->z / 16384.0); + m_pedZ.SetWindowTextW(buf); - if (playerPed->currentCar->sprite->rotation != pedRotOld) - { - swprintf(buf, 256, L"%d", playerPed->currentCar->sprite->rotation/4); - m_pedRot.SetWindowTextW(buf); - pedRotOld = playerPed->currentCar->sprite->rotation; - } - + swprintf(buf, 256, L"%d", playerPed->currentCar->sprite->rotation/4); + m_pedRot.SetWindowTextW(buf); } // If player is not in the car, display ped's coords else @@ -1430,37 +1441,21 @@ void MainWindow::PedInfo() } else { - // Display that ultra-cool message + // Display that ultra cool message if (playerPed->gameObject->cigaretteIdleTimer == 1) log(L"Smokin' time ;3"); - if (playerPed->gameObject->sprite->x != pedXOld) - { - swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->x / 16384.0); - m_pedX.SetWindowTextW(buf); - pedXOld = playerPed->gameObject->sprite->x; - } - - if (playerPed->gameObject->sprite->y != pedYOld) - { - swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->y / 16384.0); - m_pedY.SetWindowTextW(buf); - pedYOld = playerPed->gameObject->sprite->y; - } + swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->x / 16384.0); + m_pedX.SetWindowTextW(buf); - if (playerPed->gameObject->sprite->z != pedZOld) - { - swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->z / 16384.0); - m_pedZ.SetWindowTextW(buf); - pedZOld = playerPed->gameObject->sprite->z; - } + swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->y / 16384.0); + m_pedY.SetWindowTextW(buf); - if (playerPed->gameObject->sprite->rotation != pedRotOld) - { - swprintf(buf, 256, L"%d", playerPed->gameObject->sprite->rotation/4); - m_pedRot.SetWindowTextW(buf); - pedRotOld = playerPed->gameObject->sprite->rotation; - } + swprintf(buf, 256, L"%.2f", playerPed->gameObject->sprite->z / 16384.0); + m_pedZ.SetWindowTextW(buf); + + swprintf(buf, 256, L"%d", playerPed->gameObject->sprite->rotation/4); + m_pedRot.SetWindowTextW(buf); } } } @@ -1612,7 +1607,7 @@ void MainWindow::ToggleDoor(UINT uID) if (!currLastCar) return; - int doorID = uID - 3075; + int doorID = uID - IDC_DOOR1; if (currLastCar->carDoor[doorID].doorState == 6 || doorOpen[doorID] == true) { doorOpen[doorID] = !doorOpen[doorID]; @@ -1651,7 +1646,7 @@ void MainWindow::CarEmblemMinus() { // Prev emblem // currLastCarEmblemID--; - currLastCarEmblem->sprite->sprite = emblems[currLastCarEmblemID].id; + currLastCarEmblem->sprite->sprite = carEmblems[currLastCarEmblemID].id; log(L"Car emblem changed"); } } @@ -1677,18 +1672,18 @@ void MainWindow::CarEmblemPlus() if (currLastCarEmblem) { currLastCarEmblemID = 1; - currLastCarEmblem->sprite->sprite = emblems[1].id; + currLastCarEmblem->sprite->sprite = carEmblems[1].id; currLastCarEmblem->rotation = 0; currLastCarEmblem->sprite->layer++; m_carEmblemPos.SetPos(currLastCarEmblem->yOffset); log(L"Car emblem created"); } } - else if (currLastCarEmblemID < sizeof(emblems)/sizeof(emblems[0]) - 1) + else if (currLastCarEmblemID < sizeof(carEmblems)/sizeof(carEmblems[0]) - 1) { // Next emblem // currLastCarEmblemID++; - currLastCarEmblem->sprite->sprite = emblems[currLastCarEmblemID].id; + currLastCarEmblem->sprite->sprite = carEmblems[currLastCarEmblemID].id; log(L"Car emblem changed"); } } @@ -1699,12 +1694,11 @@ void MainWindow::CarColorPlus() if (!currLastCar || !currLastCar->sprite) return; - currLastCar->sprite->lockPalleteMaybe = 3; - currLastCar->sprite->carColor++; - if (currLastCar->sprite->carColor >35) - currLastCar->sprite->carColor = 0; + short color = currLastCar->sprite->carColor; + if (~currLastCar->sprite->lockPalleteMaybe & 1) color = -1; + color++; - log(L"Car color changed"); + CarColorSet(color); } void MainWindow::CarColorMinus() @@ -1713,10 +1707,11 @@ void MainWindow::CarColorMinus() if (!currLastCar || !currLastCar->sprite) return; - currLastCar->sprite->lockPalleteMaybe = 3; - currLastCar->sprite->carColor--; - if (currLastCar->sprite->carColor <0) currLastCar->sprite->carColor = 35; - log(L"Car color changed"); + short color = currLastCar->sprite->carColor; + if (~currLastCar->sprite->lockPalleteMaybe & 1) color = -1; + color--; + + CarColorSet(color); } void MainWindow::CarColorReset() @@ -1725,74 +1720,74 @@ void MainWindow::CarColorReset() if (!currLastCar || !currLastCar->sprite) return; - currLastCar->sprite->lockPalleteMaybe = 2; - currLastCar->sprite->carColor = 0; - log(L"Car color changed"); + CarColorSet(-1); } -void MainWindow::PedClothesMinus() +void MainWindow::CarColorSet(short color) { - Ped* playerPed = fnGetPedByID(1); + if (color < -1) color = 35; + if (color > 35) color = -1; - // Return if player ped doesn't exist - if (!playerPed) - return; + if (color == -1) + { + currLastCar->sprite->lockPalleteMaybe &= ~1; + currLastCar->sprite->carColor = 0; + } + else + { + currLastCar->sprite->lockPalleteMaybe |= 1; + currLastCar->sprite->carColor = color; + } - playerPed->remap = (PED_REMAP)((BYTE)playerPed->remap - 1); - if (playerPed->remap == 255) playerPed->remap = (PED_REMAP)52; - log(L"Player clothes changed"); + log(L"Car color changed"); } -void MainWindow::PedClothesPlus() +void MainWindow::PedRemapShapeSet() { - Ped* playerPed = fnGetPedByID(1); - - // Return if player ped doesn't exist - if (!playerPed) - return; - - playerPed->remap = (PED_REMAP)((BYTE)playerPed->remap + 1); - if (playerPed->remap > 52) playerPed->remap = (PED_REMAP)0; - log(L"Player clothes changed"); -} + bool inGame = *(DWORD*)ptrToPedManager != 0; + if (!inGame) return; -void MainWindow::PedShapeMinus() -{ Ped* playerPed = fnGetPedByID(1); - // Return if player ped doesn't exist - if (!playerPed) - return; + if (playerPed->remap != m_pedRemap.GetCurSel()) + { + playerPed->remap = (PED_REMAP)m_pedRemap.GetCurSel(); + log(L"Remap set to %d", playerPed->remap); + } - playerPed->remap2 = (PED_REMAP2)((BYTE)playerPed->remap2 - 1); - if (playerPed->remap2 == -1) playerPed->remap2 = (PED_REMAP2)2; - log(L"Player appearance changed"); + if (playerPed->remap2 != m_pedShape.GetCurSel()) + { + playerPed->remap2 = (PED_REMAP2)m_pedShape.GetCurSel(); + log(L"Shape set to %d", playerPed->remap2); + } } -void MainWindow::PedShapePlus() +void MainWindow::PedRemapShapeDefault() { + bool inGame = *(DWORD*)ptrToPedManager != 0; + if (!inGame) return; + Ped* playerPed = fnGetPedByID(1); - // Return if player ped doesn't exist - if (!playerPed) - return; + playerPed->remap = PED_REMAP_PLAYER; + playerPed->remap2 = PED_REMAP2_1; - playerPed->remap2 = (PED_REMAP2)((BYTE)playerPed->remap2 + 1); - if (playerPed->remap2 > 2) playerPed->remap2 = (PED_REMAP2)0; - log(L"Player appearance changed"); + log(L"Remap and shape set to default"); } -void MainWindow::PedShapeClothesReset() +void MainWindow::PedRemapShapeUpdate() { Ped* playerPed = fnGetPedByID(1); - // Return if player ped doesn't exist - if (!playerPed) - return; + if (playerPed->remap != m_pedRemap.GetCurSel() && !m_pedRemap.GetDroppedState()) + { + m_pedRemap.SetCurSel(playerPed->remap); + } - playerPed->remap2 = PED_REMAP2_1; - playerPed->remap = PED_REMAP_PLAYER; - log(L"Player appearance reset"); + if(playerPed->remap2 != m_pedShape.GetCurSel() && !m_pedShape.GetDroppedState()) + { + m_pedShape.SetCurSel(playerPed->remap2); + } } void MainWindow::ShowBigText() @@ -1848,18 +1843,21 @@ void MainWindow::HijackTrain() } } -void MainWindow::SetGlobalPedSpeeds() +void MainWindow::CarMakeDummy() { - CString buffer; + if(!currLastCar) return; - m_globalPedSpeeds[0].GetWindowTextW(buffer); - *(int*)(DWORD*)0x66a504 = (int)_ttof(buffer); - m_globalPedSpeeds[1].GetWindowTextW(buffer); - *(int*)(DWORD*)0x66a574 = (int)_ttof(buffer); - m_globalPedSpeeds[2].GetWindowTextW(buffer); - *(int*)(DWORD*)0x66a634 = (int)_ttof(buffer); + if (currLastCar->driver) { + log(L"Car already has a driver"); + return; + } + + fnCarPutDummyDriverIn(currLastCar, 0); + fnCarMakeDummy(currLastCar, 0); + currLastCar->field_0x76 = 0; + currLastCar->field_0x7c = 5; - log(L"Peds speeds changed *experimental feature*"); + log(L"Dummy driver created"); } void MainWindow::FreeShopping() @@ -1878,40 +1876,24 @@ void MainWindow::GoSlow() } void MainWindow::SetHealthArmorMoney() -{ - CString buffer; - - m_pedHealth.GetWindowTextW(buffer); - fnGetPedByID(1)->health = (int)_ttof(buffer); - - m_pedArmor.GetWindowTextW(buffer); - *(int*)(*(DWORD*)(*(DWORD*)0x005eb4fc + 0x4) + 0x6fa) = (int)_ttof(buffer); //TEMPONARY; when i learn how to use Ghirda, i'll fix that xD - - m_pedMoney.GetWindowTextW(buffer); - *(int*)(*(DWORD*)(*(DWORD*)0x005eb4fc + 0x38) + 0x2d4) = (int)_ttof(buffer); //TEMPONARY; when i learn how to use Ghirda, i'll fix that xD - - log(L"Player stats changed!"); - -} - -void MainWindow::TeleportPlayer() { Game* pGame = (Game*)*(DWORD*)ptrToGame; if (!pGame) return; Player* player = pGame->CurrentPlayer; if (!player) return; - fesetround(FE_TONEAREST); CString buffer; - m_pedX.GetWindowTextW(buffer); - float newx = _wtof(buffer); - m_pedY.GetWindowTextW(buffer); - float newy = _wtof(buffer); + m_pedHealth.GetWindowTextW(buffer); + fnGetPedByID(1)->health = (int)_ttof(buffer); - fnDoTeleport(player, newx, newy); + m_pedArmor.GetWindowTextW(buffer); + player->armor = (int)_ttof(buffer); + + m_pedMoney.GetWindowTextW(buffer); + player->animatedMoney.value = (int)_ttof(buffer); - log(L"Player teleported to %f, %f", newx, newy); + log(L"Player's stats changed!"); } void MainWindow::ExplodeCars() { @@ -1995,12 +1977,14 @@ void MainWindow::OnGTAGameTick(Game* game) { //OnTimer moved here, it's more stable now KeepLockedValues(); + PedRemapShapeUpdate(); PedInfo(); if (captureMouse) CaptureMouse(); FixCheckboxes(); SafeSpawnCars(wtsCar, &wtsCarSize); PreventFPSComprensation(game); if (wtSpawnObject != -1) SpawnObject((OBJECT_TYPE)wtSpawnObject); + m_cameraWindow->OnGTAGameTick(); } void MainWindow::OnGTADraw() diff --git a/MainWindow.h b/MainWindow.h index c9ce998..b028f52 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -5,6 +5,7 @@ #include "ACSWindow.h" #include "PedSpawnerWindow.h" #include "LiveTable/LiveTableWindow.h" +#include "CameraWindow.h" enum TIMER { TIMER_CAPTURE_MOUSE, @@ -22,6 +23,7 @@ class MainWindow : public CDialogEx protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: @@ -34,6 +36,7 @@ class MainWindow : public CDialogEx ACSWindow* m_acsWindow; PedSpawnerWindow* m_pedSpawnerWindow; LiveTableWindow* m_liveTableWindow; + CameraWindow* m_cameraWindow; void OnPaint(); afx_msg void OnBnClickedExit(); @@ -65,8 +68,8 @@ class MainWindow : public CDialogEx CEdit m_pedHealth; CEdit m_pedArmor; CEdit m_pedMoney; - CEdit m_pedClothes; - CEdit m_pedShape; + CComboBox m_pedRemap; + CComboBox m_pedShape; CEdit m_BigText; CEdit m_pedals[3]; CEdit m_gangRespect[3]; @@ -119,6 +122,7 @@ class MainWindow : public CDialogEx afx_msg void OnPlayVocalMenuClick(UINT nID); afx_msg void OnNativeCheatMenuClick(UINT nID); afx_msg void OnShowLiveTable(); + afx_msg void OnShowCamera(); // currLastCar related Car* currLastCar = 0; @@ -127,19 +131,29 @@ class MainWindow : public CDialogEx void TpToLastCar(); void PrintCarInfo(); void HijackTrain(); + void CarMakeDummy(); // currLastCar's color afx_msg void CarColorReset(); afx_msg void CarColorPlus(); afx_msg void CarColorMinus(); + void CarColorSet(short index); void SyncTrailerColor(); // currLastCar's damage void FixCar(); void CarExplode(); - void LockCarDamage(); - short startCarDamage = 0; - bool carDamageLocked = 0; + + // currLastCar's physics bitmap + void CarPhysBitmaskSet(UINT nID); + void SetCarPhysBitmask(uint pos, bool value); + void CarPhysBitmaskUpdate(); + int m_carInvAll = 0; + int m_carInvBullets = 0; + int m_carInvCollisions = 0; + int m_carInvRockets = 0; + int m_carInvFlames = 0; + int m_carNoCollisions = 0; // currLastCar's visual damage void VisFixCar(); @@ -170,13 +184,11 @@ class MainWindow : public CDialogEx // walking speed void GoSlow(); int* walkingSpeed = nullptr; - void SetGlobalPedSpeeds(); - int globalPedSpeedsOld[3] = { 1,1,1 }; // same here // watch peds void WatchPeds(); void WatchNextPed(); - Ped* selectedPed = 0; + Ped* selectedPed = nullptr; bool watchPeds = false; int pedXPreWatch = 0, pedYPreWatch = 0, pedZPreWatch = 0; @@ -185,19 +197,16 @@ class MainWindow : public CDialogEx bool captureMouse = 0; void CaptureMouse(); - // ped clothes - void PedClothesPlus(); - void PedClothesMinus(); - void PedShapePlus(); - void PedShapeMinus(); - void PedShapeClothesReset(); + // player ped remap and shape + void PedRemapShapeSet(); + void PedRemapShapeDefault(); + void PedRemapShapeUpdate(); // player immortal void PlayerImmortal(); bool playerImmortal = 0; // other - void TeleportPlayer(); void SetHealthArmorMoney(); void TeleportAllPeds(); void GangRespect(UINT nID); @@ -213,8 +222,7 @@ class MainWindow : public CDialogEx void KeepLockedValues(); void PedInfo(); int currLastCarXOld = 0, currLastCarYOld = 0, currLastCarXYShift; - int pedXOld = 0, pedYOld = 0, pedZOld = 0, pedRotOld = 0; - int pedHOld = 1, pedAOld = 1, pedMOld = 1; // 1 not 0 because it has to be different than the actual value in the first tick + int pedHOld = -1, pedAOld = -1, pedMOld = -1; // important void OnGTAGameTick(Game* game); diff --git a/MainWindowData.h b/MainWindowData.h index 71691f5..6db3be3 100644 --- a/MainWindowData.h +++ b/MainWindowData.h @@ -295,12 +295,12 @@ const CatMenuItem cars[] = { {2, L"ZCX5", 83} }; -struct Emblem { +struct CarEmblem { wchar_t* name; short id; }; -const Emblem emblems[] = { +const CarEmblem carEmblems[] = { {L"None", 0}, {L"Loonies", 294}, {L"Yakuza", 295}, @@ -452,12 +452,12 @@ const MenuItem nativeCheats[] = { {L"Show all arrows", 0xB2} }; -struct Occupation { +struct PedProperty { wchar_t* name; UINT id; }; -const Occupation occupations[] = { +const PedProperty occupations[] = { {L"0 - Player", 0}, {L"1", 1}, {L"2", 2}, @@ -492,7 +492,7 @@ const Occupation occupations[] = { {L"32 - Guard against player ?", 32}, {L"33 - Criminal type 1 ?", 33}, {L"34 - Criminal type 2 ?", 34}, - {L"35 - Special group member ?", 35}, + {L"35 - Special group member", 35}, {L"36 - Tank driver ?", 36}, {L"37 - FBI in a roadblock", 37}, {L"38 - Fireman ?", 38}, @@ -511,23 +511,13 @@ const Occupation occupations[] = { {L"51", 51} }; -struct BodyShape { - wchar_t* name; - UINT id; -}; - -const BodyShape bodyShapes[] = { +const PedProperty pedBodyShapes[] = { {L"Ped", 0}, {L"Armored", 1}, {L"Heavily armored", 2} }; -struct PedRemap { - wchar_t* name; - UINT id; -}; - -const PedRemap pedRemaps[] = { +const PedProperty pedRemaps[] = { {L"Blue police", 0}, {L"Green police", 1}, {L"Red police", 2}, @@ -583,24 +573,44 @@ const PedRemap pedRemaps[] = { {L"Dummy 31", 52} }; +const PedProperty pedThreatSearch[] = { + {L"No threats", 0}, + {L"In line of sight", 1}, + {L"In nearby area", 2}, + {L"Area (player threat only)", 3}, + {L"Sight (player threat only)", 4}, + {L"Area (player only)", 5}, + {L"Sight (player only)", 6} +}; + +const PedProperty pedThreatReactions[] = { + {L"No reaction", 0}, + {L"React as emergency", 1}, + {L"React as normal", 2}, + {L"Run away", 3} +}; + struct PedPreset { wchar_t* name; PED_REMAP2 shape; PED_REMAP remap; WEAPON_INDEX weapon; short health; - OCUPATION occupation; + PED_OCUPATION occupation; + PED_THREAT_SEARCH threatSearch; + PED_THREAT_REACTION threatReaction; int aiValues[10]; // 0 - state (0x278) // 1 - state2 (0x27c) - // 2 - state3 (0x258) - // 3 - shooting skill maybe (0x288) - // 4 - guard mode (0x28c) - // 5 - bitstate (0x21c) - // 6 - bitstate2 (0x238) - // 7 - timer to action (0x218) + // 2 - objective (0x258) + // 3 - bitstate (0x21c) + // 4 - bitstate2 (0x238) + // 5 - objective timer (0x218) + // 6 - reserverd + // 7 - reserverd // 8 - reserverd // 9 - reserverd + bool playerLeader = false; }; const int aiValuesCount = sizeof(PedPreset::aiValues) / sizeof(PedPreset::aiValues[0]); @@ -611,8 +621,10 @@ const PedPreset pedPresets[] = { (PED_REMAP)27, (WEAPON_INDEX)-1, 50, - (OCUPATION)3, - {0, 0, 0, 2, 3, 1, 3, 0x270F, -1, -1} + (PED_OCUPATION)3, + PED_THREAT_SEARCH_AREA, + PED_THREAT_REACTION_RUN_AWAY, + {0, 0, 0, 1, 3, 9999, -1, -1, -1, -1} }, { L"Cop", // on foot variant ofc @@ -620,26 +632,21 @@ const PedPreset pedPresets[] = { (PED_REMAP)0, (WEAPON_INDEX)-1, 50, - (OCUPATION)29, - {0, 0, 0, 1, 1, 1, 3, 0x270F, -1, -1} + (PED_OCUPATION)29, + PED_THREAT_SEARCH_LINE_OF_SIGHT, + PED_THREAT_REACTION_REACT_AS_EMERGENCY, + {0, 0, 0, 1, 3, 9999, -1, -1, -1, -1} }, - /*{ - L"Scientist (gang)", // on foot variant ofc - (PED_REMAP2)1, - (PED_REMAP)7, - (WEAPON_INDEX)1, - 50, - (OCUPATION)19, - {0, 0, 0, 1, 2, 1, 4, 0x270F, -1, -1} - },*/ { L"Mugger", (PED_REMAP2)0, (PED_REMAP)17, (WEAPON_INDEX)-1, 50, - (OCUPATION)15, - {0, 0, 0, 2, 3, 1, 3, 0, -1, -1} + (PED_OCUPATION)15, + PED_THREAT_SEARCH_AREA, + PED_THREAT_REACTION_RUN_AWAY, + {0, 0, 0, 1, 3, 0, -1, -1, -1, -1} }, { L"Car thief", @@ -647,8 +654,10 @@ const PedPreset pedPresets[] = { (PED_REMAP)15, (WEAPON_INDEX)-1, 50, - (OCUPATION)16, - {0, 0, 0, 2, 3, 1, 3, 0, -1, -1} + (PED_OCUPATION)16, + PED_THREAT_SEARCH_AREA, + PED_THREAT_REACTION_RUN_AWAY, + {0, 0, 0, 1, 3, 0, -1, -1, -1, -1} }, { L"FBI", @@ -656,9 +665,23 @@ const PedPreset pedPresets[] = { (PED_REMAP)8, (WEAPON_INDEX)9, 250, - (OCUPATION)26, - {0, 0, 0, 1, 1, 1, 4, 0x270F, -1, -1} + (PED_OCUPATION)26, + PED_THREAT_SEARCH_LINE_OF_SIGHT, + PED_THREAT_REACTION_REACT_AS_EMERGENCY, + {0, 0, 0, 1, 4, 9999, -1, -1, -1, -1} }, + { + L"Bodyguard", + (PED_REMAP2)1, + (PED_REMAP)25, + (WEAPON_INDEX)1, + 50, + (PED_OCUPATION)35, + PED_THREAT_SEARCH_LINE_OF_SIGHT, + PED_THREAT_REACTION_REACT_AS_NORMAL, + {0, 0, 0, 1, 4, 9999, -1, -1, -1, -1}, + true + } }; #endif \ No newline at end of file diff --git a/PedSpawnerWindow.cpp b/PedSpawnerWindow.cpp index 55366e2..92a6daf 100644 --- a/PedSpawnerWindow.cpp +++ b/PedSpawnerWindow.cpp @@ -25,6 +25,8 @@ BEGIN_MESSAGE_MAP(PedSpawnerWindow, CDialogEx) ON_CBN_SELCHANGE(IDC_PS_SHAPE, &PedSpawnerWindow::OnCustomPresetTrigger) ON_CBN_SELCHANGE(IDC_PS_WEAP, &PedSpawnerWindow::OnCustomPresetTrigger) ON_CBN_SELCHANGE(IDC_PS_OCCUP, &PedSpawnerWindow::OnCustomPresetTrigger) + ON_CBN_SELCHANGE(IDC_PS_THR_S, &PedSpawnerWindow::OnCustomPresetTrigger) + ON_CBN_SELCHANGE(IDC_PS_THR_R, &PedSpawnerWindow::OnCustomPresetTrigger) ON_EN_CHANGE(IDC_PS_HEALTH, &PedSpawnerWindow::OnCustomPresetTrigger) ON_EN_CHANGE(IDC_PS_AI0, &PedSpawnerWindow::OnCustomPresetTrigger) ON_EN_CHANGE(IDC_PS_AI1, &PedSpawnerWindow::OnCustomPresetTrigger) @@ -32,10 +34,11 @@ BEGIN_MESSAGE_MAP(PedSpawnerWindow, CDialogEx) ON_EN_CHANGE(IDC_PS_AI3, &PedSpawnerWindow::OnCustomPresetTrigger) ON_EN_CHANGE(IDC_PS_AI4, &PedSpawnerWindow::OnCustomPresetTrigger) ON_EN_CHANGE(IDC_PS_AI5, &PedSpawnerWindow::OnCustomPresetTrigger) - ON_EN_CHANGE(IDC_PS_AI6, &PedSpawnerWindow::OnCustomPresetTrigger) - ON_EN_CHANGE(IDC_PS_AI7, &PedSpawnerWindow::OnCustomPresetTrigger) - ON_EN_CHANGE(IDC_PS_AI8, &PedSpawnerWindow::OnCustomPresetTrigger) - ON_EN_CHANGE(IDC_PS_AI9, &PedSpawnerWindow::OnCustomPresetTrigger) + //ON_EN_CHANGE(IDC_PS_AI6, &PedSpawnerWindow::OnCustomPresetTrigger) + //ON_EN_CHANGE(IDC_PS_AI7, &PedSpawnerWindow::OnCustomPresetTrigger) + //ON_EN_CHANGE(IDC_PS_AI8, &PedSpawnerWindow::OnCustomPresetTrigger) + //ON_EN_CHANGE(IDC_PS_AI9, &PedSpawnerWindow::OnCustomPresetTrigger) + ON_EN_CHANGE(IDC_PS_LEADER, &PedSpawnerWindow::OnCustomPresetTrigger) END_MESSAGE_MAP() @@ -51,16 +54,19 @@ void PedSpawnerWindow::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_PS_SHAPE, m_shape); DDX_Control(pDX, IDC_PS_WEAP, m_weapon); DDX_Control(pDX, IDC_PS_OCCUP, m_occupation); + DDX_Control(pDX, IDC_PS_THR_S, m_threatSearch); + DDX_Control(pDX, IDC_PS_THR_R, m_threatReaction); DDX_Text(pDX, IDC_PS_AI0, m_aiValues[0]); DDX_Text(pDX, IDC_PS_AI1, m_aiValues[1]); DDX_Text(pDX, IDC_PS_AI2, m_aiValues[2]); DDX_Text(pDX, IDC_PS_AI3, m_aiValues[3]); DDX_Text(pDX, IDC_PS_AI4, m_aiValues[4]); DDX_Text(pDX, IDC_PS_AI5, m_aiValues[5]); - DDX_Text(pDX, IDC_PS_AI6, m_aiValues[6]); - DDX_Text(pDX, IDC_PS_AI7, m_aiValues[7]); + //DDX_Text(pDX, IDC_PS_AI6, m_aiValues[6]); + //DDX_Text(pDX, IDC_PS_AI7, m_aiValues[7]); //DDX_Text(pDX, IDC_PS_AI8, m_aiValues[8]); //DDX_Text(pDX, IDC_PS_AI9, m_aiValues[9]); + DDX_Text(pDX, IDC_PS_LEADER, m_leaderID); } int PedSpawnerWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) @@ -74,7 +80,7 @@ void PedSpawnerWindow::ClearValues() m_xPos = 0; m_yPos = 0; m_zPos = 0; - m_health = 100; + m_health = 50; UpdateData(FALSE); @@ -86,9 +92,9 @@ void PedSpawnerWindow::ClearValues() m_customPresetIndex = presetsCount; m_shape.ResetContent(); - int shapesCount = sizeof(bodyShapes) / sizeof(bodyShapes[0]); + int shapesCount = sizeof(pedBodyShapes) / sizeof(pedBodyShapes[0]); for (int i = 0; i < shapesCount; i++) - m_shape.AddString(bodyShapes[i].name); + m_shape.AddString(pedBodyShapes[i].name); m_remap.ResetContent(); int remapsCount = sizeof(pedRemaps) / sizeof(pedRemaps[0]); @@ -105,7 +111,16 @@ void PedSpawnerWindow::ClearValues() int occupationsCount = sizeof(occupations) / sizeof(occupations[0]); for (int i = 0; i < occupationsCount; i++) m_occupation.AddString(occupations[i].name); - + + m_threatSearch.ResetContent(); + int threatSearchCount = sizeof(pedThreatSearch) / sizeof(pedThreatSearch[0]); + for (int i = 0; i < threatSearchCount; i++) + m_threatSearch.AddString(pedThreatSearch[i].name); + + m_threatReaction.ResetContent(); + int threatReactionsCount = sizeof(pedThreatReactions) / sizeof(pedThreatReactions[0]); + for (int i = 0; i < threatReactionsCount; i++) + m_threatReaction.AddString(pedThreatReactions[i].name); GetPlayerPos(); LoadPreset(0); @@ -122,8 +137,8 @@ void PedSpawnerWindow::LoadPreset(int index) PedPreset preset = pedPresets[index]; - for (int i = 0; i < sizeof(bodyShapes) / sizeof(bodyShapes[0]); i++) { - if (bodyShapes[i].id != preset.shape) + for (int i = 0; i < sizeof(pedBodyShapes) / sizeof(pedBodyShapes[0]); i++) { + if (pedBodyShapes[i].id != preset.shape) continue; m_shape.SetCurSel(i); @@ -151,10 +166,26 @@ void PedSpawnerWindow::LoadPreset(int index) m_occupation.SetCurSel(i); } + for (int i = 0; i < sizeof(pedThreatSearch) / sizeof(pedThreatSearch[0]); i++) { + if (pedThreatSearch[i].id != preset.threatSearch) + continue; + + m_threatSearch.SetCurSel(i); + } + + for (int i = 0; i < sizeof(pedThreatReactions) / sizeof(pedThreatReactions[0]); i++) { + if (pedThreatReactions[i].id != preset.threatReaction) + continue; + + m_threatReaction.SetCurSel(i); + } + m_health = preset.health; for(int i = 0; i < aiValuesCount; i++) m_aiValues[i] = preset.aiValues[i]; + m_leaderID = preset.playerLeader ? 1 : 0; + UpdateData(FALSE); } @@ -223,7 +254,7 @@ void PedSpawnerWindow::OnSpawnClick() ped->health = m_health; - int shape = bodyShapes[m_shape.GetCurSel()].id; + int shape = pedBodyShapes[m_shape.GetCurSel()].id; ped->remap2 = (PED_REMAP2)shape; int weaponSel = m_weapon.GetCurSel(); @@ -233,23 +264,41 @@ void PedSpawnerWindow::OnSpawnClick() } int occupation = occupations[m_occupation.GetCurSel()].id; - ped->occupation = (OCUPATION)occupation; + ped->occupation = (PED_OCUPATION)occupation; - //todo: ped->gameObject->spriteRotation + int threatSearch = pedThreatSearch[m_threatSearch.GetCurSel()].id; + ped->threatSearch = (PED_THREAT_SEARCH)threatSearch; + + int threatReaction = pedThreatReactions[m_threatReaction.GetCurSel()].id; + ped->threatReaction = (PED_THREAT_REACTION)threatReaction; SetPedAiValues(ped, m_aiValues); + + if(m_leaderID != 0) { + Ped* leaderPed = fnGetPedByID(m_leaderID); + + if(!leaderPed) { + MessageBox(L"Leader ped not found"); + return; + } + + if (leaderPed->group) { + fnPedGroupAddPed(leaderPed->group, 0, ped); + } + else { + fnPedGroupCreate(ped, 0, 0); + fnPedGroupChangeLeader(leaderPed, 0, ped); + } + } } void PedSpawnerWindow::SetPedAiValues(Ped* ped, int* values) { if(values[0] != -1) ped->state = (PED_STATE)values[0]; if(values[1] != -1) ped->state2 = (PED_STATE2)values[1]; - if(values[2] != -1) ped->state3 = (PED_STATE3)values[2]; - if(values[3] != -1) ped->shootingSkillMaybe = values[3]; - if(values[4] != -1) ped->guardMode = (PED_GUARD_MODE)values[4]; - if(values[5] != -1) ped->bitStateInvisOnFireEtc = (PED_BIT_STATE)values[5]; - if(values[6] != -1) ped->bitState2 = (PED_BIT_STATE2)values[6]; - if(values[7] != -1) ped->timerToAction = values[7]; - if(values[8] != -1) ped->field_0x230 = values[8]; + if(values[2] != -1) ped->objective = (PED_OBJECTIVE)values[2]; + if(values[3] != -1) ped->bitState = (PED_BIT_STATE)values[3]; + if(values[4] != -1) ped->bitState2 = (PED_BIT_STATE2)values[4]; + if(values[5] != -1) ped->objectiveTimer = values[5]; } diff --git a/PedSpawnerWindow.h b/PedSpawnerWindow.h index ea1d825..7097d3f 100644 --- a/PedSpawnerWindow.h +++ b/PedSpawnerWindow.h @@ -44,9 +44,12 @@ class PedSpawnerWindow : public CDialogEx CComboBox m_remap; CComboBox m_shape; CComboBox m_occupation; + CComboBox m_threatSearch; + CComboBox m_threatReaction; short m_health = 100; CComboBox m_weapon; int m_aiValues[aiValuesCount] = { 0 }; + int m_leaderID = 0; UINT m_customPresetIndex = 0; UINT m_noneWeaponIndex = 0; diff --git a/README.md b/README.md index ec74407..6ccc36f 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,13 @@ Some of the main features are: - Controlling your character's stats e.g. health, ammo, appearance, walking speed, wanted level, respect - Teleporting peds and cars - Spawning vehicles +- Customizing your vehicle (color, emblems, damage, physics, invulnerability) - Spawning objects (power-ups etc.) -- Spawning peds (characters) +- Spawning characters and setting up their AIs - Playing vocals -- Getting weapons (including secret ones) +- Obtaining weapons (including secret ones) +- Obtaining car weapons - Getting unlimited ammo, no reload delays -- Getting car weapons - Using some of the built-in cheats without entering any cheat codes - A customizable table showing info about all peds and vehicles in real time @@ -24,7 +25,7 @@ gta-trainer.exe file instead of gta.exe and you should see the trainer window un If you're having problems with running the game make sure your system has [all needed VC++ Redistributables](https://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/) installed. -## Playing with the code +## Building If you want to build it on your own, there is a VS solution included in the repo. Before you'll try to compile it for the first time, you have to change some settings though @@ -35,10 +36,16 @@ Before you'll try to compile it for the first time, you have to change some sett 5. Compile! ## Authors -h0x91b, -masuo (aka. izawartka) +- masuo (aka. izawartka) +- h0x91b -And if you want to add something more to it, you're free to do it but it would be nice if you mentioned us somewhere. +## Knowledge sources +- Own research using Ghidra, Cheat Engine and x64dbg +- [Official scripting documentation](https://gtamp.com/GTA2/gta2script.7z) +- [.MIS decompiler by T.M.](https://gtamp.com/forum/viewtopic.php?f=4&t=447) +- [Memory addresses list by BeepBoop](https://gtamp.com/forum/viewtopic.php?t=1123) + +If you want to add something more to the software, you're free to do it but please mention us in your project. ## Links Some of my GTA2 videos on YT: diff --git a/gta2-helper.cpp b/gta2-helper.cpp index 7de2941..4d9b205 100644 --- a/gta2-helper.cpp +++ b/gta2-helper.cpp @@ -141,17 +141,17 @@ POINT ConvertGameWorldCoordinateToScreen(SCR_f gameX, SCR_f gameY) { int width = *(int*)0x00673578; int height = *(int*)0x006732e8; - auto pp = ByPtr(PlayerPhysics, ptrToPlayerPhysics); + auto pp = ByPtr(CameraOrPhysics, ptrToPlayerPhysics); - auto right = FloatDecode(pp->rightOfTheScreenX); - auto left = FloatDecode(pp->leftOfTheScreenX); - auto widthX = right - left; + double right = FloatDecode(pp->cameraBoundaries.right); + double left = FloatDecode(pp->cameraBoundaries.left); + double widthX = right - left; double gameUnitsToScreenProportionX = (double)width / widthX; double targetX = FloatDecode(gameX) - left; // offset from left - auto top = FloatDecode(pp->topOfTheScreenY); - auto bottom = FloatDecode(pp->bottomOfTheSceenY); - auto heightY = bottom - top; + double top = FloatDecode(pp->cameraBoundaries.top); + double bottom = FloatDecode(pp->cameraBoundaries.bottom); + double heightY = bottom - top; double gameUnitsToScreenProportionY = (double)height / heightY; double targetY = FloatDecode(gameY) - top; // offset from top @@ -179,3 +179,18 @@ bool IsPointSafe(SCR_f x, SCR_f y, SCR_f z) return true; } + +void ClampPointToSafe(SCR_f &x, SCR_f &y) +{ + if(x < 1 * 16384) x = 1 * 16384; + if(x > 254 * 16384) x = 254 * 16384; + if(y < 1 * 16384) y = 1 * 16384; + if(y > 254 * 16384) y = 254 * 16384; +} + +void ClampPointToSafe(SCR_f& x, SCR_f& y, SCR_f& z) +{ + ClampPointToSafe(x, y); + if(z < 0 * 16384) z = 0 * 16384; + if(z > 7 * 16384) z = 7 * 16384; +} \ No newline at end of file diff --git a/gta2-helper.h b/gta2-helper.h index 498b44d..5d23c83 100644 --- a/gta2-helper.h +++ b/gta2-helper.h @@ -62,8 +62,8 @@ static ShowBigOnScreenLabel* fnShowBigOnScreenLabel = (ShowBigOnScreenLabel*)0x0 typedef Car* (SpawnCar)(int x, int y, int z, short rot, CAR_MODEL model); static SpawnCar* fnSpawnCar = (SpawnCar*)0x00426e10; -//Car* __fastcall SpawnCarAdvanced(TrafficManager* trafficMngr, int edx, int x, int y, int z, int rot, CAR_MODEL4 model, int param_8) -typedef Car* (__fastcall SpawnCarAdvanced)(TrafficManager* trafficMngr, DWORD edx, int x, int y, int z, int rot, CAR_MODEL4 model, int param_8); +//Car* __fastcall SpawnCarAdvanced(TrafficManager* trafficMngr, int edx, int x, int y, int z, int rot, CAR_MODEL4 model, int scale) +typedef Car* (__fastcall SpawnCarAdvanced)(TrafficManager* trafficMngr, DWORD edx, int x, int y, int z, int rot, CAR_MODEL4 model, int scale); static SpawnCarAdvanced* fnSpawnCarAdvanced = (SpawnCarAdvanced*)0x00426ac0; // void __fastcall PlayVocal(void *param_1,undefined4 unused,VOCAL vocal) @@ -86,6 +86,40 @@ static SetPedPosition* fnSetPedPosition = (SetPedPosition*)0x004360c0; typedef void(__fastcall ExplodeCar)(Car* car, DWORD edx, EXPLOSION_SIZE explosionSize); static ExplodeCar* fnExplodeCar = (ExplodeCar*)0x00426fa0; +// void __fastcall FixCarDamage(Car *car) +typedef void(__fastcall FixCarDamage)(Car* car, DWORD edx); +static FixCarDamage* fnFixCarDamage = (FixCarDamage*)0x00425f20; + +// void __fastcall ExtinguishCar(Car *car) +// also set car->fireState to 0 for full extinguish +typedef void(__fastcall ExtinguishCar)(Car* car, DWORD edx); +static ExtinguishCar* fnExtinguishCar = (ExtinguishCar*)0x004bf070; + +// void __fastcall FixCarBrokenEngine(Car *car) +// allows to run the engine even after the car exploded +typedef void(__fastcall FixCarBrokenEngine)(Car* car, DWORD edx); +static FixCarBrokenEngine* fnFixCarBrokenEngine = (FixCarBrokenEngine*)0x00421570; + +// void __fastcall CarPutDummyDriverIn(Car *car) +typedef void(__fastcall CarPutDummyDriverIn)(Car* car, DWORD edx); +static CarPutDummyDriverIn* fnCarPutDummyDriverIn = (CarPutDummyDriverIn*)0x00423510; + +// void __fastcall CarMakeDummy(Car *car) +typedef void(__fastcall CarMakeDummy)(Car* car, DWORD edx); +static CarMakeDummy* fnCarMakeDummy = (CarMakeDummy*)0x004279e0; + +// void __thiscall PedGroupCreate(Ped *this,byte membersCount) +typedef void(__fastcall PedGroupCreate)(Ped* ped, DWORD edx, byte membersCount); +static PedGroupCreate* fnPedGroupCreate = (PedGroupCreate*)0x00440350; + +// void __fastcall PedGroupChangeLeader(Ped *ped1,uint eq0,Ped *ped2) +typedef void(__fastcall PedGroupChangeLeader)(Ped* newLeader, DWORD edx, Ped* oldLeader); +static PedGroupChangeLeader* fnPedGroupChangeLeader = (PedGroupChangeLeader*)0x00435490; + +// void __fastcall PedGroupAddPed(PedGroup *group,uint param_2,Ped *ped) +typedef void(__fastcall PedGroupAddPed)(PedGroup* group, DWORD edx, Ped* ped); +static PedGroupAddPed* fnPedGroupAddPed = (PedGroupAddPed*)0x00404c90; + typedef uint (CarAddWeapon)(CAR_WEAPON type, uint ammo, Car* car); static CarAddWeapon* fnCarAddWeapon = (CarAddWeapon*)0x004cd820; @@ -132,9 +166,9 @@ static DoTeleport* fnDoTeleportRaw = (DoTeleport*)0x004a5ad0; Usage: fnDoTeleport(fnGetPlayerSlotByIndex(0), 133.9, 106.5); */ -#define fnDoTeleport(p, x, y) \ - p->ph2.encodedCameraOrTeleportX = FloatEncode(x); \ - p->ph2.encodedCameraOrTeleportY = FloatEncode(y); \ +#define fnDoTeleport(p, xPos, yPos) \ + p->ph2.cameraPos.x = FloatEncode(xPos); \ + p->ph2.cameraPos.y = FloatEncode(yPos); \ fnDoTeleportRaw(p, 0); @@ -169,5 +203,7 @@ double FloatDecode(SCR_f x); SCR_f* GetPointInADistance(SCR_f baseX, SCR_f baseY, short rotation, SCR_f distance); POINT ConvertGameWorldCoordinateToScreen(SCR_f gameX, SCR_f gameY); bool IsPointSafe(SCR_f x, SCR_f y, SCR_f z); +void ClampPointToSafe(SCR_f &x, SCR_f &y); +void ClampPointToSafe(SCR_f &x, SCR_f &y, SCR_f &z); #endif // !GTA_H \ No newline at end of file diff --git a/gta2.h b/gta2.h index 697769c..12464a6 100644 --- a/gta2.h +++ b/gta2.h @@ -232,7 +232,7 @@ typedef enum PED_BIT_STATE2 { PED_BIT_STATE2_UNK_MUGGER=4 } PED_BIT_STATE2; -typedef enum OCUPATION { +typedef enum PED_OCUPATION { ANY_ELVIS=49, ANY_EMERGENCY_SERVICE_MAN=47, ANY_GANG_MEMBER=48, @@ -282,7 +282,7 @@ typedef enum OCUPATION { UNK_REL_TO_POLICE2=30, UNK_REL_TO_POLICE3=31, UNK_REL_TO_POLICE4=37 -} OCUPATION; +} PED_OCUPATION; typedef enum PED_REMAP : unsigned char { PED_REMAP_1=1, @@ -324,50 +324,90 @@ typedef enum PED_REMAP : unsigned char { PED_REMAP_PLAYER=25 } PED_REMAP; -typedef enum PED_STATE3 { - PED_STATE3_1f_SIT_IN_TAXY_OR_IN_STEALED_CAR=31, - PED_STATE3_2_DRIVER_RUN_AWAY=2, - PED_STATE3_32_WASTED=50, - PED_STATE3_COP=54, - PED_STATE3_DO_NOTHING=0, - PED_STATE3_RUN_AWAY_FROM_CAR = 34, - PED_STATE3_ENTERING_TO_CAR=35, - PED_STATE3_GANG_MEMBER=13, - PED_STATE3_GETTING_OUT_FROM_CAR=36, - PED_STATE3_ENTERING_TO_TRAIN = 37, - PED_STATE3_UNK1=1, - PED_STATE3_UNK10=16, - PED_STATE3_UNK13=19, - PED_STATE3_UNK14=20, - PED_STATE3_UNK16=22, - PED_STATE3_UNK17=23, - PED_STATE3_UNK18=24, - PED_STATE3_UNK19=25, - PED_STATE3_UNK1a=26, - PED_STATE3_UNK1b=27, - PED_STATE3_UNK20=32, - PED_STATE3_UNK21=33, - PED_STATE3_UNK26=38, - PED_STATE3_UNK2a=42, - PED_STATE3_UNK2b=43, - PED_STATE3_UNK33=51, - PED_STATE3_UNK34=52, - PED_STATE3_UNK37=55, - PED_STATE3_UNK38=56, - PED_STATE3_UNK39=57, - PED_STATE3_UNK3a=58, - PED_STATE3_UNK3b=59, - PED_STATE3_UNK3c=60, - PED_STATE3_UNK3d_REL_TO_MISSION_ARROWS=61, - PED_STATE3_UNK6=6, - PED_STATE3_UNK7=7, - PED_STATE3_UNK8=8, - PED_STATE3_UNK9=9, - PED_STATE3_UNKa=10, - PED_STATE3_UNKc=12, - PED_STATE3_UNKe=14, - PEF_STATE3_1c_DEAD=28 -} PED_STATE3; +typedef enum PED_OBJECTIVE { + PED_OBJECTIVE_NO_OBJ = 0, + PED_OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE = 1, + PED_OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE = 2, + PED_OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS = 3, + PED_OBJECTIVE_4 = 4, + PED_OBJECTIVE_5 = 5, + PED_OBJECTIVE_6 = 6, + PED_OBJECTIVE_7 = 7, + PED_OBJECTIVE_8 = 8, + PED_OBJECTIVE_9 = 9, + PED_OBJECTIVE_10 = 10, + PED_OBJECTIVE_11 = 11, + PED_OBJECTIVE_12 = 12, + PED_OBJECTIVE_GOTO_AREA_ON_FOOT = 13, + PED_OBJECTIVE_14 = 14, + PED_OBJECTIVE_GOTO_AREA_IN_CAR = 15, + PED_OBJECTIVE_16 = 16, + PED_OBJECTIVE_GOTO_CHAR_ON_FOOT = 17, + PED_OBJECTIVE_18 = 18, + PED_OBJECTIVE_19 = 19, + PED_OBJECTIVE_KILL_CHAR_ANY_MEANS = 20, + PED_OBJECTIVE_KILL_CHAR_ON_FOOT = 21, + PED_OBJECTIVE_22 = 22, + PED_OBJECTIVE_23 = 23, + PED_OBJECTIVE_24 = 24, + PED_OBJECTIVE_GUARD_SPOT = 25, + PED_OBJECTIVE_GUARD_AREA = 26, + PED_OBJECTIVE_WAIT_ON_FOOT = 27, + PED_OBJECTIVE_WAIT_IN_CAR = 28, + PED_OBJECTIVE_29 = 29, + PED_OBJECTIVE_30 = 30, + PED_OBJECTIVE_31 = 31, + PED_OBJECTIVE_32 = 32, + PED_OBJECTIVE_33 = 33, + PED_OBJECTIVE_34 = 34, + PED_OBJECTIVE_35 = 35, + PED_OBJECTIVE_36 = 36, + PED_OBJECTIVE_37 = 37, + PED_OBJECTIVE_38 = 38, + PED_OBJECTIVE_39 = 39, + PED_OBJECTIVE_ENTER_CAR_AS_DRIVER = 40, + PED_OBJECTIVE_LEAVE_CAR = 41, + PED_OBJECTIVE_42 = 42, + PED_OBJECTIVE_43 = 43, + PED_OBJECTIVE_44 = 44, + PED_OBJECTIVE_45 = 45, + PED_OBJECTIVE_46 = 46, + PED_OBJECTIVE_47 = 47, + PED_OBJECTIVE_48 = 48, + PED_OBJECTIVE_49 = 49, + PED_OBJECTIVE_50 = 50, + PED_OBJECTIVE_51 = 51, + PED_OBJECTIVE_52 = 52, + PED_OBJECTIVE_53 = 53, + PED_OBJECTIVE_54 = 54, + PED_OBJECTIVE_55 = 55, + PED_OBJECTIVE_56 = 56, + PED_OBJECTIVE_57 = 57, + PED_OBJECTIVE_58 = 58, + PED_OBJECTIVE_59 = 59, + PED_OBJECTIVE_FOLLOW_CAR_IN_CAR = 60, + PED_OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET = 61, + PED_OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE = 62, + PED_OBJECTIVE_DESTROY_OBJECT = 63, + PED_OBJECTIVE_DESTROY_CAR = 64 +} PED_OBJECTIVE; + +typedef enum PED_THREAT_SEARCH { + PED_THREAT_SEARCH_NO_THREATS=0, + PED_THREAT_SEARCH_LINE_OF_SIGHT=1, + PED_THREAT_SEARCH_AREA=2, + PED_THREAT_SEARCH_AREA_PLAYER_THREAT_ONLY=3, + PED_THREAT_SEARCH_LINE_OF_SIGHT_PLAYER_THREAT_ONLY=4, + PED_THREAT_SEARCH_AREA_PLAYER_ONLY=5, + PED_THREAT_SEARCH_LINE_OF_SIGHT_PLAYER_ONLY=6 +} PED_THREAT_SEARCH; + +typedef enum PED_THREAT_REACTION { + PED_THREAT_REACTION_NO_REACTION=0, + PED_THREAT_REACTION_REACT_AS_EMERGENCY=1, + PED_THREAT_REACTION_REACT_AS_NORMAL=2, + PED_THREAT_REACTION_RUN_AWAY=3 +} PED_THREAT_REACTION; typedef enum PED_REMAP2 { PED_REMAP2_0=0, @@ -419,7 +459,7 @@ typedef enum PED_STATE2 { PED_STATE2_f_UNK=15 } PED_STATE2; -typedef struct PlayerPhysics PlayerPhysics, *PPlayerPhysics; +typedef struct CameraOrPhysics CameraOrPhysics, *PPlayerPhysics; typedef enum SPRITE_BIT1 : unsigned char { SPRITE_BIT1_1=1 @@ -545,13 +585,6 @@ struct WEAPON_PLAYER_LIST { // ADDED IN FILE // -typedef enum PED_GUARD_MODE { - PED_GUARD_MODE_NONE = 0x0, - PED_GUARD_MODE_IF_ATTACKED = 0x1, - PED_GUARD_MODE_IF_SEES_VIOLENCE = 0x2, - PED_GUARD_MODE_FLEE_AWAY = 0x3 -} PED_GUARD_MODE; - typedef enum EXPLOSION_SIZE { EXPLOSION_SIZE_NONE = 0x11, EXPLOSION_SIZE_SMALL = 0x12, @@ -584,6 +617,30 @@ typedef enum CAR_WEAPON { CAR_WEAP_0 = 0 } CAR_WEAPON; +typedef enum CAR_PHYSICS_BITMASK : ushort { + CAR_PHYSICS_BITMASK_0x1 = 0x1, + CAR_PHYSICS_BITMASK_DONT_SLOW_ON_COLLISION = 0x2, + CAR_PHYSICS_BITMASK_0x4 = 0x4, + CAR_PHYSICS_BITMASK_NO_COLLISION_DAMAGE = 0x8, + CAR_PHYSICS_BITMASK_NO_COLLISION = 0x10, + CAR_PHYSICS_BITMASK_0x20 = 0x20, + CAR_PHYSICS_BITMASK_TRAIN_RELATED = 0x40, + CAR_PHYSICS_BITMASK_HAS_ALARM = 0x80, + CAR_PHYSICS_BITMASK_BULLETPROOF = 0x100, + CAR_PHYSICS_BITMASK_ROCKETPROOF = 0x200, + CAR_PHYSICS_BITMASK_FLAMEPROOF = 0x400, + CAR_PHYSICS_BITMASK_TANK_RELATED = 0x800, + CAR_PHYSICS_BITMASK_JAMMED = 0x1000, + CAR_PHYSICS_BITMASK_0x2000 = 0x2000 +} CAR_PHYSICS_BITMASK; + +struct PedGroup { + undefined undefinedFields[52]; + byte membersCount; + byte field_0x35; + byte field_0x36; +}; + struct CarDoor { byte animationFrame; byte field_0x1; /* equal to 3 on start */ @@ -731,7 +788,7 @@ struct Car { undefined field_0x73; short carDamage; short field_0x76; - ushort bitMask; + short physicsBitmask; undefined field_0x7a; undefined field_0x7b; uint field_0x7c; @@ -741,7 +798,7 @@ struct Car { undefined field_0x83; enum CAR_MODEL4 carModel; uint mask; - byte fireRelated; + byte fireState; byte field_0x8d; byte alarmTimer; /* 0x8e */ undefined field_0x8f; @@ -866,7 +923,7 @@ struct GameObject { uint relToId; //0x10 int id; OBJECT_TYPE type; - struct PlayerPhysics * probablyPhysics; + struct CameraOrPhysics * probablyPhysics; undefined field_0x20; undefined field_0x21; undefined field_0x22; @@ -993,69 +1050,48 @@ struct WEAPON_STRUCT { undefined field_0x2f; }; -struct PlayerPhysics { +struct CameraPos { SCR_f x; SCR_f y; - SCR_f z; /* camera z offset */ - struct GameObject * gameObject; - SCR_f x2; - SCR_f y2; - SCR_f z2; - struct GameObject * gameObject2; - undefined field_0x20; - undefined field_0x21; - undefined field_0x22; - undefined field_0x23; - undefined field_0x24; - undefined field_0x25; - undefined field_0x26; - undefined field_0x27; - undefined field_0x28; - undefined field_0x29; - undefined field_0x2a; - undefined field_0x2b; - undefined field_0x2c; - undefined field_0x2d; - undefined field_0x2e; - undefined field_0x2f; + SCR_f z; + int zoom; +}; + +struct WorldRect { + SCR_f left; + SCR_f right; + SCR_f top; + SCR_f bottom; +}; + +struct CameraOrPhysics { + CameraPos cameraPosTarget2; + CameraPos cameraPosTarget; + WorldRect cameraBoundaries; enum PLAYER_PHYSICS_MOVEMENT movementBitmask; struct Ped * ped; undefined4 field_0x38; - enum PLAYER_PHYSICS_STATE2 state2; - u4 relToTime; - u4 fly_car; - void * field_0x48; - byte accurcy; - undefined field_0x4d; - undefined field_0x4e; - undefined field_0x4f; - undefined4 field_0x50; - undefined4 field_0x54; - undefined4 field_0x58; - undefined4 field_0x5c; - uint field_0x60; - uint field_0x64; - uint field_0x68; - uint field_0x6c; - uint field_0x70; - uint field_0x74; - SCR_f leftOfTheScreenX; /* Created by retype action */ - SCR_f rightOfTheScreenX; /* Created by retype action */ - SCR_f topOfTheScreenY; /* Created by retype action */ - SCR_f bottomOfTheSceenY; /* Created by retype action */ - SCR_f xx; - SCR_f yy; - SCR_f zz; - undefined4 field_0x94; - SCR_f encodedCameraOrTeleportX; - SCR_f encodedCameraOrTeleportY; - SCR_f encodedCameraOrTeleportZ; - undefined4 field_0xa4; - undefined4 field_0xa8; - SCR_f xCameraVelocity; - SCR_f yCameraVelocity; - undefined4 cameraHeadVelocity; /* changed when driving car */ - SCR_f field_0xb8; + int followedPedID; + int targetElevation; + int flyTimerMaybe; + SCR_f altMovingPosX; + SCR_f altMovingPosY; + SCR_f altMovingStateUp; + SCR_f altMovingStateDown; + SCR_f altMovingStateLeft; + SCR_f altMovingStateRight; + uint altMovingArrowsRelated; + undefined2 field_0x64; + short altMovingLimit; + int screenPxWidth; + int screenPxHeight; + int screenPxCenterX; + int screenPxCenter; + WorldRect cameraBoundariesNonNegative; + CameraPos cameraPos2; + CameraPos cameraPos; + int uiScale; + CameraPos cameraVelocity; }; struct CarManager4_S1 { @@ -1423,7 +1459,7 @@ struct Ped { int field_0x158; struct WEAPON_PLAYER_LIST * playerWeapons; struct Ped * nextPed; - struct Ped * ElvisOrTarget; /* Created by retype action */ + PedGroup * group; struct GameObject * gameObject; struct Car * currentCar; struct WEAPON_STRUCT * selectedWeapon; @@ -1472,9 +1508,9 @@ struct Ped { undefined2 eq_100; undefined2 field_0x214; short health; - ushort timerToAction; /* will be decrement each game tick, when its 0 then ocupation action is done. Fo example: steal a car */ + ushort objectiveTimer; /* will be decrement each game tick, when its 0 then objective is done. For example: steal a car */ short field_0x21a; - enum PED_BIT_STATE bitStateInvisOnFireEtc; /* invisibilty, electrofingers on fire and more */ + enum PED_BIT_STATE bitState; /* invisibilty, electrofingers on fire and more */ undefined4 field_0x220; byte field_0x224; byte relatedToTimerToAction; @@ -1495,7 +1531,7 @@ struct Ped { undefined field_0x23d; undefined field_0x23e; undefined field_0x23f; - enum OCUPATION occupation; + enum PED_OCUPATION occupation; enum PED_REMAP remap; undefined field_0x245; undefined field_0x246; @@ -1510,7 +1546,7 @@ struct Ped { undefined field_0x255; undefined field_0x256; undefined field_0x257; - enum PED_STATE3 state3; + enum PED_OBJECTIVE objective; int field_0x25c; byte field_0x260; byte field_0x261; @@ -1527,12 +1563,12 @@ struct Ped { enum PED_REMAP2 remap2; int field_0x270; enum CAR_MODEL4 gangCarModel; - enum PED_STATE state; - enum PED_STATE2 state2; + enum PED_STATE state; // 0x278 + enum PED_STATE2 state2; // 0x27c enum PED_STATE state1_2; /* 0 on start, 3 when getting to a car */ enum PED_STATE2 state2_2; - int shootingSkillMaybe; - PED_GUARD_MODE guardMode; + PED_THREAT_SEARCH threatSearch; // 0x288 + PED_THREAT_REACTION threatReaction; // 0x28c int relToMultiplayer; }; @@ -2505,10 +2541,10 @@ struct Player { /* Player actually */ undefined field_0x8d; undefined1 field_0x8e; byte field_0x8f; - struct PlayerPhysics ph1; /* player ped related */ - struct PlayerPhysics ph2; /* camera related, for example teleport use this struct */ - struct PlayerPhysics ph3; - struct PlayerPhysics * ph4; + struct CameraOrPhysics ph1; /* player ped related */ + struct CameraOrPhysics ph2; /* camera related, for example teleport use this struct */ + struct CameraOrPhysics ph3; + struct CameraOrPhysics * ph4; struct Ped * ped2; void * field_0x2cc; byte field_0x2d0; @@ -3401,8 +3437,7 @@ struct Player { /* Player actually */ undefined field_0x6f7; undefined field_0x6f8; undefined field_0x6f9; - undefined field_0x6fa; - undefined field_0x6fb; + short armor; short field_0x6fc; undefined field_0x6fe; undefined field_0x6ff; @@ -7371,13 +7406,13 @@ struct S7 { undefined field_0x286; undefined field_0x287; undefined field_0x288; - undefined field_0x289; + undefined field_0x289; undefined field_0x28a; - undefined field_0x28b; - undefined guardMode; - undefined field_0x28d; + undefined field_0x28b; + undefined field_0x28c; + undefined field_0x28d; undefined field_0x28e; - undefined field_0x28f; + undefined field_0x28f; undefined field_0x290; undefined field_0x291; undefined field_0x292; diff --git a/gta2dll.rc b/gta2dll.rc index 003b81f..8e67727 100644 Binary files a/gta2dll.rc and b/gta2dll.rc differ diff --git a/gta2dll.sln b/gta2dll.sln index bc5ded0..c18b0c6 100644 --- a/gta2dll.sln +++ b/gta2dll.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29009.5 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34408.163 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gta2dll", "gta2dll.vcxproj", "{66D62660-92F5-439C-AA73-1E1478DA31F5}" EndProject diff --git a/gta2dll.vcxproj b/gta2dll.vcxproj index 367a505..72f126a 100644 --- a/gta2dll.vcxproj +++ b/gta2dll.vcxproj @@ -208,6 +208,8 @@ + + @@ -249,6 +251,8 @@ + + diff --git a/gta2dll.vcxproj.filters b/gta2dll.vcxproj.filters index 86d1e25..4b61a59 100644 --- a/gta2dll.vcxproj.filters +++ b/gta2dll.vcxproj.filters @@ -48,6 +48,12 @@ Source Files + + Source Files + + + Source Files + @@ -103,6 +109,12 @@ Header Files + + Header Files + + + Header Files + diff --git a/resource.h b/resource.h index 92cfcdd..2398125 100644 --- a/resource.h +++ b/resource.h @@ -26,7 +26,7 @@ #define IDC_CARFIX 3021 #define IDC_CARVISFIX 3022 #define IDC_CARDAMAGE 3023 -#define IDC_LOCKCARDAMAGE 3024 +#define IDC_PREMAP_S 3024 #define IDC_CARID 3025 #define IDC_CARLASTTP 3027 #define IDC_CARVIS 3028 @@ -50,27 +50,26 @@ #define IDC_GANG3Z 3047 #define IDC_GANG3P 3048 #define IDC_CARVISBRK 3049 +#define IDC_MOUSECTRL 3050 +#define IDC_PASSENGER 3051 #define IDC_CARCOLM 3052 #define IDC_CARCOLP 3053 #define IDC_CARCOLV 3054 #define IDC_CARCOLR 3055 #define IDC_GOSLOW 3056 -#define IDC_PEDSHAPEM 3057 -#define IDC_PEDSHAPEP 3058 -#define IDC_PEDSHAPEV 3059 -#define IDC_PEDCLOTHM 3060 -#define IDC_PEDCLOTHP 3061 -#define IDC_PEDCLOTHV 3062 +#define IDC_PREMAP_R 3057 +#define IDC_CARDUMMY 3058 #define IDC_BIGTEXTTEXT 3063 #define IDC_BIGTEXTSHOW 3064 #define IDC_CARTRCOLR 3065 #define IDC_PEDSHAPECLOTHR 3066 -#define IDC_SPRUN 3067 -#define IDC_SPWLK 3068 -#define IDC_SPSTD 3069 -#define IDC_SPSET 3070 -#define IDC_MOUSECTRL 3071 -#define IDC_PASSENGER 3072 +#define IDC_CARINVALL 3067 +#define IDC_CARINVBUL 3068 +#define IDC_CARINVFLM 3069 +#define IDC_CARINVRKT 3070 +#define IDC_CARINVCOL 3071 +#define IDC_CARNOCOL 3072 +#define IDC_PREMAP_DEF 3073 #define IDC_CARINFO 3074 #define IDC_DOOR1 3075 #define IDC_DOOR2 3076 @@ -80,11 +79,10 @@ #define IDC_EMBP 3080 #define IDC_EMBM 3081 #define IDC_EMBPOS 3082 -#define IDC_EDIT1 3083 -#define IDC_CAREXPLODE 3086 -#define IDC_BANNER 3087 -#define IDB_BANNER 3088 -#define IDC_TPPLAYER 3089 +#define IDC_CAREXPLODE 3083 +#define IDC_BANNER 3084 +#define IDB_BANNER 3085 +#define IDC_EDIT1 3086 #define IDD_ACS 4000 #define IDC_ACS_SPAWN 4001 #define IDC_ACS_X 4002 @@ -125,21 +123,43 @@ #define IDC_PS_WEAP 5010 #define IDC_PS_HEALTH 5011 #define IDC_PS_OCCUP 5012 -#define IDC_PS_AI0 5013 -#define IDC_PS_AI1 5014 -#define IDC_PS_AI2 5015 -#define IDC_PS_AI3 5016 -#define IDC_PS_AI4 5017 -#define IDC_PS_AI5 5018 -#define IDC_PS_AI6 5019 -#define IDC_PS_AI7 5020 -#define IDC_PS_AI8 5021 -#define IDC_PS_AI9 5022 -#define IDC_PS_AI10 5023 -#define IDC_PS_AI11 5024 -#define IDC_PS_AI12 5025 -#define IDC_PS_AI13 5026 -#define IDC_PS_AI14 5027 +#define IDC_PS_THR_S 5013 +#define IDC_PS_THR_R 5014 +#define IDC_PS_AI0 5015 +#define IDC_PS_AI1 5016 +#define IDC_PS_AI2 5017 +#define IDC_PS_AI3 5018 +#define IDC_PS_AI4 5019 +#define IDC_PS_AI5 5020 +#define IDC_PS_AI6 5021 +#define IDC_PS_AI7 5022 +#define IDC_PS_AI8 5023 +#define IDC_PS_AI9 5024 +#define IDC_PS_AI10 5025 +#define IDC_PS_AI11 5026 +#define IDC_PS_AI12 5027 +#define IDC_PS_AI13 5028 +#define IDC_PS_AI14 5029 +#define IDC_PS_LEADER 5030 +#define IDD_CAM 6000 +#define IDC_CAM_X 6001 +#define IDC_CAM_Y 6002 +#define IDC_CAM_Z 6003 +#define IDC_CAM_ZOOM 6004 +#define IDC_CAM_SYNC 6005 +#define IDC_CAM_TP 6006 +#define IDC_CAM_FPED 6007 +#define IDC_CAM_FPL 6008 +#define IDC_CAM_ZL 6009 +#define IDC_CAM_ZOOML 6010 +#define IDC_CAM_TARL 6011 +#define IDC_CAM_UP 6012 +#define IDC_CAM_DOWN 6013 +#define IDC_CAM_LEFT 6014 +#define IDC_CAM_RIGHT 6015 +#define IDC_CAM_ZUP 6016 +#define IDC_CAM_ZDOWN 6017 +#define IDC_CAM_SEN 6018 #define ID_COMMANDS_HELLO 32000 #define ID_COMMANDS_TANK 32001 #define ID_COMMANDS_GUNJEEP 32002 @@ -148,6 +168,7 @@ #define ID_COMMANDS_TPALLPEDS 32005 #define ID_COMMANDS_LIVETABLE 32006 #define ID_COMMANDS_GT24640 32007 +#define ID_COMMANDS_CAMERA 32008 #define ID_SPAWNCAR 35000 #define ID_SPAWNCAR_LAST 35001 #define ID_SPAWNCAR_ARRAY 35002 @@ -171,9 +192,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 3018 -#define _APS_NEXT_COMMAND_VALUE 32808 -#define _APS_NEXT_CONTROL_VALUE 3120 +#define _APS_NEXT_RESOURCE_VALUE 3019 +#define _APS_NEXT_COMMAND_VALUE 32810 +#define _APS_NEXT_CONTROL_VALUE 3133 #define _APS_NEXT_SYMED_VALUE 3000 #endif #endif