├── .github └── FUNDING.yml ├── .gitignore ├── Documentation ├── Config.md ├── ConsoleUI.md ├── Developer │ ├── ClassesIndex.md │ ├── GTAIV-Classes │ │ ├── IVAchievements.md │ │ └── IVAnimManager.md │ ├── Getting-Started-with-Plugins.md │ ├── Getting-Started-with-Scripts.md │ ├── IVSDKDotNet-Classes │ │ ├── Attributes.md │ │ └── SettingsFile.md │ ├── Images │ │ ├── PublicFieldsUI.png │ │ ├── ScriptConfigFileBuildAction.png │ │ └── ScriptConfigFilePlacement.png │ ├── Public-Fields-Window.md │ └── ScriptConfig.md ├── FAQ.md ├── Home.md ├── Images │ ├── ConsoleUI.png │ ├── IVSDKDotNetSocialPreview.png │ └── ManagerUI.png ├── Installation.md └── ManagerUI.md ├── IVSDKDotNet.sln ├── IVSDKDotNet ├── AdvancedPatcher.h ├── Hooking.Patterns.h ├── Hooking.Patterns_DBG.lib ├── Hooking.Patterns_REL.lib ├── INI.h ├── IVSDK │ ├── CAERadioTrackManager.h │ ├── CAchievements.h │ ├── CAnimManager.h │ ├── CAudioZones.h │ ├── CBaseDC.h │ ├── CBuilding.h │ ├── CCam.h │ ├── CCamera.h │ ├── CCheat.h │ ├── CClock.h │ ├── CCustomShaderEffectBase.h │ ├── CCutsceneMgr.h │ ├── CDraw.h │ ├── CDrawCurvedWindowDC.h │ ├── CDrawRadioHudTextDC.h │ ├── CDrawRectDC.h │ ├── CDrawSpriteDC.h │ ├── CDrawSpriteUVDC.h │ ├── CDynamicEntity.h │ ├── CEntity.h │ ├── CEpisodes.h │ ├── CExplosion.h │ ├── CFileLoader.h │ ├── CFileMgr.h │ ├── CFont.h │ ├── CFrontEnd.h │ ├── CGame.h │ ├── CGameConfigReader.h │ ├── CGameLogic.h │ ├── CGangs.h │ ├── CGarage.h │ ├── CGenericGameStorage.h │ ├── CHudColours.h │ ├── CInteriorInst.h │ ├── CIplStore.h │ ├── CMatrix.h │ ├── CMenuManager.h │ ├── CModelInfo.h │ ├── CNetwork.h │ ├── CObject.h │ ├── CPad.h │ ├── CPed.h │ ├── CPedFactoryNY.h │ ├── CPedType.h │ ├── CPhysical.h │ ├── CPickups.h │ ├── CPlayerInfo.h │ ├── CPool.h │ ├── CPools.h │ ├── CPopulation.h │ ├── CProjectileInfo.h │ ├── CQuadTreeNode.h │ ├── CQuaternion.h │ ├── CRGBA.h │ ├── CRadar.h │ ├── CRect.h │ ├── CRenderPhase.h │ ├── CReplay.h │ ├── CRestart.h │ ├── CShaderLib.h │ ├── CShadows.h │ ├── CSimpleTransform.h │ ├── CSprite2d.h │ ├── CStats.h │ ├── CStore.h │ ├── CStreaming.h │ ├── CStuntJumpManager.h │ ├── CTask.h │ ├── CTaskComplexClimbLadder.h │ ├── CTaskComplexDie.h │ ├── CTaskComplexInWater.h │ ├── CTaskComplexMobileMakeCall.h │ ├── CTaskComplexNM.h │ ├── CTaskComplexNewGetInVehicle.h │ ├── CTaskComplexPlayerOnFoot.h │ ├── CTaskComplexPlayerSettingsTask.h │ ├── CTaskComplexWander.h │ ├── CTaskSimpleNMHighFall.h │ ├── CTaskSimpleNMJumpRollFromRoadVehicle.h │ ├── CTaskSimpleSidewaysDive.h │ ├── CText.h │ ├── CTheScripts.h │ ├── CTheZones.h │ ├── CTimeCycle.h │ ├── CTimer.h │ ├── CTxdStore.h │ ├── CVector.h │ ├── CVector2D.h │ ├── CVector4.h │ ├── CVehicle.h │ ├── CVehicleFactoryNY.h │ ├── CVisibilityPlugins.h │ ├── CWanted.h │ ├── CWeaponInfo.h │ ├── CWeather.h │ ├── CWorld.h │ ├── C_PcSave.h │ ├── CdStream.h │ ├── Hooks.h │ ├── IVSDK.cpp │ ├── IVSDK.h │ ├── NewAddressSet.h │ ├── SkyDome.h │ ├── audEngine.h │ ├── audRadioAudioEntity.h │ ├── cHandlingDataMgr.h │ ├── commit.txt │ ├── eHudColour.h │ ├── ePadControls.h │ ├── eRadarSprite.h │ ├── eVehiclePart.h │ ├── fiDevice.h │ ├── fiPackfile.h │ ├── grcTexture.h │ ├── grcTextureFactory.h │ ├── grcWindow.h │ ├── injector │ │ ├── assembly.hpp │ │ ├── calling.hpp │ │ ├── gvm │ │ │ ├── gvm.hpp │ │ │ └── translator.hpp │ │ ├── hooking.hpp │ │ ├── injector.hpp │ │ └── utility.hpp │ ├── pgDictionary.h │ ├── phBound.h │ ├── phConstrainedCollider.h │ ├── phInstGta.h │ └── rage.h ├── IVSDKDotNet.vcxproj ├── IVSDKDotNet.vcxproj.filters ├── IVSDKDotNet.vcxproj.user ├── Memory Offset Config Files │ ├── IVSDK │ │ ├── 1070.ini │ │ ├── 1080.ini │ │ └── README.txt │ └── README.md └── dllmain.cpp ├── IVSDKDotNetWrapper ├── AssemblyInfo.cpp ├── Attributes.h ├── CClock.cpp ├── CLRBridge.cpp ├── CLRBridge.h ├── CQuaternion.cpp ├── CQuaternion.h ├── DXHook.h ├── DirectInputHook.h ├── EventArgs.cpp ├── EventArgs.h ├── Exceptions.h ├── GameHooks.cpp ├── GameHooks.h ├── Helper.cpp ├── Helper.h ├── IVAchievements.cpp ├── IVAchievements.h ├── IVAnimManager.cpp ├── IVAnimManager.h ├── IVAudConfig.cpp ├── IVAudConfig.h ├── IVAudEngine.cpp ├── IVAudEngine.h ├── IVAudRadioAudioEntity.cpp ├── IVAudRadioAudioEntity.h ├── IVAudioZones.cpp ├── IVAudioZones.h ├── IVBaseDC.cpp ├── IVBaseDC.h ├── IVBaseModelInfo.cpp ├── IVBaseModelInfo.h ├── IVBoundBox.cpp ├── IVBoundBox.h ├── IVBuilding.cpp ├── IVBuilding.h ├── IVCDStream.cpp ├── IVCDStream.h ├── IVCam.cpp ├── IVCam.h ├── IVCamFollowVehicle.cpp ├── IVCamFollowVehicle.h ├── IVCamera.cpp ├── IVCamera.h ├── IVCheat.cpp ├── IVCheat.h ├── IVClock.cpp ├── IVClock.h ├── IVControlRemapInfo.cpp ├── IVControlRemapInfo.h ├── IVControlledByInfo.cpp ├── IVControlledByInfo.h ├── IVCrSkeleton.cpp ├── IVCrSkeleton.h ├── IVCrSkeletonData.cpp ├── IVCrSkeletonData.h ├── IVCustomShaderEffectBase.cpp ├── IVCustomShaderEffectBase.h ├── IVCustomShaderEffectPedBoneDamageFX.cpp ├── IVCustomShaderEffectPedBoneDamageFX.h ├── IVCustomShaderEffectVehicleFX.cpp ├── IVCustomShaderEffectVehicleFX.h ├── IVCutsceneMgr.cpp ├── IVCutsceneMgr.h ├── IVDraw.cpp ├── IVDraw.h ├── IVDrawCurvedWindowDC.cpp ├── IVDrawCurvedWindowDC.h ├── IVDrawRadioHudTextDC.cpp ├── IVDrawRadioHudTextDC.h ├── IVDrawRectDC.cpp ├── IVDrawRectDC.h ├── IVDynamicEntity.cpp ├── IVDynamicEntity.h ├── IVEntity.cpp ├── IVEntity.h ├── IVEpisodes.cpp ├── IVEpisodes.h ├── IVExplosion.cpp ├── IVExplosion.h ├── IVFiDevice.cpp ├── IVFiDevice.h ├── IVFiPackfile.cpp ├── IVFiPackfile.h ├── IVFileLoader.cpp ├── IVFileLoader.h ├── IVFileMgr.cpp ├── IVFileMgr.h ├── IVFont.cpp ├── IVFont.h ├── IVFrontEnd.cpp ├── IVFrontEnd.h ├── IVGame.cpp ├── IVGame.h ├── IVGameConfigReader.cpp ├── IVGameConfigReader.h ├── IVGameLogic.cpp ├── IVGameLogic.h ├── IVGangInfo.cpp ├── IVGangInfo.h ├── IVGangs.cpp ├── IVGangs.h ├── IVGarage.cpp ├── IVGarage.h ├── IVGarages.cpp ├── IVGarages.h ├── IVGenericGameStorage.cpp ├── IVGenericGameStorage.h ├── IVGlobalScene.cpp ├── IVGlobalScene.h ├── IVGrcTexture.cpp ├── IVGrcTexture.h ├── IVGrcTextureFactory.cpp ├── IVGrcTextureFactory.h ├── IVGrcWindow.cpp ├── IVGrcWindow.h ├── IVGtaFragType.cpp ├── IVGtaFragType.h ├── IVHandlingData.cpp ├── IVHandlingData.h ├── IVHandlingDataMgr.cpp ├── IVHandlingDataMgr.h ├── IVHudColours.cpp ├── IVHudColours.h ├── IVInteriorInst.cpp ├── IVInteriorInst.h ├── IVIplStore.cpp ├── IVIplStore.h ├── IVLineOfSightResults.cpp ├── IVLineOfSightResults.h ├── IVMatrix.h ├── IVMenuManager.cpp ├── IVMenuManager.h ├── IVModelInfo.cpp ├── IVModelInfo.h ├── IVNetwork.cpp ├── IVNetwork.h ├── IVObject.cpp ├── IVObject.h ├── IVPad.cpp ├── IVPad.h ├── IVPadValues.cpp ├── IVPadValues.h ├── IVPcSave.cpp ├── IVPcSave.h ├── IVPed.cpp ├── IVPed.h ├── IVPedComponentModels.cpp ├── IVPedComponentModels.h ├── IVPedDrawableInfo.cpp ├── IVPedDrawableInfo.h ├── IVPedFactoryNY.cpp ├── IVPedFactoryNY.h ├── IVPedIntelligence.cpp ├── IVPedIntelligence.h ├── IVPedIntelligenceNY.cpp ├── IVPedIntelligenceNY.h ├── IVPedModelInfo.cpp ├── IVPedModelInfo.h ├── IVPedMoveBlendOnFoot.cpp ├── IVPedMoveBlendOnFoot.h ├── IVPedTasks.cpp ├── IVPedTasks.h ├── IVPedType.cpp ├── IVPedType.h ├── IVPedWeaponSlot.cpp ├── IVPedWeaponSlot.h ├── IVPedWeapons.cpp ├── IVPedWeapons.h ├── IVPhArchetypeGta.cpp ├── IVPhArchetypeGta.h ├── IVPhBound.cpp ├── IVPhBound.h ├── IVPhConstrainedCollider.cpp ├── IVPhConstrainedCollider.h ├── IVPhInst.cpp ├── IVPhInst.h ├── IVPhInstGta.cpp ├── IVPhInstGta.h ├── IVPhSleep.cpp ├── IVPhSleep.h ├── IVPhoneInfo.cpp ├── IVPhoneInfo.h ├── IVPhysical.cpp ├── IVPhysical.h ├── IVPickups.cpp ├── IVPickups.h ├── IVPlayerInfo.cpp ├── IVPlayerInfo.h ├── IVPool.cpp ├── IVPool.h ├── IVPools.cpp ├── IVPools.h ├── IVPopulation.cpp ├── IVPopulation.h ├── IVProjectileInfo.cpp ├── IVProjectileInfo.h ├── IVQuadTreeNode.cpp ├── IVQuadTreeNode.h ├── IVRadar.cpp ├── IVRadar.h ├── IVRadioStation.cpp ├── IVRadioStation.h ├── IVRadioTrackManager.cpp ├── IVRadioTrackManager.h ├── IVRenderPhases.cpp ├── IVRenderPhases.h ├── IVReplay.cpp ├── IVReplay.h ├── IVRestart.cpp ├── IVRestart.h ├── IVRmcDrawable.cpp ├── IVRmcDrawable.h ├── IVSDKDotNetWrapper.vcxproj ├── IVSDKDotNetWrapper.vcxproj.filters ├── IVSDKDotNetWrapper.vcxproj.user ├── IVSafehouse.cpp ├── IVSafehouse.h ├── IVSaveGarage.cpp ├── IVSaveGarage.h ├── IVShaderLib.cpp ├── IVShaderLib.h ├── IVShadows.cpp ├── IVShadows.h ├── IVSkyDome.cpp ├── IVSkyDome.h ├── IVSkyhatMiniNoise.cpp ├── IVSkyhatMiniNoise.h ├── IVSprite2D.cpp ├── IVSprite2D.h ├── IVStats.cpp ├── IVStats.h ├── IVStore.cpp ├── IVStore.h ├── IVStoredCar.cpp ├── IVStoredCar.h ├── IVStreaming.cpp ├── IVStreaming.h ├── IVStuntJump.cpp ├── IVStuntJump.h ├── IVStuntJumpManager.cpp ├── IVStuntJumpManager.h ├── IVTask.cpp ├── IVTask.h ├── IVTaskComplexClimbLadder.cpp ├── IVTaskComplexClimbLadder.h ├── IVTaskComplexDie.cpp ├── IVTaskComplexDie.h ├── IVTaskComplexInWater.cpp ├── IVTaskComplexInWater.h ├── IVTaskComplexMobileMakeCall.cpp ├── IVTaskComplexMobileMakeCall.h ├── IVTaskComplexNM.cpp ├── IVTaskComplexNM.h ├── IVTaskComplexNewGetInVehicle.cpp ├── IVTaskComplexNewGetInVehicle.h ├── IVTaskComplexPlayerOnFoot.cpp ├── IVTaskComplexPlayerOnFoot.h ├── IVTaskComplexPlayerSettingsTask.cpp ├── IVTaskComplexPlayerSettingsTask.h ├── IVTaskComplexWander.cpp ├── IVTaskComplexWander.h ├── IVTaskComplexWanderStandard.cpp ├── IVTaskComplexWanderStandard.h ├── IVTaskSimpleNMHighFall.cpp ├── IVTaskSimpleNMHighFall.h ├── IVTaskSimpleNMJumpRollFromRoadVehicle.cpp ├── IVTaskSimpleNMJumpRollFromRoadVehicle.h ├── IVTaskSimpleSidewaysDive.cpp ├── IVTaskSimpleSidewaysDive.h ├── IVText.cpp ├── IVText.h ├── IVTheScripts.cpp ├── IVTheScripts.h ├── IVTheZones.cpp ├── IVTheZones.h ├── IVTimeCycle.cpp ├── IVTimeCycle.h ├── IVTimer.cpp ├── IVTimer.h ├── IVTxdStore.cpp ├── IVTxdStore.h ├── IVUnkColliderParams.cpp ├── IVUnkColliderParams.h ├── IVValueHistory.cpp ├── IVValueHistory.h ├── IVValueHistoryItem.cpp ├── IVValueHistoryItem.h ├── IVVehicle.cpp ├── IVVehicle.h ├── IVVehicleDoor.cpp ├── IVVehicleDoor.h ├── IVVehicleFactoryNY.cpp ├── IVVehicleFactoryNY.h ├── IVVehicleModelInfo.cpp ├── IVVehicleModelInfo.h ├── IVVehicleStructure.cpp ├── IVVehicleStructure.h ├── IVVehicleWheel.cpp ├── IVVehicleWheel.h ├── IVViewport.cpp ├── IVViewport.h ├── IVViewportData.cpp ├── IVViewportData.h ├── IVVisibilityPlugins.cpp ├── IVVisibilityPlugins.h ├── IVWanted.cpp ├── IVWanted.h ├── IVWeaponInfo.cpp ├── IVWeaponInfo.h ├── IVWeather.cpp ├── IVWeather.h ├── IVWorld.cpp ├── IVWorld.h ├── IVZone.cpp ├── IVZone.h ├── ImGui │ ├── ImGuiIncludes.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_extensions.cpp │ ├── imgui_extensions.h │ ├── imgui_hex.cpp │ ├── imgui_hex.h │ ├── imgui_impl_dx9_shader.cpp │ ├── imgui_impl_dx9_shader.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── imgui_internal.h │ ├── imgui_knobs.cpp │ ├── imgui_knobs.h │ ├── imgui_stdlib.cpp │ ├── imgui_stdlib.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imspinner.h │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ └── imstb_truetype.h ├── ImGuiIV.cpp ├── ImGuiIV.h ├── ImGuiStuff.h ├── KeyWatchDog.cpp ├── KeyWatchDog.h ├── LICENSE.txt ├── Logger.cpp ├── Logger.h ├── ManagedD3D9.cpp ├── ManagedD3D9.h ├── ManagedMinHook.cpp ├── ManagedMinHook.h ├── ManagerStuff.h ├── MemoryAccess.cpp ├── MemoryAccess.h ├── MinHook.h ├── Native.h ├── NativeArg.h ├── NativeFunction.cpp ├── NativeFunction.h ├── NativeHashes.h ├── NativeHooks.cpp ├── NativeHooks.h ├── NativeInvoke.h ├── Patterns.cpp ├── Patterns.h ├── Scripts.cpp ├── Scripts.h ├── SettingsFile.cpp ├── SettingsFile.h ├── TlsHelper.cpp ├── TlsHelper.h ├── UnsafeMemory.h ├── XInputHook.h ├── app.aps ├── app.ico ├── app.rc ├── defines.h ├── enums.h ├── libMinHook-x86-v141-mt.lib ├── libMinHook.x86_DBG.lib ├── libMinHook.x86_REL.lib ├── pch.cpp ├── pch.h ├── rage.cpp ├── rage.h ├── resource.h └── typedefs.h ├── LICENSE ├── Manager ├── Classes │ ├── AdvancedTask.cs │ ├── Attributes │ │ ├── LocalCommandDescAttribute.cs │ │ ├── LocalCommandNameAttribute.cs │ │ ├── LocalCommandOptionsAttribute.cs │ │ └── LocalCommandSuggestionsAttribute.cs │ ├── BoundPhoneNumber.cs │ ├── Config.cs │ ├── DelayedAction.cs │ ├── FoundPlugin.cs │ ├── ImPopup.cs │ ├── Json │ │ ├── IVPresenceInfo.cs │ │ ├── IVSessionInfo.cs │ │ ├── JsonHelper.cs │ │ ├── ManagerApiPreferences.cs │ │ ├── NativeCallContext.cs │ │ ├── NativeCallResult.cs │ │ ├── RunningScriptInfo.cs │ │ └── Script │ │ │ ├── ScriptConfig.cs │ │ │ └── ScriptDependencyInfo.cs │ ├── KeyChecker.cs │ ├── LocalConsoleCommand.cs │ ├── ManagedNativeCaller.cs │ ├── Reflection.cs │ ├── ScriptHookDotNet │ │ └── CachedEntity.cs │ ├── Scripts │ │ ├── FoundScript.cs │ │ └── ScriptFileInfo.cs │ ├── Secrittzzz.cs │ ├── Tasks │ │ ├── CustomTask.cs │ │ └── MainThreadTaskScheduler.cs │ ├── Threading │ │ ├── Dispatcher.cs │ │ ├── GenericThread.cs │ │ ├── NetThread.cs │ │ ├── ScriptThread.cs │ │ └── ThreadData.cs │ └── UpdateChecker.cs ├── Enums.cs ├── Extensions │ └── IntPtrExtensions.cs ├── Helper.cs ├── Main.cs ├── Manager.csproj ├── Manager.csproj.user ├── Managers │ ├── DelayedActionManager.cs │ ├── FileCacheManager.cs │ ├── MinHookManager.cs │ ├── PluginManager.cs │ ├── RemoteConnectionManager.cs │ ├── SHDNContentCacheManager.cs │ ├── SHDNManager.cs │ ├── ScriptManager.cs │ ├── TaskManager.cs │ └── ThreadManager.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ └── ivsdkdotnet_logo_small.bin ├── Riptide │ ├── Client.cs │ ├── Connection.cs │ ├── EventArgs.cs │ ├── Exceptions.cs │ ├── IMessageSerializable.cs │ ├── Message.cs │ ├── MessageHandlerAttribute.cs │ ├── MessageRelayFilter.cs │ ├── Peer.cs │ ├── PendingMessage.cs │ ├── Server.cs │ ├── Transports │ │ ├── EventArgs.cs │ │ ├── IClient.cs │ │ ├── IPeer.cs │ │ ├── IServer.cs │ │ ├── Tcp │ │ │ ├── TcpClient.cs │ │ │ ├── TcpConnection.cs │ │ │ ├── TcpPeer.cs │ │ │ └── TcpServer.cs │ │ └── Udp │ │ │ ├── UdpClient.cs │ │ │ ├── UdpConnection.cs │ │ │ ├── UdpPeer.cs │ │ │ └── UdpServer.cs │ ├── Utils │ │ ├── Converter.cs │ │ ├── DelayedEvents.cs │ │ ├── Extensions.cs │ │ ├── Helper.cs │ │ ├── PriorityQueue.cs │ │ └── RiptideLogger.cs │ └── version.txt ├── UI │ ├── ConsoleUI.cs │ ├── ManagerUI.cs │ ├── NotificationUI.cs │ └── UIStyles.cs └── packages.config ├── README.md ├── TestPlugin ├── Main.cs ├── Properties │ └── AssemblyInfo.cs └── TestPlugin.csproj └── TestScript ├── Consts.cs ├── LightHelper.cs ├── ListExtensions.cs ├── Main.cs ├── PopulationManager.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs └── Resources.resx ├── Resources ├── Bck.bin ├── Pin.bin ├── arrowUp.bin ├── discordTestLogo.bin └── rpm_needle.bin ├── Savegame.cs ├── TestScript.csproj └── scriptConfig.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: itsclonkandre 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: itsclonkandre 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://paypal.me/ItsClonkAndre'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | Debug 3 | Release 4 | packages 5 | -------------------------------------------------------------------------------- /Documentation/Developer/ClassesIndex.md: -------------------------------------------------------------------------------- 1 | # GTA IV and IV-SDK .NET-specific Classes and Structs 2 | 3 | Get the most out of your scripts by learning more about GTA IV and IV-SDK .NET-specific classes and structs. 4 | ℹ️ This is gonna take a while to add all the classes here. You should check out the [Visual Studio Object Browser](https://learn.microsoft.com/en-us/visualstudio/ide/viewing-the-structure-of-code?view=vs-2022#BKMK_ObjectBrowser) instead for now. 5 | 6 | --- 7 | 8 | ## 📄 Table of Contents 9 | 10 | ### IV-SDK .NET-specific Classes/Structs 11 | - [Attributes](IVSDKDotNet-Classes/Attributes.md) 12 | - [SettingsFile](IVSDKDotNet-Classes/SettingsFile.md) 13 | 14 | ### GTA IV Classes/Structs (Usually start with the "IV" prefix) 15 | ℹ️ Note that not everything is documented yet. You can help expanding the documentation by creating a [pull request](https://github.com/ClonkAndre/IV-SDK-DotNet/pulls) with your changes! 16 | - [IVAchievements](GTAIV-Classes/IVAchievements.md) 17 | - [IVAnimManager](GTAIV-Classes/IVAnimManager.md) 18 | 19 | -------------------------------------------------------------------------------- /Documentation/Developer/GTAIV-Classes/IVAchievements.md: -------------------------------------------------------------------------------- 1 | # IVAchievements 2 | 3 | ### Definition 4 | Namespace: `IVSDKDotNet` 5 | Path: `IVSDKDotNetWrapper/IVAchievements.h` 6 | Source: [IVAchievements.h](https://github.com/ClonkAndre/IV-SDK-DotNet/blob/main/IVSDKDotNetWrapper/IVAchievements.h) 7 | 8 | ### Methods 9 |
10 | AwardAchievement - Awards an achievement with the given ID. 11 | 12 | # 13 | 14 | ### Parameters 15 | `id (int)` - **The ID of the achievement to unlock.** 16 | 17 | ### Return Value 18 | `void` 19 | 20 | # 21 | 22 |
23 | 24 |
25 | IsAchievementUnlocked - Checks if a specific award is unlocked. 26 | 27 | # 28 | 29 | ### Parameters 30 | `id (int)` - **The ID of the achievement to check for.** 31 | 32 | ### Return Value 33 | `bool` - **True if the achievement is unlocked. Otherwise, false.** 34 | 35 | # 36 | 37 |
-------------------------------------------------------------------------------- /Documentation/Developer/Images/PublicFieldsUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Developer/Images/PublicFieldsUI.png -------------------------------------------------------------------------------- /Documentation/Developer/Images/ScriptConfigFileBuildAction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Developer/Images/ScriptConfigFileBuildAction.png -------------------------------------------------------------------------------- /Documentation/Developer/Images/ScriptConfigFilePlacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Developer/Images/ScriptConfigFilePlacement.png -------------------------------------------------------------------------------- /Documentation/Images/ConsoleUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Images/ConsoleUI.png -------------------------------------------------------------------------------- /Documentation/Images/IVSDKDotNetSocialPreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Images/IVSDKDotNetSocialPreview.png -------------------------------------------------------------------------------- /Documentation/Images/ManagerUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Documentation/Images/ManagerUI.png -------------------------------------------------------------------------------- /IVSDKDotNet/Hooking.Patterns_DBG.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNet/Hooking.Patterns_DBG.lib -------------------------------------------------------------------------------- /IVSDKDotNet/Hooking.Patterns_REL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNet/Hooking.Patterns_REL.lib -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CAchievements.h: -------------------------------------------------------------------------------- 1 | class CAchievements 2 | { 3 | public: 4 | 5 | static void AwardAchievement(int id) 6 | { 7 | return ((void(__cdecl*)(int))(AddressSetter::Get("CAchievements", "AwardAchievement")))(id); 8 | } 9 | static bool IsAchievementUnlocked(int id) 10 | { 11 | return ((bool(__cdecl*)(int))(AddressSetter::Get("CAchievements", "IsAchievementUnlocked")))(id); 12 | } 13 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CAudioZones.h: -------------------------------------------------------------------------------- 1 | class CAudioZones 2 | { 3 | public: 4 | static inline auto& m_NumSpheres = AddressSetter::GetRef("CAudioZones", "m_NumSpheres"); 5 | static inline auto m_aActiveSpheres = (int32_t*)AddressSetter::Get("CAudioZones", "m_aActiveSpheres"); 6 | static inline auto& m_NumActiveSpheres = AddressSetter::GetRef("CAudioZones", "m_NumActiveSpheres"); 7 | static inline auto& m_NumBoxes = AddressSetter::GetRef("CAudioZones", "m_NumBoxes"); 8 | static inline auto m_aActiveBoxes = (int32_t*)AddressSetter::Get("CAudioZones", "m_aActiveBoxes"); 9 | static inline auto& m_NumActiveBoxes = AddressSetter::GetRef("CAudioZones", "m_NumActiveBoxes"); 10 | 11 | static void Update(bool bForceUpdate, CVector TestCoors) 12 | { 13 | ((void(__cdecl*)(bool, CVector))(AddressSetter::Get("CAudioZones", "Update")))(bForceUpdate, TestCoors); 14 | } 15 | }; 16 | auto& LastUpdateCoors = AddressSetter::GetRef("CAudioZones", "LastUpdateCoors"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CBaseDC.h: -------------------------------------------------------------------------------- 1 | class CBaseDC 2 | { 3 | public: 4 | uint8_t pad[0x8]; // 00-08 5 | void* operator new(size_t nSize, uint32_t nUnk0) 6 | { 7 | return ((CBaseDC * (__cdecl*)(size_t, uint32_t))(AddressSetter::Get("CBaseDC", "new")))(nSize, nUnk0); 8 | } 9 | void operator delete(void*, size_t, uint32_t) {}; 10 | void Add() 11 | { 12 | ((void(__thiscall*)(CBaseDC*))(AddressSetter::Get("CBaseDC", "Add")))(this); 13 | } 14 | }; 15 | VALIDATE_SIZE(CBaseDC, 0x8); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CBuilding.h: -------------------------------------------------------------------------------- 1 | class CBuilding : public CEntity 2 | { 3 | public: 4 | 5 | void ReplaceWithNewModel(int32_t index) 6 | { 7 | return ((void(__thiscall*)(CBuilding*, int32_t))(AddressSetter::Get("CBuilding", "ReplaceWithNewModel")))(this, index); 8 | } 9 | }; 10 | 11 | VALIDATE_SIZE(CBuilding, 0x70); 12 | -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CCamera.h: -------------------------------------------------------------------------------- 1 | class CCamera 2 | { 3 | public: 4 | static inline CCam*& g_pFinalCam = AddressSetter::GetRef("CCamera", "g_pFinalCam"); // CCamFinal 5 | 6 | uint8_t pad[0x4]; // 00-04 7 | CCam* m_pFinalCam; // 04-08 8 | uint8_t pad2[0x4]; // 08-0C 9 | CCam* m_pGameCam; // 0C-10 10 | CCamFollowVehicle* m_pVehicleCam; // 10-14 11 | CCam* m_pOnFootCam; // 14-18 12 | 13 | CCam* CreateCam(int type, CCam* unk, CCam* unk2) 14 | { 15 | return ((CCam*(__thiscall*)(CCamera*, int, CCam*, CCam*))(AddressSetter::Get("CCamera", "CreateCam")))(this, type, unk, unk2); 16 | } 17 | }; 18 | static CCamera& TheCamera = AddressSetter::GetRef("CCamera", "TheCamera"); 19 | 20 | VALIDATE_OFFSET(CCamera, m_pFinalCam, 0x4); 21 | VALIDATE_OFFSET(CCamera, m_pGameCam, 0xC); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CCheat.h: -------------------------------------------------------------------------------- 1 | class CCheat 2 | { 3 | public: 4 | static inline auto& m_bHasPlayerCheated = AddressSetter::GetRef("CCheat", "m_bHasPlayerCheated"); 5 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CClock.h: -------------------------------------------------------------------------------- 1 | class CClock 2 | { 3 | public: 4 | static inline uint32_t& ms_nGameClockForcedMinutes = AddressSetter::GetRef("CClock", "ms_nGameClockForcedMinutes"); 5 | static inline uint32_t& ms_nGameClockForcedHours = AddressSetter::GetRef("CClock", "ms_nGameClockForcedHours"); 6 | static inline uint32_t& CurrentDay = AddressSetter::GetRef("CClock", "CurrentDay"); 7 | static inline uint32_t& ms_nGameClockSeconds = AddressSetter::GetRef("CClock", "ms_nGameClockSeconds"); 8 | static inline uint32_t& ms_nGameClockMinutes = AddressSetter::GetRef("CClock", "ms_nGameClockMinutes"); 9 | static inline uint32_t& ms_nGameClockHours = AddressSetter::GetRef("CClock", "ms_nGameClockHours"); 10 | static inline uint32_t& ms_nGameClockDays = AddressSetter::GetRef("CClock", "ms_nGameClockDays"); 11 | static inline uint32_t& ms_nGameClockMonth = AddressSetter::GetRef("CClock", "ms_nGameClockMonth"); 12 | static inline uint32_t& ms_nMillisecondsPerGameMinute = AddressSetter::GetRef("CClock", "ms_nMillisecondsPerGameMinute"); 13 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CCustomShaderEffectBase.h: -------------------------------------------------------------------------------- 1 | class CCustomShaderEffectBase 2 | { 3 | public: 4 | void Update(CEntity* attachedEntity) 5 | { 6 | ((void(__thiscall*)(CCustomShaderEffectBase*, CEntity*))(*(void***)this)[3])(this, attachedEntity); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CCutsceneMgr.h: -------------------------------------------------------------------------------- 1 | class CCutsceneMgr 2 | { 3 | public: 4 | static inline uint32_t& ms_running = AddressSetter::GetRef("CCutsceneMgr", "ms_running"); 5 | 6 | static bool IsRunning() 7 | { 8 | return ((bool(__cdecl*)())(AddressSetter::Get("CCutsceneMgr", "IsRunning")))(); 9 | } 10 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CDrawCurvedWindowDC.h: -------------------------------------------------------------------------------- 1 | class CDrawCurvedWindowDC : public CBaseDC 2 | { 3 | public: 4 | uint8_t pad[0x14]; // 08-1C 5 | // coords are ratio of screen (0-1) 6 | // RGB is ignored, only alpha used 7 | CDrawCurvedWindowDC(CVector2D* v, float xsize, float ysize, CRGBA color) 8 | { 9 | ((void(__thiscall*)(CDrawCurvedWindowDC*, CVector2D*, float, float, CRGBA))(AddressSetter::Get("CDrawCurvedWindowDC", "CDrawCurvedWindowDC")))(this, v, xsize, ysize, color); 10 | } 11 | }; 12 | VALIDATE_SIZE(CDrawCurvedWindowDC, 0x1C); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CDrawRadioHudTextDC.h: -------------------------------------------------------------------------------- 1 | // probably more general, todo look into this later 2 | struct tRadioHudTextPos 3 | { 4 | CVector2D bl; 5 | CVector2D tl; 6 | CVector2D br; 7 | CVector2D tr; 8 | }; 9 | 10 | class CDrawRadioHudTextDC : public CBaseDC 11 | { 12 | public: 13 | CVector2D m_vVerts[4]; // 00-28 14 | CSprite2d m_sSprite; // 28-2C 15 | CRGBA m_nColor; // 2C-30 16 | // coords are ratio of screen (0-1) 17 | // same as CDrawSpriteDC but with different params? 18 | CDrawRadioHudTextDC(tRadioHudTextPos* pos, CSprite2d sprite, CRGBA color) 19 | { 20 | ((void(__thiscall*)(CDrawRadioHudTextDC*, tRadioHudTextPos*, CSprite2d, CRGBA))(AddressSetter::Get("CDrawRadioHudTextDC", "CDrawRadioHudTextDC")))(this, pos, sprite, color); 21 | } 22 | }; 23 | VALIDATE_SIZE(CDrawRadioHudTextDC, 0x30); 24 | VALIDATE_OFFSET(CDrawRadioHudTextDC, m_vVerts, 0x8); 25 | VALIDATE_OFFSET(CDrawRadioHudTextDC, m_sSprite, 0x28); 26 | VALIDATE_OFFSET(CDrawRadioHudTextDC, m_nColor, 0x2C); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CDrawRectDC.h: -------------------------------------------------------------------------------- 1 | class CDrawRectDC : public CBaseDC 2 | { 3 | public: 4 | uint8_t pad[0x14]; // 08-1C 5 | // coords are by pixel 6 | // also works in main menu 7 | CDrawRectDC(CRect* rect, CRGBA color) 8 | { 9 | ((void(__thiscall*)(CDrawRectDC*, CRect*, CRGBA))(AddressSetter::Get("CDrawRectDC", "CDrawRectDC")))(this, rect, color); 10 | } 11 | }; 12 | VALIDATE_SIZE(CDrawRectDC, 0x1C); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CDrawSpriteDC.h: -------------------------------------------------------------------------------- 1 | class CDrawSpriteDC : public CBaseDC 2 | { 3 | public: 4 | CVector2D m_vVerts[4]; // 00-28 5 | CSprite2d m_sSprite; // 28-2C 6 | CRGBA m_nColor; // 2C-30 7 | // coords are ratio of screen (0-1) 8 | CDrawSpriteDC(CVector2D* bl, CVector2D* tl, CVector2D* br, CVector2D* tr, CRGBA color, CSprite2d sprite) 9 | { 10 | ((void(__thiscall*)(CDrawSpriteDC*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CRGBA, CSprite2d))(AddressSetter::Get("CDrawSpriteDC", "CDrawSpriteDC")))(this, bl, tl, br, tr, color, sprite); 11 | } 12 | }; 13 | VALIDATE_SIZE(CDrawSpriteDC, 0x30); 14 | VALIDATE_OFFSET(CDrawSpriteDC, m_vVerts, 0x8); 15 | VALIDATE_OFFSET(CDrawSpriteDC, m_sSprite, 0x28); 16 | VALIDATE_OFFSET(CDrawSpriteDC, m_nColor, 0x2C); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CDrawSpriteUVDC.h: -------------------------------------------------------------------------------- 1 | class CDrawSpriteUVDC : public CBaseDC 2 | { 3 | public: 4 | CVector2D m_vVerts[4]; // 08-28 5 | CVector2D m_vUVVerts[4]; // 28-48 6 | CSprite2d m_sSprite; // 48-4C 7 | CRGBA m_nColor; // 4C-50 8 | // coords are ratio of screen (0-1) 9 | // first set is for position 10 | // second set is for uv multiplier? all 4 vertices 11 | // 0 1, 0 0, 1 1, 1 0 draws exactly like CDrawSpriteDC 12 | CDrawSpriteUVDC(CVector2D* bl, CVector2D* tl, CVector2D* br, CVector2D* tr, CVector2D* bl2, CVector2D* tl2, CVector2D* br2, CVector2D* tr2, CRGBA color, CSprite2d sprite) 13 | { 14 | ((void(__thiscall*)(CDrawSpriteUVDC*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CVector2D*, CRGBA, CSprite2d))(AddressSetter::Get("CDrawSpriteUVDC", "CDrawSpriteUVDC")))(this, bl, tl, br, tr, bl2, tl2, br2, tr2, color, sprite); 15 | } 16 | }; 17 | VALIDATE_SIZE(CDrawSpriteUVDC, 0x50); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CEpisodes.h: -------------------------------------------------------------------------------- 1 | class CEpisodes 2 | { 3 | public: 4 | bool IsEpisodeAvailable(int episode) 5 | { 6 | return ((bool (__thiscall*)(CEpisodes*, int))(AddressSetter::Get("CEpisodes", "IsEpisodeAvailable")))(this, episode); 7 | } 8 | }; 9 | 10 | static CEpisodes*& TheEpisodes = AddressSetter::GetRef("CEpisodes", "TheEpisodes"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CFileMgr.h: -------------------------------------------------------------------------------- 1 | class CFileMgr 2 | { 3 | public: 4 | static uint8_t* OpenFile(char* sPath, char* mode) 5 | { 6 | return ((uint8_t*(__cdecl*)(char*, char*))(AddressSetter::Get("CFileMgr", "OpenFile")))(sPath, mode); 7 | } 8 | static void CloseFile(uint8_t* file) 9 | { 10 | ((void(__cdecl*)(uint8_t*))(AddressSetter::Get("CFileMgr", "CloseFile")))(file); 11 | } 12 | // 2nd param usually 1 13 | static char* LoadLine(uint8_t* file, int unk) 14 | { 15 | return ((char*(__cdecl*)(uint8_t*, int))(AddressSetter::Get("CFileMgr", "LoadLine")))(file, unk); 16 | } 17 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CFont.h: -------------------------------------------------------------------------------- 1 | class CFont 2 | { 3 | public: 4 | static void Initialise() 5 | { 6 | ((void(__cdecl*)())(AddressSetter::Get("CFont", "Initialise")))(); 7 | } 8 | static void SetScale(float x, float y) 9 | { 10 | ((void(__cdecl*)(float, float))(AddressSetter::Get("CFont", "SetScale")))(x, y); 11 | } 12 | static void SetColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) 13 | { 14 | ((void(__cdecl*)(uint8_t, uint8_t, uint8_t, uint8_t))(AddressSetter::Get("CFont", "SetColor")))(r, g, b, a); 15 | } 16 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CFrontEnd.h: -------------------------------------------------------------------------------- 1 | class CFrontEnd 2 | { 3 | public: 4 | static inline auto& g_iUserWaypointID = AddressSetter::GetRef("CFrontEnd", "g_iUserWaypointID"); 5 | static inline auto& vMapCursor = AddressSetter::GetRef("CFrontEnd", "vMapCursor"); 6 | 7 | static void SwitchOnWaypoint(int unk_8, float x, float y, bool snapToHoveringBlip, CVector* outPos) 8 | { 9 | return ((void(__cdecl*)(int, float, float, bool, CVector*))(AddressSetter::Get("CFrontEnd", "SwitchOnWaypoint")))(unk_8, x, y, snapToHoveringBlip, outPos); 10 | } 11 | static void SwitchOffWaypoint() 12 | { 13 | return ((void(__cdecl*)())(AddressSetter::Get("CFrontEnd", "SwitchOffWaypoint")))(); 14 | } 15 | static void ToggleWaypoint() 16 | { 17 | return ((void(__cdecl*)())(AddressSetter::Get("CFrontEnd", "ToggleWaypoint")))(); 18 | } 19 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CGameConfigReader.h: -------------------------------------------------------------------------------- 1 | class CGameConfigReader 2 | { 3 | public: 4 | void LoadFile(char* fileName) 5 | { 6 | ((void(__thiscall*)(CGameConfigReader*, char*))(AddressSetter::Get("CGameConfigReader", "LoadFile")))(this, fileName); 7 | } 8 | }; 9 | CGameConfigReader*& GameConfigReader = AddressSetter::GetRef("CGameConfigReader", "GameConfigReader"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CGameLogic.h: -------------------------------------------------------------------------------- 1 | class CGameLogic 2 | { 3 | public: 4 | static inline auto& bPenaltyForDeathApplies = AddressSetter::GetRef("CGameLogic", "bPenaltyForDeathApplies"); 5 | static inline auto& bPenaltyForArrestApplies = AddressSetter::GetRef("CGameLogic", "bPenaltyForArrestApplies"); 6 | 7 | static bool Save() 8 | { 9 | return ((bool(__cdecl*)())(AddressSetter::Get("CGameLogic", "Save")))(); 10 | } 11 | static bool Load() 12 | { 13 | return ((bool(__cdecl*)())(AddressSetter::Get("CGameLogic", "Load")))(); 14 | } 15 | static void RestorePlayerStuffDuringResurrection(CPed* pPlayerPed, CVector NewCoors, float NewHeading) 16 | { 17 | ((void(__cdecl*)(CPed*, CVector, float))(AddressSetter::Get("CGameLogic", "RestorePlayerStuffDuringResurrection")))(pPlayerPed, NewCoors, NewHeading); 18 | } 19 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CGangs.h: -------------------------------------------------------------------------------- 1 | class CGangInfo 2 | { 3 | public: 4 | int8_t PedModelOverride; // 00-01 5 | uint8_t pad[0x3]; // 01-04 6 | uint32_t FirstWeapon; // 04-08 7 | uint32_t SecondWeapon; // 08-0C 8 | uint32_t ThirdWeapon; // 0C-10 9 | uint8_t FirstWeaponChance; // 10-11 10 | uint8_t SecondWeaponChance; // 11-12 11 | uint8_t ThirdWeaponChance; // 12-13 12 | uint8_t pad2; // 13-14 13 | }; 14 | VALIDATE_SIZE(CGangInfo, 0x14); 15 | 16 | class CGangs 17 | { 18 | public: 19 | static inline auto Gang = (CGangInfo*)AddressSetter::Get("CGangs", "Gang"); // Gang[12] 20 | 21 | static bool Save() 22 | { 23 | return ((int(__cdecl*)())(AddressSetter::Get("CGangs", "Save")))(); 24 | } 25 | static bool Load() 26 | { 27 | return ((int(__cdecl*)())(AddressSetter::Get("CGangs", "Load")))(); 28 | } 29 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CGenericGameStorage.h: -------------------------------------------------------------------------------- 1 | class CGenericGameStorage 2 | { 3 | public: 4 | static inline auto ms_ValidSaveName = (char*)AddressSetter::Get("CGenericGameStorage", "ms_ValidSaveName"); 5 | 6 | // returns "SGTA4" 7 | static const char* GetDefaultPCSaveFileName() 8 | { 9 | return ((const char*(__cdecl*)())(AddressSetter::Get("CGenericGameStorage", "GetDefaultPCSaveFileName")))(); 10 | } 11 | static void MakeValidSaveName(const char* pString, int SlotNumber) 12 | { 13 | ((void(__cdecl*)(const char*, int))(AddressSetter::Get("CGenericGameStorage", "MakeValidSaveName")))(pString, SlotNumber); 14 | } 15 | static bool SaveDataToWorkBuffer(void* pData, int32_t SizeOfData) 16 | { 17 | return ((bool(__cdecl*)(void*, int32_t))(AddressSetter::Get("CGenericGameStorage", "SaveDataToWorkBuffer")))(pData, SizeOfData); 18 | } 19 | static bool LoadDataFromWorkBuffer(void* pData, int32_t SizeOfData) 20 | { 21 | return ((bool(__cdecl*)(void*, int32_t))(AddressSetter::Get("CGenericGameStorage", "LoadDataFromWorkBuffer")))(pData, SizeOfData); 22 | } 23 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CHudColours.h: -------------------------------------------------------------------------------- 1 | #include "eHudColour.h" 2 | 3 | class CHudColours 4 | { 5 | public: 6 | static inline CRGBA* ms_HudColour = (CRGBA*)AddressSetter::Get("CHudColours", "ms_HudColour"); // ms_HudColour[73] 7 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CInteriorInst.h: -------------------------------------------------------------------------------- 1 | class CInteriorInst : public CBuilding 2 | { 3 | public: 4 | uint8_t pad[0xF0]; // 070-160 5 | }; 6 | 7 | VALIDATE_SIZE(CInteriorInst, 0x160); 8 | -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CMatrix.h: -------------------------------------------------------------------------------- 1 | class CMatrix 2 | { 3 | public: 4 | //CVector_pad right; // 00-10 5 | //CVector_pad up; // 10-20 6 | //CVector_pad at; // 20-30 7 | //CVector_pad pos; // 30-40 8 | 9 | CVector4 right; // 00-10 10 | CVector4 up; // 10-20 11 | CVector4 at; // 20-30 12 | CVector4 pos; // 30-40 13 | 14 | public: 15 | CMatrix(CVector4 _right, CVector4 _up, CVector4 _at, CVector4 _pos) 16 | { 17 | right = _right; 18 | up = _up; 19 | at = _at; 20 | pos = _pos; 21 | } 22 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CNetwork.h: -------------------------------------------------------------------------------- 1 | class CNetwork 2 | { 3 | public: 4 | static inline void*& m_pClientBroadcastVars = AddressSetter::GetRef("CNetwork", "m_pClientBroadcastVars"); 5 | static inline void*& m_pClientBroadcastVarSize = AddressSetter::GetRef("CNetwork", "m_pClientBroadcastVarSize"); 6 | static inline uint32_t& m_bNetworkSession = AddressSetter::GetRef("CNetwork", "m_bNetworkSession"); 7 | static inline uint32_t& m_nNetworkStatus = AddressSetter::GetRef("CNetwork", "m_nNetworkStatus"); 8 | static inline bool& m_bIsHostingGame = AddressSetter::GetRef("CNetwork", "m_bIsHostingGame"); 9 | static bool IsNetworkGameRunning() 10 | { 11 | return ((bool(__cdecl*)())(AddressSetter::Get("CNetwork", "IsNetworkGameRunning")))(); 12 | } 13 | static bool IsNetworkSession() 14 | { 15 | return ((bool(__cdecl*)())(AddressSetter::Get("CNetwork", "IsNetworkSession")))(); 16 | } 17 | static void CheckFramerate(bool bUnk, int time) 18 | { 19 | ((void(__cdecl*)(bool, int))(AddressSetter::Get("CNetwork", "CheckFramerate")))(bUnk, time); 20 | } 21 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CObject.h: -------------------------------------------------------------------------------- 1 | class CPhysical; 2 | 3 | class CObject : public CPhysical 4 | { 5 | public: 6 | uint8_t pad[0x40]; // 210-250 7 | float m_fScale; // 250-254 set by SET_OBJECT_SCALE but unused 8 | uint8_t pad2[0xCC]; // 254-320 9 | }; 10 | VALIDATE_SIZE(CObject, 0x320); 11 | VALIDATE_OFFSET(CObject, m_fScale, 0x250); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CPedType.h: -------------------------------------------------------------------------------- 1 | class CPedType 2 | { 3 | public: 4 | 5 | // takes pedtype string and returns 1 if PLAYER1, PLAYER2, PLAYER_NETWORK or PLAYER_UNUSED 6 | // if true the game sets CPedModelInfo::m_bStreamedPed to 1 7 | static bool IsPedTypePlayer(char* type) 8 | { 9 | return ((bool(__cdecl*)(char*))(AddressSetter::Get("CPedType", "IsPedTypePlayer")))(type); 10 | } 11 | // returns pedtype id from string 12 | static int FindPedType(char* type) 13 | { 14 | return ((int(__cdecl*)(char*))(AddressSetter::Get("CPedType", "FindPedType")))(type); 15 | } 16 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CPopulation.h: -------------------------------------------------------------------------------- 1 | class CPopulation 2 | { 3 | public: 4 | static inline auto& ms_nNumCop = AddressSetter::GetRef("CPopulation", "ms_nNumCop"); 5 | static inline auto& ms_nNumEmergency = AddressSetter::GetRef("CPopulation", "ms_nNumEmergency"); 6 | static inline auto& m_AllRandomPedsThisType = AddressSetter::GetRef("CPopulation", "m_AllRandomPedsThisType"); 7 | static inline auto& PedDensityMultiplier = AddressSetter::GetRef("CPopulation", "PedDensityMultiplier"); 8 | 9 | static inline auto& ScenarioPedDensityMultiplier = AddressSetter::GetRef("CPopulation", "ScenarioPedDensityMultiplier"); 10 | static inline auto& ScenarioPedDensityMultiplier2 = AddressSetter::GetRef("CPopulation", "ScenarioPedDensityMultiplier2"); 11 | 12 | static void Initialise() 13 | { 14 | return ((void(__cdecl*)())(AddressSetter::Get("CPopulation", "Initialise")))(); 15 | } 16 | static void RemovePed(CPed* pPed, bool unk) 17 | { 18 | return ((void(__cdecl*)(CPed*, bool))(AddressSetter::Get("CPopulation", "RemovePed")))(pPed, unk); 19 | } 20 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CProjectileInfo.h: -------------------------------------------------------------------------------- 1 | class CProjectileInfo 2 | { 3 | public: 4 | // start is usually pos 5 | // end is pos + dir vector 6 | // the actual position is read from the matrix so no idea why the start vector exists 7 | // 0 0 0 start vec makes the end vec act as a direction vector and it seems to work fine 8 | // object can be null, it'll create one if it is 9 | static bool AddProjectile(CEntity* pEntProjOwner, int ProjType, CMatrix* pMatrix, CVector* vecStart, CVector* vecEnd, CEntity* pTargetEntity, bool noMPSync, CObject* pProjectileObject) 10 | { 11 | return ((bool(__cdecl*)(CEntity*, int, CMatrix*, CVector*, CVector*, CEntity*, bool, CObject*))(AddressSetter::Get("CProjectileInfo", "AddProjectile")))(pEntProjOwner, ProjType, pMatrix, vecStart, vecEnd, pTargetEntity, noMPSync, pProjectileObject); 12 | } 13 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CQuadTreeNode.h: -------------------------------------------------------------------------------- 1 | class CQuadTreeNode 2 | { 3 | public: 4 | CRect m_sRect; // 00-10 5 | uint32_t* m_pItemList; // 10-14 6 | CQuadTreeNode* m_pChildren[4]; // 14-24 7 | uint32_t m_nLevel; // 24-28 8 | 9 | CQuadTreeNode(CRect* rect, int levels) 10 | { 11 | ((void(__thiscall*)(CQuadTreeNode*, CRect*, int))(AddressSetter::Get("CQuadTreeNode", "CQuadTreeNode")))(this, rect, levels); 12 | } 13 | void ForAllMatching(CVector2D v, void(*callback)(CVector2D*, void*)) 14 | { 15 | ((void(__thiscall*)(CQuadTreeNode*, CVector2D, void(*)(CVector2D*, void*)))(AddressSetter::Get("CQuadTreeNode", "ForAllMatching")))(this, v, callback); 16 | } 17 | }; 18 | VALIDATE_SIZE(CQuadTreeNode, 0x28); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CQuaternion.h: -------------------------------------------------------------------------------- 1 | class CQuaternion 2 | { 3 | public: 4 | float x, y, z, w; 5 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CRGBA.h: -------------------------------------------------------------------------------- 1 | struct CRGBA 2 | { 3 | uint8_t b; 4 | uint8_t g; 5 | uint8_t r; 6 | uint8_t a; 7 | }; 8 | 9 | struct CRGBFloat 10 | { 11 | float red; 12 | float green; 13 | float blue; 14 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CRect.h: -------------------------------------------------------------------------------- 1 | class CRect 2 | { 3 | public: 4 | float left; // 00-04 5 | float bottom; // 04-08 6 | float right; // 08-0C 7 | float top; // 0C-10 8 | }; 9 | VALIDATE_SIZE(CRect, 0x10); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CRenderPhase.h: -------------------------------------------------------------------------------- 1 | // todo 2 | 3 | // +0x24 off vftable might be type 4 | class CRenderPhase; 5 | 6 | // all of these inherit CRenderPhase 7 | class CRenderPhasePreRenderViewport; 8 | class CRenderPhaseTreeImposters; 9 | class CRenderPhaseHeight; 10 | class CRenderPhaseCloudGeneration; 11 | class CRenderPhaseRainUpdate; 12 | class CRenderPhaseSetDefaultRenderState; 13 | class CRenderPhaseCascadeShadows; 14 | class CRenderPhaseWarpShadow; 15 | class CRenderPhaseMirrorReflection; 16 | class CRenderPhaseWaterReflection; 17 | class CRenderPhaseWaterSurface; 18 | class CRenderPhaseReflection; 19 | class CRenderPhaseInteriorReflection; 20 | class CRenderPhaseDeferredLighting_SceneToGBuffer; 21 | class CRenderPhaseDeferredLighting_LightsToScreen; 22 | class CRenderPhaseDrawScene; 23 | class CRenderPhasePostRenderViewport; 24 | class CRenderPhaseRadar; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CReplay.h: -------------------------------------------------------------------------------- 1 | class CReplay 2 | { 3 | public: 4 | static inline auto& Mode = AddressSetter::GetRef("CReplay", "Mode"); 5 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CShaderLib.h: -------------------------------------------------------------------------------- 1 | class CShaderLib 2 | { 3 | public: 4 | // default, unlit, deferred, etc. 5 | static int GetTechniqueID(char* name) 6 | { 7 | return ((int(__cdecl*)(char*))(AddressSetter::Get("CShaderLib", "GetTechniqueID")))(name); 8 | } 9 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CSimpleTransform.h: -------------------------------------------------------------------------------- 1 | class CSimpleTransform 2 | { 3 | public: 4 | CVector m_vPosition; // 000-00C 5 | float m_fHeading; // 00C-010 6 | }; 7 | 8 | VALIDATE_SIZE(CSimpleTransform, 0x10); 9 | -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CSprite2d.h: -------------------------------------------------------------------------------- 1 | class CSprite2d 2 | { 3 | public: 4 | rage::grcTexturePC* m_pTexture = nullptr; 5 | 6 | void SetTexture(char* sName) 7 | { 8 | ((void(__thiscall*)(CSprite2d*, char*))(AddressSetter::Get("CSprite2d", "SetTexture")))(this, sName); 9 | } 10 | void Delete() 11 | { 12 | ((void(__thiscall*)(CSprite2d*))(AddressSetter::Get("CSprite2d", "Delete")))(this); 13 | } 14 | }; 15 | VALIDATE_SIZE(CSprite2d, 0x4); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CStats.h: -------------------------------------------------------------------------------- 1 | class CStats 2 | { 3 | public: 4 | static inline auto LastMissionPassedName = (wchar_t*)AddressSetter::Get("CStats", "LastMissionPassedName"); 5 | 6 | static float GetStatValue(uint16_t index) 7 | { 8 | return ((float(__cdecl*)(uint16_t))(AddressSetter::Get("CStats", "GetStatValue")))(index); 9 | } 10 | static void SetStatValue(uint16_t index, float NewValue) 11 | { 12 | ((void(__cdecl*)(uint16_t, float))(AddressSetter::Get("CStats", "SetStatValue")))(index, NewValue); 13 | } 14 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CStore.h: -------------------------------------------------------------------------------- 1 | template 2 | class CStore 3 | { 4 | public: 5 | uint32_t m_maxItems; // 00-04 6 | uint32_t m_nextItem; // 04-08 7 | T* m_storeArray; // 08-0C 8 | }; 9 | 10 | auto& ms_vehicleModelStore = AddressSetter::GetRef>("CStore", "ms_vehicleModelStore"); 11 | auto& ms_pedModelStore = AddressSetter::GetRef>("CStore", "ms_pedModelStore"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTask.h: -------------------------------------------------------------------------------- 1 | class CTask 2 | { 3 | public: 4 | void* operator new(size_t nSize) 5 | { 6 | return CPools::ms_pTaskPool->New(); 7 | } 8 | void operator delete(void*, size_t, uint32_t) {}; 9 | 10 | CTask* Clone() 11 | { 12 | return ((CTask*(__thiscall*)(CTask*))(*(void***)this)[1])(this); 13 | } 14 | bool IsSimple() 15 | { 16 | return ((bool(__thiscall*)(CTask*))(*(void***)this)[2])(this); 17 | } 18 | int GetType() 19 | { 20 | return ((int(__thiscall*)(CTask*))(*(void***)this)[3])(this); 21 | } 22 | }; 23 | 24 | class CTaskComplex : public CTask 25 | { 26 | public: 27 | 28 | }; 29 | 30 | class CTaskSimple : public CTask 31 | { 32 | public: 33 | 34 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexClimbLadder.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexClimbLadder : public CTaskComplex 2 | { 3 | public: 4 | CTaskComplexClimbLadder(CObject* ladder, int32_t type, uint32_t unk0) 5 | { 6 | ((void(__thiscall*)(CTaskComplexClimbLadder*, CObject*, int32_t, uint32_t))(AddressSetter::Get("CTaskComplexClimbLadder", "CTaskComplexClimbLadder")))(this, ladder, type, unk0); 7 | } 8 | }; 9 | 10 | // TODO: Continue here -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexDie.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexDie : public CTaskComplex 2 | { 3 | public: 4 | CTaskComplexDie(uint32_t unk, uint32_t unk2, uint32_t unk3_44, uint32_t unk4_190, float fBlendDelta, float fAnimSpeed, uint32_t unk5_1) 5 | { 6 | ((void(__thiscall*)(CTaskComplexDie*, uint32_t, uint32_t, uint32_t, uint32_t, float, float, uint32_t))(AddressSetter::Get("CTaskComplexDie", "CTaskComplexDie")))(this, unk, unk2, unk3_44, unk4_190, fBlendDelta, fAnimSpeed, unk5_1); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexInWater.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexInWater : public CTaskComplex 2 | { 3 | public: 4 | CTaskComplexInWater(uint32_t unk, uint32_t unk2, bool bUnk) 5 | { 6 | ((void(__thiscall*)(CTaskComplexInWater*, uint32_t, uint32_t, bool))(AddressSetter::Get("CTaskComplexInWater", "CTaskComplexInWater")))(this, unk, unk2, bUnk); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexMobileMakeCall.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexMobileMakeCall : public CTaskComplex 2 | { 3 | public: 4 | CTaskComplexMobileMakeCall(char* speechLine, bool bUnk_1, bool bUnk2) 5 | { 6 | ((void(__thiscall*)(CTaskComplexMobileMakeCall*, char*, bool, bool))(AddressSetter::Get("CTaskComplexMobileMakeCall", "CTaskComplexMobileMakeCall")))(this, speechLine, bUnk_1, bUnk2); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexNM.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexNM : public CTaskComplex 2 | { 3 | public: 4 | //CTaskComplexNM::CTaskComplexNM(v35, 2000, 10000, v34, COERCE_INT(0.0)) 5 | CTaskComplexNM(uint32_t nUnk, uint32_t nUnk2, CTaskSimple* pSubTask, float fUnk) 6 | { 7 | ((void(__thiscall*)(CTaskComplexNM*, uint32_t, uint32_t, CTaskSimple*, float))(AddressSetter::Get("CTaskComplexNM", "CTaskComplexNM")))(this, nUnk, nUnk2, pSubTask, fUnk); 8 | } 9 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexNewGetInVehicle.h: -------------------------------------------------------------------------------- 1 | enum eNewGetInVehicleType 2 | { 3 | GET_IN_NETWORK = -5, // get into the passenger seat if the driver is friendly 4 | GET_IN_TRAIN = -6, // trains will only work using this type but regular cars are unaffected 5 | GET_IN_DEFAULT_PLAYER = -7, 6 | }; 7 | 8 | class CTaskComplexNewGetInVehicle : public CTaskComplex 9 | { 10 | public: 11 | CTaskComplexNewGetInVehicle(CVehicle* veh, int32_t getInType, uint32_t unk27, int32_t unk, float fUnk) 12 | { 13 | ((void(__thiscall*)(CTaskComplexNewGetInVehicle*, CVehicle*, int32_t, uint32_t, int32_t, float))(AddressSetter::Get("CTaskComplexNewGetInVehicle", "CTaskComplexNewGetInVehicle")))(this, veh, getInType, unk27, unk, fUnk); 14 | } 15 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexPlayerOnFoot.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexPlayerOnFoot : public CTaskComplex 2 | { 3 | public: 4 | CTaskComplexPlayerOnFoot() 5 | { 6 | ((void(__thiscall*)(CTaskComplexPlayerOnFoot*))(AddressSetter::Get("CTaskComplexPlayerOnFoot", "CTaskComplexPlayerOnFoot")))(this); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexPlayerSettingsTask.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexPlayerSettingsTask : public CTaskComplex 2 | { 3 | public: 4 | uint8_t pad[0x14]; // 00-14 5 | uint32_t m_nUnk0; // 14-18 6 | int32_t m_nUnkNeg1; // 18-1C 7 | int32_t m_nUnkNeg1_2; // 1C-20 8 | uint32_t m_nUnkFromPed; // 20-24 pedPtr + 0xE80 9 | CTaskComplexPlayerSettingsTask(uint32_t unkFromPed) 10 | { 11 | // this was inlined 12 | ((void(__thiscall*)(CTaskComplex*))(AddressSetter::Get("CTaskComplexPlayerSettingsTask", "CTaskComplexPlayerSettingsTask")))(this); // CTaskComplex::CTaskComplex 13 | m_nUnk0 = 0; 14 | m_nUnkNeg1 = -1; 15 | m_nUnkNeg1_2 = -1; 16 | m_nUnkFromPed = unkFromPed; 17 | } 18 | }; 19 | VALIDATE_OFFSET(CTaskComplexPlayerSettingsTask, m_nUnk0, 0x14); 20 | VALIDATE_OFFSET(CTaskComplexPlayerSettingsTask, m_nUnkNeg1, 0x18); 21 | VALIDATE_OFFSET(CTaskComplexPlayerSettingsTask, m_nUnkNeg1_2, 0x1C); 22 | VALIDATE_OFFSET(CTaskComplexPlayerSettingsTask, m_nUnkFromPed, 0x20); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskComplexWander.h: -------------------------------------------------------------------------------- 1 | class CTaskComplexWander : public CTaskComplex 2 | { 3 | public: 4 | uint8_t pad[0x80]; // 00-80 5 | float m_fUnk; // 80-84 set to 0 upon initializing CTaskComplexWanderStandard 6 | 7 | CTaskComplexWander(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1) 8 | { 9 | ((void(__thiscall*)(CTaskComplexWander*, uint32_t, float, bool, float, uint32_t))(AddressSetter::Get("CTaskComplexWander", "CTaskComplexWander")))(this, moveState, initialDir, bSensibly, targetRadius, unk1); 10 | } 11 | }; 12 | 13 | class CTaskComplexWanderStandard : public CTaskComplexWander 14 | { 15 | public: 16 | CTaskComplexWanderStandard(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1) : CTaskComplexWander(moveState, initialDir, bSensibly, targetRadius, unk1) 17 | { 18 | // this was probably inlined 19 | *(uint32_t*)this = AddressSetter::Get("CTaskComplexWanderStandard", "CTaskComplexWanderStandard"); // set vftable 20 | this->m_fUnk = 0; 21 | } 22 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskSimpleNMHighFall.h: -------------------------------------------------------------------------------- 1 | class CTaskSimpleNMHighFall : public CTaskSimple 2 | { 3 | public: 4 | //CTaskSimpleNMHighFall::CTaskSimpleNMHighFall(v33, 1000, 10000, 0, 0) 5 | CTaskSimpleNMHighFall(uint32_t nUnk, uint32_t nUnk2, uint32_t nUnk3, uint32_t nUnk4) 6 | { 7 | ((void(__thiscall*)(CTaskSimpleNMHighFall*, uint32_t, uint32_t, uint32_t, uint32_t))(AddressSetter::Get("CTaskSimpleNMHighFall", "CTaskSimpleNMHighFall")))(this, nUnk, nUnk2, nUnk3, nUnk4); 8 | } 9 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskSimpleNMJumpRollFromRoadVehicle.h: -------------------------------------------------------------------------------- 1 | class CTaskSimpleNMJumpRollFromRoadVehicle : public CTaskSimple 2 | { 3 | public: 4 | CTaskSimpleNMJumpRollFromRoadVehicle(uint32_t time, uint32_t time2) 5 | { 6 | ((void(__thiscall*)(CTaskSimpleNMJumpRollFromRoadVehicle*, uint32_t, uint32_t))(AddressSetter::Get("CTaskSimpleNMJumpRollFromRoadVehicle", "CTaskSimpleNMJumpRollFromRoadVehicle")))(this, time, time2); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CTaskSimpleSidewaysDive.h: -------------------------------------------------------------------------------- 1 | class CTaskSimpleSidewaysDive : public CTaskSimple 2 | { 3 | public: 4 | CTaskSimpleSidewaysDive(bool bDirection) 5 | { 6 | ((void(__thiscall*)(CTaskSimpleSidewaysDive*, bool))(AddressSetter::Get("CTaskSimpleSidewaysDive", "CTaskSimpleSidewaysDive")))(this, bDirection); 7 | } 8 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CText.h: -------------------------------------------------------------------------------- 1 | class CText 2 | { 3 | public: 4 | const wchar_t* Get(const char* Ident) 5 | { 6 | return ((const wchar_t*(__thiscall*)(CText*, const char*))(AddressSetter::Get("CText", "Get")))(this, Ident); 7 | } 8 | const wchar_t* Get(uint32_t hash, const char* Ident) 9 | { 10 | return ((const wchar_t* (__thiscall*)(CText*, uint32_t, const char*))(AddressSetter::Get("CText", "Get_2")))(this, hash, Ident); 11 | } 12 | }; 13 | auto& TheText = AddressSetter::GetRef("CText", "TheText"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CVector.h: -------------------------------------------------------------------------------- 1 | class CVector 2 | { 3 | public: 4 | float x, y, z; 5 | 6 | float Heading() { return (float)atan2(-x, y); } 7 | float MagnitudeSqr() { return x * x + y * y + z * z; } 8 | float MagnitudeSqr2D() { return x * x + y * y; } 9 | float Magnitude() { return (float)sqrt(MagnitudeSqr()); } 10 | float Magnitude2D() { return (float)sqrt(MagnitudeSqr2D()); } 11 | }; 12 | 13 | class CVector_pad : public CVector 14 | { 15 | public: 16 | unsigned int flags; // ??? 17 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CVector2D.h: -------------------------------------------------------------------------------- 1 | class CVector2D 2 | { 3 | public: 4 | float x, y; 5 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CVector4.h: -------------------------------------------------------------------------------- 1 | class CVector4 2 | { 3 | public: 4 | float x, y, z, w; 5 | 6 | public: 7 | CVector4() 8 | { 9 | x = 0.0F; 10 | y = 0.0F; 11 | z = 0.0F; 12 | w = 0.0F; 13 | } 14 | CVector4(float _x, float _y, float _z, float _w) 15 | { 16 | x = _x; 17 | y = _y; 18 | z = _z; 19 | w = _w; 20 | } 21 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CVehicleFactoryNY.h: -------------------------------------------------------------------------------- 1 | class CVehicleFactory 2 | { 3 | public: 4 | CVehicle* CreateVehicle(int32_t model, int32_t createdBy, CMatrix* mat, bool bNetwork) 5 | { 6 | return ((CVehicle * (__thiscall*)(CVehicleFactory*, int32_t, int32_t, CMatrix*, bool))(*(void***)this)[1])(this, model, createdBy, mat, bNetwork); 7 | } 8 | int DeleteVehicle(CVehicle* veh) 9 | { 10 | return ((int(__thiscall*)(CVehicleFactory*, CVehicle*))(*(void***)this)[2])(this, veh); 11 | } 12 | 13 | }; 14 | class CVehicleFactoryNY : public CVehicleFactory 15 | { 16 | public: 17 | 18 | }; 19 | 20 | static CVehicleFactoryNY*& VehicleFactory = AddressSetter::GetRef("CVehicleFactory", "VehicleFactory"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CWanted.h: -------------------------------------------------------------------------------- 1 | class CWanted 2 | { 3 | public: 4 | static inline auto& MaximumWantedLevel = AddressSetter::GetRef("CWanted", "MaximumWantedLevel"); 5 | static inline auto& nMaximumWantedLevel = AddressSetter::GetRef("CWanted", "nMaximumWantedLevel"); 6 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/CWeather.h: -------------------------------------------------------------------------------- 1 | class CWeather 2 | { 3 | public: 4 | static inline auto& ForcedWeatherType = AddressSetter::GetRef("CWeather", "ForcedWeatherType"); 5 | static inline auto& OldWeatherType = AddressSetter::GetRef("CWeather", "OldWeatherType"); 6 | static inline auto& NewWeatherType = AddressSetter::GetRef("CWeather", "NewWeatherType"); 7 | static inline auto& InterpolationValue = AddressSetter::GetRef("CWeather", "InterpolationValue"); 8 | static inline auto& WeatherTypeInList = AddressSetter::GetRef("CWeather", "WeatherTypeInList"); 9 | static inline auto& Rain = AddressSetter::GetRef("CWeather", "Rain"); 10 | static inline auto& ForcedWind = AddressSetter::GetRef("CWeather", "ForcedWind"); 11 | 12 | static void ForceWeatherNow(int Type) 13 | { 14 | return ((void(__cdecl*)(int))(AddressSetter::Get("CWeather", "ForceWeatherNow")))(Type); 15 | } 16 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/C_PcSave.h: -------------------------------------------------------------------------------- 1 | class C_PcSave 2 | { 3 | public: 4 | 5 | // slot -1 is autosave 6 | static int SaveSlot(int32_t SlotNum) 7 | { 8 | return ((int(__cdecl*)(int32_t))(AddressSetter::Get("C_PcSave", "SaveSlot")))(SlotNum); 9 | } 10 | static int LoadSlot(int32_t SlotNum) 11 | { 12 | return ((int(__cdecl*)(int32_t))(AddressSetter::Get("C_PcSave", "LoadSlot")))(SlotNum); 13 | } 14 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/audEngine.h: -------------------------------------------------------------------------------- 1 | class audConfig 2 | { 3 | public: 4 | 5 | void LoadFromFile(char* path) 6 | { 7 | ((void(__thiscall*)(audConfig*, char*))(AddressSetter::Get("audConfig", "LoadFromFile")))(this, path); 8 | } 9 | }; 10 | 11 | class audEngine 12 | { 13 | public: 14 | static inline audConfig& m_pSoundsConfig = AddressSetter::GetRef("audEngine", "m_pSoundsConfig"); 15 | static inline audConfig& m_pCurvesConfig = AddressSetter::GetRef("audEngine", "m_pCurvesConfig"); 16 | static inline audConfig& m_pGameConfig = AddressSetter::GetRef("audEngine", "m_pGameConfig"); 17 | 18 | // this is used after every category patch, but the parameter is 1 in ep2 and 0 in the rest 19 | void SetUnknown(float unk1) 20 | { 21 | ((void(__thiscall*)(audEngine*, float))(AddressSetter::Get("audEngine", "SetUnknown")))(this, unk1); 22 | } 23 | }; 24 | 25 | audEngine& AudioEngine = AddressSetter::GetRef("audEngine", "AudioEngine"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/audRadioAudioEntity.h: -------------------------------------------------------------------------------- 1 | class audRadioAudioEntity 2 | { 3 | public: 4 | uint8_t pad[0x6C]; 5 | uint32_t m_nRadioState; 6 | uint32_t m_nRadioState2; 7 | uint8_t pad2[0x4]; 8 | 9 | //uint8_t pad[0x78]; // 00-78 10 | 11 | uint32_t m_nCurrentRadioStationPriority; 12 | uint32_t m_nCurrentRadioStation; // 78-7C 13 | uint32_t m_nStationIndex; 14 | }; 15 | // VALIDATE_OFFSET(audRadioAudioEntity, m_nCurrentRadioStation, 0x78); 16 | 17 | audRadioAudioEntity& RadioAudioEntity = AddressSetter::GetRef("audRadioAudioEntity", "RadioAudioEntity"); -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/commit.txt: -------------------------------------------------------------------------------- 1 | Commit used: https://github.com/Zolika1351/iv-sdk/commit/dddbd3f54b146bdb3a9852809e48e5cb169af3cd -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/fiPackfile.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | class fiPackfile 4 | { 5 | public: 6 | uint8_t pad[0x478]; // 000-478 7 | 8 | fiPackfile() 9 | { 10 | ((void(__thiscall*)(fiPackfile*))(AddressSetter::Get("fiPackfile", "fiPackfile")))(this); 11 | } 12 | 13 | bool OpenPackfile(char* path, char unk1_1, char unk2_0, int unk3_0or3) 14 | { 15 | return ((bool(__thiscall*)(fiPackfile*, char*, char, char, int))(AddressSetter::Get("fiPackfile", "OpenPackfile")))(this, path, unk1_1, unk2_0, unk3_0or3); 16 | } 17 | 18 | bool Mount(char* mountPoint) 19 | { 20 | return ((bool(__thiscall*)(fiPackfile*, char*))(AddressSetter::Get("fiPackfile", "Mount")))(this, mountPoint); 21 | } 22 | }; 23 | VALIDATE_SIZE(fiPackfile, 0x478); 24 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/grcTexture.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | class grcTexture 4 | { 5 | public: 6 | }; 7 | 8 | class grcTexturePC : public grcTexture 9 | { 10 | public: 11 | uint8_t pad[0x18]; // 00-18 12 | LPDIRECT3DTEXTURE9 m_pD3DTexture = nullptr; // 18-1C 13 | uint8_t pad2[0x34]; // 1C-50 14 | 15 | // this doesn't actually seem to load textures? it always creates a dummy one, maybe there's another function that does that 16 | grcTexturePC(char* sName, uint32_t* pUnk = nullptr) 17 | { 18 | ((void(__stdcall*)(grcTexturePC*, char*, uint32_t*))(AddressSetter::Get("grcTexturePC", "grcTexturePC")))(this, sName, pUnk); 19 | } 20 | }; 21 | VALIDATE_SIZE(grcTexturePC, 0x50); 22 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/grcTextureFactory.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | class grcTextureFactory 4 | { 5 | 6 | }; 7 | 8 | class grcTextureFactoryPC : public grcTextureFactory 9 | { 10 | public: 11 | uint8_t pad[0x70]; // 00-70 12 | 13 | grcTexturePC* CreateTexture(char* sName, uint32_t* pUnk = nullptr) 14 | { 15 | return ((grcTexturePC*(__stdcall*)(grcTextureFactoryPC*, char*, uint32_t*))(*(void***)this)[3])(this, sName, pUnk); 16 | } 17 | }; 18 | VALIDATE_SIZE(grcTextureFactoryPC, 0x70); 19 | 20 | grcTextureFactoryPC*& TextureFactory = AddressSetter::GetRef("grcTextureFactoryPC", "TextureFactory"); 21 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/grcWindow.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | class grcWindow 4 | { 5 | public: 6 | static bool ProcessWindowMessage() 7 | { 8 | return ((bool(__cdecl*)())(AddressSetter::Get("grcWindow", "ProcessWindowMessage")))(); 9 | } 10 | }; 11 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/pgDictionary.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | template 4 | class pgDictionary 5 | { 6 | public: 7 | T* getEntryByKey(uint32_t nHash) 8 | { 9 | return ((T * (__thiscall*)(pgDictionary*, uint32_t))(AddressSetter::Get("pgDictionary", "getEntryByKey")))(this, nHash); 10 | } 11 | }; 12 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/phBound.h: -------------------------------------------------------------------------------- 1 | namespace rage 2 | { 3 | class phBound 4 | { 5 | public: 6 | uint8_t pad[0x80]; // 00-80 7 | 8 | // +0x50 off vft is set mass for cars but seems to be userpurge, todo 9 | }; 10 | VALIDATE_SIZE(phBound, 0x80); 11 | 12 | class phBoundComposite : public phBound 13 | { 14 | public: 15 | uint8_t pad[0x20]; // 80-A0 16 | }; 17 | VALIDATE_SIZE(phBoundComposite, 0xA0); 18 | }; -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDK/rage.h: -------------------------------------------------------------------------------- 1 | // any non-class rage functions should go here 2 | namespace rage 3 | { 4 | static HWND& g_pHWND = AddressSetter::GetRef("rage", "g_pHWND"); 5 | static IDirect3DDevice9*& g_pDirect3DDevice = AddressSetter::GetRef("rage", "g_pDirect3DDevice"); 6 | static uint32_t atStringHash(const char* sString, uint32_t* nExistingHash = nullptr) 7 | { 8 | return ((uint32_t(__cdecl*)(const char*, uint32_t*))(AddressSetter::Get("rage", "atStringHash")))(sString, nExistingHash); 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /IVSDKDotNet/IVSDKDotNet.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /IVSDKDotNet/Memory Offset Config Files/IVSDK/README.txt: -------------------------------------------------------------------------------- 1 | - What is this folder for? 2 | 3 | This folder contains configuration (.ini) files for different versions of GTA IV, each storing the necessary memory offsets for IV-SDK. 4 | 5 | - Adding new offset configuration files 6 | 7 | To add support for a new GTA IV version: 8 | 9 | - Duplicate an existing .ini file (e.g., 1080.ini). 10 | - Rename it to match the GTA IV version you want to support (e.g., 12059.ini). 11 | - Now you can update all the memory offsets for this version. 12 | - Tho, is it that easy? Probably not, because struct sizes might change per version which needs to be adjusted in the actual code. 13 | 14 | The configuration file is built up using section, keys and values which look like this: 15 | 16 | [Section] 17 | Key=Value 18 | 19 | The name of a section matches the name of a header file e.g. "CPlayerInfo" 20 | The name of a key matches the name of a member e.g. "FindPlayerPed" 21 | The value of a key will be the memory offset for the member in hex (e.g. 0x123456) or a memory pattern e.g. "55 8B EC 83 E4 F0 83 EC 64 53 56 57 BB" (At this point, the option to put in patterns are experimental because you can't adjust the index and offset yet) -------------------------------------------------------------------------------- /IVSDKDotNet/Memory Offset Config Files/README.md: -------------------------------------------------------------------------------- 1 | Put the "IVSDK" folder into your main directory of GTA IV so IV-SDK can read the memory offsets from the appropriate config file. -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/AssemblyInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | using namespace System; 4 | using namespace System::Reflection; 5 | using namespace System::Runtime::CompilerServices; 6 | using namespace System::Runtime::InteropServices; 7 | using namespace System::Security::Permissions; 8 | 9 | [assembly:AssemblyTitleAttribute(L"IVSDKDotNetWrapper")]; 10 | [assembly:AssemblyDescriptionAttribute(L"")]; 11 | [assembly:AssemblyConfigurationAttribute(L"")]; 12 | [assembly:AssemblyCompanyAttribute(L"ItsClonkAndre")]; 13 | [assembly:AssemblyProductAttribute(L"IVSDKDotNetWrapper")]; 14 | [assembly:AssemblyCopyrightAttribute(L"Copyright (c) ItsClonkAndre 2022 - 2025")]; 15 | [assembly:AssemblyTrademarkAttribute(L"")]; 16 | [assembly:AssemblyCultureAttribute(L"")]; 17 | 18 | [assembly:AssemblyVersionAttribute(L"1.9.1.0")]; 19 | 20 | [assembly:ComVisible(false)]; 21 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/CClock.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "CClock.h" 3 | 4 | namespace IVSDKDotNet { 5 | 6 | 7 | 8 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/CQuaternion.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "CQuaternion.h" 3 | 4 | namespace IVSDKDotNet { 5 | 6 | CQuaternion::CQuaternion(float x, float y, float z, float w) 7 | { 8 | X = x; 9 | Y = y; 10 | Z = z; 11 | W = w; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/CQuaternion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Native_CQuaternion 4 | { 5 | public: 6 | float x, y, z, w; 7 | }; 8 | 9 | namespace IVSDKDotNet { 10 | 11 | public value struct CQuaternion 12 | { 13 | public: 14 | CQuaternion(float x, float y, float z, float w); 15 | 16 | property float X { 17 | public: float get() { return m_fX; } 18 | private: void set(float value) { m_fX = value; } 19 | } 20 | 21 | property float Y { 22 | public: float get() { return m_fY; } 23 | private: void set(float value) { m_fY = value; } 24 | } 25 | 26 | property float Z { 27 | public: float get() { return m_fZ; } 28 | private: void set(float value) { m_fZ = value; } 29 | } 30 | 31 | property float W { 32 | public: float get() { return m_fW; } 33 | private: void set(float value) { m_fW = value; } 34 | } 35 | 36 | private: 37 | float m_fX, m_fY, m_fZ, m_fW; 38 | }; 39 | 40 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/EventArgs.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "EventArgs.h" 3 | 4 | namespace IVSDKDotNet { 5 | 6 | IVKeyEventArgs::IVKeyEventArgs(int keyValue, Keys keyCode, Keys keyData, Keys modifieres, bool control, bool alt, bool shift) 7 | { 8 | KeyValue = keyValue; 9 | KeyCode = keyCode; 10 | KeyData = keyData; 11 | Modifieres = modifieres; 12 | Control = control; 13 | Alt = alt; 14 | Shift = shift; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/Exceptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | namespace Exceptions 7 | { 8 | 9 | /// 10 | /// Thrown when a native function could not be found by name. 11 | /// 12 | public ref class NativeNotFoundException : Exception 13 | { 14 | public: 15 | property String^ TheNativeName 16 | { 17 | public: 18 | String^ get() 19 | { 20 | return nativeName; 21 | } 22 | } 23 | 24 | public: 25 | NativeNotFoundException(String^ theNativeName) : Exception(String::Format("Could not find native function with name '{0}'!", theNativeName)) 26 | { 27 | 28 | } 29 | 30 | private: 31 | String^ nativeName; 32 | }; 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAchievements.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAchievements.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | void IVAchievements::AwardAchievement(int32_t id) 7 | { 8 | CAchievements::AwardAchievement(id); 9 | } 10 | bool IVAchievements::IsAchievementUnlocked(int32_t id) 11 | { 12 | return CAchievements::IsAchievementUnlocked(id); 13 | } 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAchievements.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVAchievements 6 | { 7 | public: 8 | /// 9 | /// Awards an achievement with the given id. 10 | /// 11 | /// The id of the achievement. 12 | static void AwardAchievement(int32_t id); 13 | /// 14 | /// Checks if a specific award is unlocked. 15 | /// 16 | /// The id of the achievement. 17 | /// True if the achievement is unlocked. Otherwise, false. 18 | static bool IsAchievementUnlocked(int32_t id); 19 | }; 20 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAnimManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAnimManager.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | void IVAnimManager::Initialise() 7 | { 8 | CAnimManager::Initialise(); 9 | } 10 | void IVAnimManager::AddAnimAssocDefinition(int id, String^ pName, String^ pFile, uint32_t numAnims, array^ pAnimNames, UIntPtr pAnimDescs, int unk1, int unk2, int unk3, bool unk4) 11 | { 12 | throw gcnew NotImplementedException(); 13 | } 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAudConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAudConfig.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVAudConfig::IVAudConfig(audConfig* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeAudConfig = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVAudConfig::LoadFromFile(String^ path) 16 | { 17 | NULLPTR_CHECK(NativeAudConfig); 18 | 19 | if (String::IsNullOrWhiteSpace(path)) 20 | return; 21 | 22 | msclr::interop::marshal_context ctx; 23 | NativeAudConfig->LoadFromFile((char*)ctx.marshal_as(path)); 24 | } 25 | UIntPtr IVAudConfig::GetUIntPtr() 26 | { 27 | return UIntPtr(NativeAudConfig); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAudConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVAudConfig 6 | { 7 | public: 8 | /// 9 | /// Undocumented. 10 | /// 11 | /// The path to the file to load the audio config from? 12 | void LoadFromFile(String^ path); 13 | 14 | /// 15 | /// Gets the managed UIntPtr from the native pointer. 16 | /// 17 | /// The managed UIntPtr from the native pointer 18 | UIntPtr GetUIntPtr(); 19 | 20 | internal: 21 | IVAudConfig(audConfig* nativePtr); 22 | 23 | internal: 24 | audConfig* NativeAudConfig; 25 | }; 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAudEngine.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAudEngine.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVAudEngine::IVAudEngine(audEngine* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeAudEngine = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVAudEngine::SetUnknown(float unk1) 16 | { 17 | NULLPTR_CHECK(NativeAudEngine); 18 | NativeAudEngine->SetUnknown(unk1); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAudRadioAudioEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAudRadioAudioEntity.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVAudRadioAudioEntity::IVAudRadioAudioEntity(audRadioAudioEntity* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeRadioAudioEntity = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVAudRadioAudioEntity^ IVAudRadioAudioEntity::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVAudRadioAudioEntity((audRadioAudioEntity*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVAudRadioAudioEntity::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeRadioAudioEntity, UIntPtr::Zero); 23 | return UIntPtr(NativeRadioAudioEntity); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVAudioZones.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVAudioZones.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | void IVAudioZones::Update(bool bForceUpdate, Vector3 TestCoors) 7 | { 8 | CVector vec = { TestCoors.X, TestCoors.Y, TestCoors.Z }; 9 | CAudioZones::Update(bForceUpdate, vec); 10 | } 11 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBaseDC.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVBaseDC.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVBaseDC::IVBaseDC(CBaseDC* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeBaseDC = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVBaseDC::Add() 16 | { 17 | NULLPTR_CHECK(NativeBaseDC); 18 | NativeBaseDC->Add(); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBaseDC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVBaseDC 6 | { 7 | public: 8 | /// 9 | /// Undocumented. 10 | /// 11 | void Add(); 12 | 13 | internal: 14 | IVBaseDC(CBaseDC* nativePtr); 15 | 16 | internal: 17 | CBaseDC* NativeBaseDC; 18 | }; 19 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBoundBox.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVBoundBox.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVBoundBox::IVBoundBox(CBoundBox* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeBoundBox = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBoundBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVBoundBox 6 | { 7 | public: 8 | property Vector3 Min 9 | { 10 | public: 11 | Vector3 get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeBoundBox, Vector3::Zero); 14 | CVector_pad v = NativeBoundBox->m_vecMin; 15 | return Vector3(v.x, v.y, v.z); 16 | } 17 | void set(Vector3 value) 18 | { 19 | NULLPTR_CHECK(NativeBoundBox); 20 | 21 | CVector_pad v; 22 | v.x = value.X; 23 | v.y = value.Y; 24 | v.z = value.Z; 25 | NativeBoundBox->m_vecMin = v; 26 | } 27 | } 28 | property Vector3 Max 29 | { 30 | public: 31 | Vector3 get() 32 | { 33 | NULLPTR_CHECK_WITH_RETURN(NativeBoundBox, Vector3::Zero); 34 | CVector_pad v = NativeBoundBox->m_vecMax; 35 | return Vector3(v.x, v.y, v.z); 36 | } 37 | void set(Vector3 value) 38 | { 39 | NULLPTR_CHECK(NativeBoundBox); 40 | 41 | CVector_pad v; 42 | v.x = value.X; 43 | v.y = value.Y; 44 | v.z = value.Z; 45 | NativeBoundBox->m_vecMax = v; 46 | } 47 | } 48 | 49 | internal: 50 | IVBoundBox(CBoundBox* nativePtr); 51 | 52 | internal: 53 | CBoundBox* NativeBoundBox; 54 | }; 55 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBuilding.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVBuilding.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVBuilding::IVBuilding(CBuilding* nativePtr) : IVEntity(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeBuilding = nativePtr; 12 | } 13 | 14 | // - - - Methods / Funcions - - - 15 | void IVBuilding::ReplaceWithNewModel(int32_t index) 16 | { 17 | NULLPTR_CHECK(NativeBuilding); 18 | NativeBuilding->ReplaceWithNewModel(index); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVBuilding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVBuilding : public IVEntity 6 | { 7 | public: 8 | void ReplaceWithNewModel(int32_t index); 9 | 10 | internal: 11 | IVBuilding(CBuilding* nativePtr); 12 | 13 | internal: 14 | CBuilding* NativeBuilding; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCDStream.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCDStream.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Methods / Functions - - - 8 | int IVCDStream::AddImage(String^ sPath, uint8_t unk1, int32_t unkNeg1) 9 | { 10 | if (String::IsNullOrWhiteSpace(sPath)) 11 | return 0; 12 | 13 | msclr::interop::marshal_context ctx; 14 | return CdStreamAddImage((char*)ctx.marshal_as(sPath), unk1, unkNeg1); 15 | } 16 | 17 | int IVCDStream::CloseImageFile(int index) 18 | { 19 | return CImgFileMgr::CloseImageFile(index); 20 | } 21 | int IVCDStream::CloseAllImages() 22 | { 23 | return CImgFileMgr::CloseAllImages(); 24 | } 25 | 26 | String^ IVCDStream::GetImageFileName(int index) 27 | { 28 | char* ptr = CImgFileMgr::GetImageFileName(index); 29 | 30 | if (ptr) 31 | return gcnew String(ptr); 32 | 33 | return String::Empty; 34 | } 35 | int IVCDStream::GetImageFileHandle(int index) 36 | { 37 | return CImgFileMgr::GetImageFileHandle(index); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCam.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCam.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVCam::IVCam(CCam* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCam = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVCam^ IVCam::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVCam((CCam*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVCam::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeCam, UIntPtr::Zero); 23 | return UIntPtr(NativeCam); 24 | } 25 | 26 | IVCam^ IVCam::GetCamOfType(int type, int unk) 27 | { 28 | NULLPTR_CHECK_WITH_RETURN(NativeCam, nullptr); 29 | return gcnew IVCam(NativeCam->GetCamOfType(type, unk)); 30 | } 31 | IVCam^ IVCam::Activate() 32 | { 33 | NULLPTR_CHECK_WITH_RETURN(NativeCam, nullptr); 34 | return gcnew IVCam(NativeCam->Activate()); 35 | } 36 | bool IVCam::Process() 37 | { 38 | NULLPTR_CHECK_WITH_RETURN(NativeCam, false); 39 | return NativeCam->Process(); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCamFollowVehicle.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCamFollowVehicle.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVCamFollowVehicle::IVCamFollowVehicle(CCamFollowVehicle* nativePtr) : IVCam(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCam = nativePtr; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCamFollowVehicle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVCamFollowVehicle : public IVCam 6 | { 7 | public: 8 | property float TargetFOV 9 | { 10 | public: 11 | float get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeCam, 0.0F); 14 | return NativeCam->m_fTargetFOV; 15 | } 16 | void set(float value) 17 | { 18 | NULLPTR_CHECK(NativeCam); 19 | NativeCam->m_fTargetFOV = value; 20 | } 21 | } 22 | 23 | internal: 24 | IVCamFollowVehicle(CCamFollowVehicle* nativePtr); 25 | 26 | internal: 27 | CCamFollowVehicle* NativeCam; 28 | }; 29 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCamera.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCamera.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVCamera::IVCamera(CCamera* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCamera = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVCam^ IVCamera::CreateCam(int type, IVCam^ unk, IVCam^ unk2) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativeCamera, nullptr); 18 | NULLPTR_CHECK_WITH_RETURN(unk, nullptr); 19 | NULLPTR_CHECK_WITH_RETURN(unk2, nullptr); 20 | 21 | CCam* cam = NativeCamera->CreateCam(type, unk->NativeCam, unk2->NativeCam); 22 | NULLPTR_CHECK_WITH_RETURN(cam, nullptr); 23 | 24 | return gcnew IVCam(cam); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCheat.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCheat.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCheat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVCheat 6 | { 7 | public: 8 | /// 9 | /// Gets or sets if the player has cheated. 10 | /// 11 | static property bool HasPlayerCheated 12 | { 13 | public: 14 | bool get() 15 | { 16 | return CCheat::m_bHasPlayerCheated; 17 | } 18 | void set(bool value) 19 | { 20 | CCheat::m_bHasPlayerCheated = value; 21 | } 22 | } 23 | }; 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVClock.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVClock.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVControlRemapInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVControlRemapInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVControlRemapInfo::IVControlRemapInfo(tControlRemapInfo* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeControlRemapInfo = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVControlledByInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVControlledByInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVControlledByInfo::IVControlledByInfo(bool isNetwork, bool isPlayer) 9 | { 10 | m_bIsControlledByNetwork = isNetwork; 11 | m_bIsPlayer = isPlayer; 12 | } 13 | IVControlledByInfo::IVControlledByInfo(CControlledByInfo& native) 14 | { 15 | m_bIsControlledByNetwork = native.m_isControlledByNetwork; 16 | m_bIsPlayer = native.m_isPlayer; 17 | } 18 | 19 | // - - - Methods / Functions - - - 20 | IVControlledByInfo IVControlledByInfo::LocalAIControl() 21 | { 22 | return IVControlledByInfo(false, false); 23 | } 24 | IVControlledByInfo IVControlledByInfo::LocalPlayerControl() 25 | { 26 | return IVControlledByInfo(false, true); 27 | } 28 | IVControlledByInfo IVControlledByInfo::NetworkNpcControl() 29 | { 30 | return IVControlledByInfo(true, false); 31 | } 32 | IVControlledByInfo IVControlledByInfo::NetworkPlayerControl() 33 | { 34 | return IVControlledByInfo(true, true); 35 | } 36 | 37 | 38 | 39 | 40 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCrSkeleton.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCrSkeleton.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVCrSkeleton::IVCrSkeleton(rage::crSkeleton* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCrSkeleton = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVCrSkeletonData IVCrSkeleton::GetBoneDataByName(String^ sName) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativeCrSkeleton, IVCrSkeletonData()); 18 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(sName, IVCrSkeletonData()); 19 | 20 | msclr::interop::marshal_context ctx; 21 | rage::crSkeletonData* ptr = NativeCrSkeleton->GetBoneDataByName((char*)ctx.marshal_as(sName)); 22 | NULLPTR_CHECK_WITH_RETURN(ptr, IVCrSkeletonData()); 23 | 24 | return IVCrSkeletonData(ptr); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCrSkeletonData.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCrSkeletonData.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVCrSkeletonData::IVCrSkeletonData(rage::crSkeletonData* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeCrSkeletonData = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCrSkeletonData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public value struct IVCrSkeletonData 6 | { 7 | public: 8 | property String^ Name 9 | { 10 | public: 11 | String^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeCrSkeletonData, String::Empty); 14 | return gcnew String(NativeCrSkeletonData->m_sName); 15 | } 16 | } 17 | property uint16_t BoneID 18 | { 19 | public: 20 | uint16_t get() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeCrSkeletonData, 0); 23 | return NativeCrSkeletonData->m_nBoneID; 24 | } 25 | void set(uint16_t value) 26 | { 27 | NULLPTR_CHECK(NativeCrSkeletonData); 28 | NativeCrSkeletonData->m_nBoneID = value; 29 | } 30 | } 31 | 32 | internal: 33 | IVCrSkeletonData(rage::crSkeletonData* nativePtr); 34 | 35 | internal: 36 | rage::crSkeletonData* NativeCrSkeletonData; 37 | }; 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCustomShaderEffectBase.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCustomShaderEffectBase.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVCustomShaderEffectBase::IVCustomShaderEffectBase(CCustomShaderEffectBase* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCustomShaderEffectBase = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVCustomShaderEffectBase::Update(IVEntity^ attachedEntity) 16 | { 17 | NULLPTR_CHECK(NativeCustomShaderEffectBase); 18 | NULLPTR_CHECK(attachedEntity); 19 | NULLPTR_CHECK(attachedEntity->NativeEntity); 20 | 21 | NativeCustomShaderEffectBase->Update(attachedEntity->NativeEntity); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCustomShaderEffectBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVCustomShaderEffectBase 6 | { 7 | public: 8 | void Update(IVEntity^ attachedEntity); 9 | 10 | internal: 11 | IVCustomShaderEffectBase(CCustomShaderEffectBase* nativePtr); 12 | 13 | internal: 14 | CCustomShaderEffectBase* NativeCustomShaderEffectBase; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCustomShaderEffectPedBoneDamageFX.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCustomShaderEffectPedBoneDamageFX.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVCustomShaderEffectPedBoneDamageFX::IVCustomShaderEffectPedBoneDamageFX(CCustomShaderEffectPedBoneDamageFX* nativePtr) 8 | : IVCustomShaderEffectBase(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeCustomShaderEffectPedBoneDamageFX = nativePtr; 12 | } 13 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCustomShaderEffectVehicleFX.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCustomShaderEffectVehicleFX.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVCustomShaderEffectVehicleFX::IVCustomShaderEffectVehicleFX(CCustomShaderEffectVehicleFX* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeCustomShaderEffectVehicleFX = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCutsceneMgr.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVCutsceneMgr.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | bool IVCutsceneMgr::IsRunning() 7 | { 8 | return CCutsceneMgr::IsRunning(); 9 | } 10 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVCutsceneMgr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVCutsceneMgr 6 | { 7 | public: 8 | static property uint32_t Running 9 | { 10 | public: 11 | uint32_t get() 12 | { 13 | return CCutsceneMgr::ms_running; 14 | } 15 | void set(uint32_t value) 16 | { 17 | CCutsceneMgr::ms_running = value; 18 | } 19 | } 20 | 21 | public: 22 | static bool IsRunning(); 23 | 24 | }; 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDraw.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVDraw.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVDraw::IVDraw(CDraw* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeDraw = nativePtr; 12 | } 13 | 14 | // - - - Methods/Functions - - - 15 | float IVDraw::CalculateAspectRatio(bool bUnk) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativeDraw, 0.0F); 18 | return NativeDraw->CalculateAspectRatio(bUnk); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDrawCurvedWindowDC.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVDrawCurvedWindowDC.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVDrawCurvedWindowDC::IVDrawCurvedWindowDC(CDrawCurvedWindowDC* nativePtr) : IVBaseDC(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeDC = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVDrawCurvedWindowDC^ IVDrawCurvedWindowDC::Create(Vector2 pos, SizeF size, Color color) 16 | { 17 | CVector2D* vec = new CVector2D(); 18 | vec->x = pos.X; 19 | vec->y = pos.Y; 20 | 21 | CRGBA c = CRGBA(); 22 | c.r = color.R; 23 | c.g = color.G; 24 | c.b = color.B; 25 | c.a = color.A; 26 | 27 | CDrawCurvedWindowDC* dc = &CDrawCurvedWindowDC(vec, size.Width, size.Height, c); 28 | 29 | if (!dc) 30 | { 31 | delete vec; 32 | return nullptr; 33 | } 34 | 35 | return gcnew IVDrawCurvedWindowDC(dc); 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDrawCurvedWindowDC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVDrawCurvedWindowDC : IVBaseDC 6 | { 7 | public: 8 | // TODO: Test if this function works and if it only needs to be called once. if YES then create a delete method!!!!!!!! 9 | /// 10 | /// Draws a curved window on screen. 11 | /// 12 | /// The position. Coordinates are ratio of screen (0-1). 13 | /// The size of the window. 14 | /// The color of the window. RGB is ignored, only alpha used. 15 | /// 16 | static IVDrawCurvedWindowDC^ Create(Vector2 pos, SizeF size, Color color); 17 | 18 | internal: 19 | IVDrawCurvedWindowDC(CDrawCurvedWindowDC* nativePtr); 20 | 21 | internal: 22 | CDrawCurvedWindowDC* NativeDC; 23 | }; 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDrawRadioHudTextDC.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVDrawRadioHudTextDC.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVDrawRadioHudTextDC::IVDrawRadioHudTextDC(CDrawRadioHudTextDC* nativePtr) : IVBaseDC(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeDrawRadioHudTextDC = nativePtr; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDrawRectDC.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVDrawRectDC.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVDrawRectDC::IVDrawRectDC(CDrawRectDC* nativePtr) : IVBaseDC(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeDC = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVDrawRectDC^ IVDrawRectDC::Create(RectangleF rect, Color color) 16 | { 17 | CRect* cRect = new CRect(); 18 | cRect->left = rect.X; 19 | cRect->right = rect.Right; 20 | cRect->top = rect.Y; 21 | cRect->bottom = rect.Bottom; 22 | 23 | CRGBA c = CRGBA(); 24 | c.r = color.R; 25 | c.g = color.G; 26 | c.b = color.B; 27 | c.a = color.A; 28 | 29 | CDrawRectDC* dc = &CDrawRectDC(cRect, c); 30 | 31 | if (!dc) 32 | { 33 | delete cRect; 34 | return nullptr; 35 | } 36 | 37 | return gcnew IVDrawRectDC(dc); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDrawRectDC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVDrawRectDC : IVBaseDC 6 | { 7 | public: 8 | // TODO: Test if this function works and if it only needs to be called once. if YES then create a delete method!!!!!!!! 9 | 10 | /// 11 | /// Draws a rectangle on screen. Also works in main menu. 12 | /// 13 | /// The rectangle. Coordinates are in pixels. 14 | /// The color of the rectangle. 15 | /// 16 | static IVDrawRectDC^ Create(RectangleF rect, Color color); 17 | 18 | internal: 19 | IVDrawRectDC(CDrawRectDC* nativePtr); 20 | 21 | internal: 22 | CDrawRectDC* NativeDC; 23 | }; 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVDynamicEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVDynamicEntity.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVDynamicEntity::IVDynamicEntity(CDynamicEntity* nativePtr) : IVEntity(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeDynEntity = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVMatrix IVDynamicEntity::GetBoneMatrix(int boneID) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativeDynEntity, IVMatrix::Zero); 18 | 19 | CMatrix* matrix = NativeDynEntity->GetBoneMatrix(boneID); 20 | NULLPTR_CHECK_WITH_RETURN(matrix, IVMatrix::Zero); 21 | 22 | return IVMatrix(matrix); 23 | } 24 | IVMatrix IVDynamicEntity::GetBoneMatrix2(int boneID) 25 | { 26 | NULLPTR_CHECK_WITH_RETURN(NativeDynEntity, IVMatrix::Zero); 27 | 28 | CMatrix* matrix = NativeDynEntity->GetBoneMatrix2(boneID); 29 | NULLPTR_CHECK_WITH_RETURN(matrix, IVMatrix::Zero); 30 | 31 | return IVMatrix(matrix); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVEpisodes.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVEpisodes.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVEpisodes::IVEpisodes(CEpisodes* ptr) 9 | { 10 | NULLPTR_CHECK(ptr); 11 | NativePtr = ptr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | bool IVEpisodes::IsEpisodeAvailable(int episodeId) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativePtr, false); 18 | return NativePtr->IsEpisodeAvailable(episodeId); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVEpisodes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVEpisodes 6 | { 7 | public: 8 | static property IVEpisodes^ TheEpisodesManager 9 | { 10 | public: 11 | IVEpisodes^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(TheEpisodes, nullptr); 14 | return gcnew IVEpisodes(TheEpisodes); 15 | } 16 | void set(IVEpisodes^ value) 17 | { 18 | NULLPTR_CHECK(value); 19 | TheEpisodes = value->NativePtr; 20 | } 21 | } 22 | 23 | public: 24 | bool IsEpisodeAvailable(int episodeId); 25 | 26 | internal: 27 | IVEpisodes(CEpisodes* ptr); 28 | 29 | internal: 30 | CEpisodes* NativePtr; 31 | }; 32 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVExplosion.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVExplosion.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVExplosionInfo::IVExplosionInfo(tExplosionInfo* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeExplosionInfo = nativePtr; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFiDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVFiDevice 6 | { 7 | public: 8 | static property int32_t MaxMountPoints 9 | { 10 | public: 11 | int32_t get() 12 | { 13 | return rage::fiDevice::g_nMaxMountPoints; 14 | } 15 | void set(int32_t value) 16 | { 17 | rage::fiDevice::g_nMaxMountPoints = value; 18 | } 19 | } 20 | 21 | static bool Mount(String^ path, UIntPtr device, bool bUnk1); 22 | static bool Unmount(String^ path); 23 | 24 | public: 25 | property uint32_t VFTable 26 | { 27 | uint32_t get() 28 | { 29 | NULLPTR_CHECK_WITH_RETURN(NativeFiDevice, 0); 30 | return NativeFiDevice->m_pVFTable; 31 | } 32 | void set(uint32_t value) 33 | { 34 | NULLPTR_CHECK(NativeFiDevice); 35 | NativeFiDevice->m_pVFTable = value; 36 | } 37 | } 38 | 39 | public: 40 | static IVFiDevice^ FromUIntPtr(UIntPtr ptr); 41 | UIntPtr GetUIntPtr(); 42 | 43 | uint32_t SetPath(String^ path, bool bAbsolute); 44 | uint32_t SetMountPath(String^ path); 45 | 46 | internal: 47 | IVFiDevice(rage::fiDevice* nativePtr); 48 | 49 | internal: 50 | rage::fiDevice* NativeFiDevice; 51 | 52 | }; 53 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFiPackfile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVFiPackfile 6 | { 7 | public: 8 | static IVFiPackfile^ Create(); 9 | 10 | public: 11 | bool OpenPackfile(String^ path, char unk1_1, char unk2_0, int unk3_0or3); 12 | bool Mount(String^ mountPoint); 13 | 14 | internal: 15 | IVFiPackfile(rage::fiPackfile* nativePtr); 16 | 17 | internal: 18 | rage::fiPackfile* NativePackfile; 19 | }; 20 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFileMgr.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVFileMgr.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | UIntPtr IVFileMgr::OpenFile(String^ sPath, String^ mode) 7 | { 8 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(sPath, UIntPtr::Zero); 9 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(mode, UIntPtr::Zero); 10 | 11 | msclr::interop::marshal_context ctx; 12 | uint8_t* ptr = CFileMgr::OpenFile((char*)ctx.marshal_as(sPath), (char*)ctx.marshal_as(mode)); 13 | NULLPTR_CHECK_WITH_RETURN(ptr, UIntPtr::Zero); 14 | 15 | return UIntPtr(ptr); 16 | } 17 | void IVFileMgr::CloseFile(UIntPtr file) 18 | { 19 | UINTPTR_ZERO_CHECK(file); 20 | CFileMgr::CloseFile((uint8_t*)file.ToPointer()); 21 | } 22 | String^ IVFileMgr::LoadLine(UIntPtr file, int unk) 23 | { 24 | UINTPTR_ZERO_CHECK_WITH_RETURN(file, String::Empty); 25 | 26 | char* ptr = CFileMgr::LoadLine((uint8_t*)file.ToPointer(), unk); 27 | NULLPTR_CHECK_WITH_RETURN(ptr, String::Empty); 28 | 29 | return gcnew String(ptr); 30 | } 31 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFileMgr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVFileMgr 6 | { 7 | public: 8 | static UIntPtr OpenFile(String^ sPath, String^ mode); 9 | static void CloseFile(UIntPtr file); 10 | static String^ LoadLine(UIntPtr file, int unk); 11 | }; 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFont.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVFont.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | void IVFont::Initialise() 7 | { 8 | CFont::Initialise(); 9 | } 10 | void IVFont::SetScale(SizeF scale) 11 | { 12 | CFont::SetScale(scale.Width, scale.Height); 13 | } 14 | void IVFont::SetScale(float x, float y) 15 | { 16 | SetScale(SizeF(x, y)); 17 | } 18 | void IVFont::SetColor(Color color) 19 | { 20 | CFont::SetColor(color.R, color.G, color.B, color.A); 21 | } 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFont.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVFont 6 | { 7 | public: 8 | static void Initialise(); 9 | static void SetScale(SizeF scale); 10 | static void SetScale(float x, float y); 11 | static void SetColor(Color color); 12 | }; 13 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFrontEnd.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVFrontEnd.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Methods / Functions - - - 8 | void IVFrontEnd::SwitchOnWaypoint(int unk_8, Vector2 pos, bool snapToHoveringBlip, [OutAttribute] Vector3% outPos) 9 | { 10 | CVector outVec; 11 | CFrontEnd::SwitchOnWaypoint(unk_8, pos.X, pos.Y, snapToHoveringBlip, &outVec); 12 | outPos = Vector3(outVec.x, outVec.y, outVec.z); 13 | } 14 | void IVFrontEnd::SwitchOnWaypoint(int unk_8, float x, float y, bool snapToHoveringBlip, [OutAttribute] Vector3% outPos) 15 | { 16 | SwitchOnWaypoint(unk_8, Vector2(x, y), snapToHoveringBlip, outPos); 17 | } 18 | void IVFrontEnd::SwitchOffWaypoint() 19 | { 20 | CFrontEnd::SwitchOffWaypoint(); 21 | } 22 | void IVFrontEnd::ToggleWaypoint() 23 | { 24 | CFrontEnd::ToggleWaypoint(); 25 | } 26 | 27 | 28 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVFrontEnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVFrontEnd 6 | { 7 | public: 8 | static property int32_t UserWaypointID 9 | { 10 | public: 11 | int32_t get() 12 | { 13 | return CFrontEnd::g_iUserWaypointID; 14 | } 15 | void set(int32_t value) 16 | { 17 | CFrontEnd::g_iUserWaypointID = value; 18 | } 19 | } 20 | static property Vector2 MapCursor 21 | { 22 | public: 23 | Vector2 get() 24 | { 25 | CVector2D vec = CFrontEnd::vMapCursor; 26 | return Vector2(vec.x, vec.y); 27 | } 28 | void set(Vector2 value) 29 | { 30 | CVector2D vec; 31 | vec.x = value.X; 32 | vec.y = value.Y; 33 | CFrontEnd::vMapCursor = vec; 34 | } 35 | } 36 | 37 | public: 38 | static void SwitchOnWaypoint(int unk_8, Vector2 pos, bool snapToHoveringBlip, [OutAttribute] Vector3% outPos); 39 | static void SwitchOnWaypoint(int unk_8, float x, float y, bool snapToHoveringBlip, [OutAttribute] Vector3% outPos); 40 | static void SwitchOffWaypoint(); 41 | static void ToggleWaypoint(); 42 | }; 43 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGameConfigReader.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGameConfigReader.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVGameConfigReader::IVGameConfigReader(CGameConfigReader* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeConfigReader = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVGameConfigReader::LoadFile(String^ fileName) 16 | { 17 | CHECK_NULL_OR_WHITESPACE_STRING(fileName); 18 | msclr::interop::marshal_context ctx; 19 | NativeConfigReader->LoadFile((char*)ctx.marshal_as(fileName)); 20 | } 21 | 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGameConfigReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGameConfigReader 6 | { 7 | public: 8 | static property IVGameConfigReader^ TheGameConfigReader 9 | { 10 | public: 11 | IVGameConfigReader^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(GameConfigReader, nullptr); 14 | return gcnew IVGameConfigReader(GameConfigReader); 15 | } 16 | void set(IVGameConfigReader^ value) 17 | { 18 | NULLPTR_CHECK(value); 19 | GameConfigReader = value->NativeConfigReader; 20 | } 21 | } 22 | 23 | public: 24 | void LoadFile(String^ fileName); 25 | 26 | internal: 27 | IVGameConfigReader(CGameConfigReader* nativePtr); 28 | 29 | internal: 30 | CGameConfigReader* NativeConfigReader; 31 | }; 32 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGameLogic.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGameLogic.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | bool IVGameLogic::Save() 7 | { 8 | return CGameLogic::Save(); 9 | } 10 | bool IVGameLogic::Load() 11 | { 12 | return CGameLogic::Load(); 13 | } 14 | void IVGameLogic::RestorePlayerStuffDuringResurrection(IVPed^ pPlayerPed, Vector3 newCoors, float newHeading) 15 | { 16 | NULLPTR_CHECK(pPlayerPed); 17 | 18 | CVector vec; 19 | vec.x = newCoors.X; 20 | vec.y = newCoors.Y; 21 | vec.z = newCoors.Z; 22 | 23 | CGameLogic::RestorePlayerStuffDuringResurrection(pPlayerPed->NativePed, vec, newHeading); 24 | } 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGameLogic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGameLogic 6 | { 7 | public: 8 | static property bool PenaltyForDeathApplies 9 | { 10 | public: 11 | bool get() 12 | { 13 | return CGameLogic::bPenaltyForDeathApplies; 14 | } 15 | void set(bool value) 16 | { 17 | CGameLogic::bPenaltyForDeathApplies = value; 18 | } 19 | } 20 | static property bool PenaltyForArrestApplies 21 | { 22 | public: 23 | bool get() 24 | { 25 | return CGameLogic::bPenaltyForArrestApplies; 26 | } 27 | void set(bool value) 28 | { 29 | CGameLogic::bPenaltyForArrestApplies = value; 30 | } 31 | } 32 | 33 | public: 34 | static bool Save(); 35 | static bool Load(); 36 | static void RestorePlayerStuffDuringResurrection(IVPed^ pPlayerPed, Vector3 newCoors, float newHeading); 37 | }; 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGangInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGangInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVGangInfo::IVGangInfo(CGangInfo* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeGangInfo = nativePtr; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGangs.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGangs.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | bool IVGangs::Save() 7 | { 8 | return CGangs::Save();; 9 | } 10 | bool IVGangs::Load() 11 | { 12 | return CGangs::Load();; 13 | } 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGangs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGangs 6 | { 7 | public: 8 | static property array^ GangInfo 9 | { 10 | public: 11 | array^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(CGangs::Gang, nullptr); 14 | 15 | CGangInfo* ptr = CGangs::Gang; 16 | array^ arr = gcnew array(12); 17 | 18 | for (int i = 0; i < arr->Length; i++) 19 | arr[i] = gcnew IVGangInfo(&ptr[i]); 20 | 21 | return arr; 22 | } 23 | void set(array^ value) 24 | { 25 | NULLPTR_CHECK(CGangs::Gang); 26 | NULLPTR_CHECK(value); 27 | 28 | CGangInfo* ptr = CGangs::Gang; 29 | 30 | for (int i = 0; i < value->Length; i++) 31 | ptr[i] = *value[i]->NativeGangInfo; 32 | } 33 | } 34 | 35 | public: 36 | static bool Save(); 37 | static bool Load(); 38 | }; 39 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGarage.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGarage.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVGarage::IVGarage(CGarage* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeGarage = nativePtr; 12 | } 13 | 14 | // - - - Method / Functions - - - 15 | bool IVGarage::IsPointInsideGarage(Vector3 point) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(NativeGarage, false); 18 | 19 | CVector vec; 20 | vec.x = point.X; 21 | vec.y = point.Y; 22 | vec.z = point.Z; 23 | 24 | return NativeGarage->IsPointInsideGarage(vec); 25 | } 26 | void IVGarage::PlayerArrestedOrDied() 27 | { 28 | NULLPTR_CHECK(NativeGarage); 29 | NativeGarage->PlayerArrestedOrDied(); 30 | } 31 | void IVGarage::StoreAndRemoveCarsForThisHideOut(IVStoredCar^ aStoredCars, bool unk) 32 | { 33 | NULLPTR_CHECK(NativeGarage); 34 | // TODO 35 | } 36 | void IVGarage::TidyUpGarageClose() 37 | { 38 | NULLPTR_CHECK(NativeGarage); 39 | NativeGarage->TidyUpGarageClose(); 40 | } 41 | void IVGarage::Update() 42 | { 43 | NULLPTR_CHECK(NativeGarage); 44 | NativeGarage->Update(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGarages.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGarages.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | bool IVGarages::CameraShouldBeOutside() 7 | { 8 | return CGarages::CameraShouldBeOutside(); 9 | } 10 | void IVGarages::CloseHideOutGaragesBeforeSave(bool unk) 11 | { 12 | CGarages::CloseHideOutGaragesBeforeSave(unk); 13 | } 14 | void IVGarages::Init() 15 | { 16 | CGarages::Init(); 17 | } 18 | bool IVGarages::Load() 19 | { 20 | return CGarages::Load(); 21 | } 22 | void IVGarages::PlayerArrestedOrDied() 23 | { 24 | CGarages::PlayerArrestedOrDied(); 25 | } 26 | bool IVGarages::Save() 27 | { 28 | return CGarages::Save(); 29 | } 30 | void IVGarages::Shutdown() 31 | { 32 | CGarages::Shutdown(); 33 | } 34 | void IVGarages::Update() 35 | { 36 | CGarages::Update(); 37 | } 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGenericGameStorage.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGenericGameStorage.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | String^ IVGenericGameStorage::GetDefaultPCSaveFileName() 7 | { 8 | return gcnew String(CGenericGameStorage::GetDefaultPCSaveFileName()); 9 | } 10 | void IVGenericGameStorage::MakeValidSaveName(String^ pString, int slotNumber) 11 | { 12 | CHECK_NULL_OR_WHITESPACE_STRING(pString); 13 | msclr::interop::marshal_context ctx; 14 | CGenericGameStorage::MakeValidSaveName(ctx.marshal_as(pString), slotNumber); 15 | } 16 | bool IVGenericGameStorage::SaveDataToWorkBuffer(IntPtr pData, int32_t sizeOfData) 17 | { 18 | INTPTR_ZERO_CHECK_WITH_RETURN(pData, false); 19 | return CGenericGameStorage::SaveDataToWorkBuffer(pData.ToPointer(), sizeOfData); 20 | } 21 | bool IVGenericGameStorage::LoadDataFromWorkBuffer(IntPtr pData, int32_t sizeOfData) 22 | { 23 | INTPTR_ZERO_CHECK_WITH_RETURN(pData, false); 24 | return CGenericGameStorage::LoadDataFromWorkBuffer(pData.ToPointer(), sizeOfData); 25 | } 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGenericGameStorage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGenericGameStorage 6 | { 7 | public: 8 | static property String^ ValidSaveName 9 | { 10 | public: 11 | String^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(CGenericGameStorage::ms_ValidSaveName, String::Empty); 14 | return gcnew String(CGenericGameStorage::ms_ValidSaveName); 15 | } 16 | void set(String^ value) 17 | { 18 | CHECK_NULL_OR_WHITESPACE_STRING(value); 19 | msclr::interop::marshal_context ctx; 20 | CGenericGameStorage::ms_ValidSaveName = (char*)ctx.marshal_as(value); 21 | } 22 | } 23 | 24 | public: 25 | /// 26 | /// Gets the default save file name for GTA IV on PC. 27 | /// 28 | /// Will return "SGTA4". 29 | static String^ GetDefaultPCSaveFileName(); 30 | static void MakeValidSaveName(String^ pString, int slotNumber); 31 | static bool SaveDataToWorkBuffer(IntPtr pData, int32_t sizeOfData); 32 | static bool LoadDataFromWorkBuffer(IntPtr pData, int32_t sizeOfData); 33 | 34 | }; 35 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGlobalScene.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGlobalScene.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVGlobalScene::IVGlobalScene(tGlobalScene* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeGlobalScene = nativePtr; 11 | } 12 | 13 | // - - - Methods / Functions - - - 14 | IVGlobalScene IVGlobalScene::FromUIntPtr(UIntPtr ptr) 15 | { 16 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, IVGlobalScene()); 17 | return IVGlobalScene((tGlobalScene*)ptr.ToPointer()); 18 | } 19 | UIntPtr IVGlobalScene::GetUIntPtr() 20 | { 21 | NULLPTR_CHECK_WITH_RETURN(NativeGlobalScene, UIntPtr::Zero); 22 | return UIntPtr(NativeGlobalScene); 23 | } 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGrcTexture.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGrcTexture.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVGrcTexture::IVGrcTexture(rage::grcTexture* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeTexture = nativePtr; 11 | } 12 | IVGrcTexturePC::IVGrcTexturePC(rage::grcTexturePC* nativePtr) : IVGrcTexture(nativePtr) 13 | { 14 | NULLPTR_CHECK(nativePtr); 15 | NativeTexturePC = nativePtr; 16 | } 17 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGrcTexture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGrcTexture 6 | { 7 | internal: 8 | IVGrcTexture(rage::grcTexture* nativePtr); 9 | 10 | internal: 11 | rage::grcTexture* NativeTexture; 12 | }; 13 | 14 | public ref class IVGrcTexturePC : IVGrcTexture 15 | { 16 | public: 17 | property UIntPtr D3DTexture 18 | { 19 | public: 20 | UIntPtr get() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeTexturePC, UIntPtr::Zero); 23 | return UIntPtr(NativeTexturePC->m_pD3DTexture); 24 | } 25 | void set(UIntPtr value) 26 | { 27 | UINTPTR_ZERO_CHECK(value); 28 | NativeTexturePC->m_pD3DTexture = (LPDIRECT3DTEXTURE9)value.ToPointer(); 29 | } 30 | } 31 | 32 | internal: 33 | IVGrcTexturePC(rage::grcTexturePC* nativePtr); 34 | 35 | internal: 36 | rage::grcTexturePC* NativeTexturePC; 37 | }; 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGrcTextureFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGrcTextureFactory 6 | { 7 | internal: 8 | IVGrcTextureFactory(rage::grcTextureFactory* nativePtr); 9 | 10 | internal: 11 | rage::grcTextureFactory* NativeTextureFactory; 12 | }; 13 | 14 | public ref class IVGrcTextureFactoryPC : IVGrcTextureFactory 15 | { 16 | public: 17 | static property IVGrcTextureFactoryPC^ TheTextureFactory 18 | { 19 | public: 20 | IVGrcTextureFactoryPC^ get() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(rage::TextureFactory, nullptr); 23 | return gcnew IVGrcTextureFactoryPC(rage::TextureFactory); 24 | } 25 | void set(IVGrcTextureFactoryPC^ value) 26 | { 27 | NULLPTR_CHECK(value); 28 | rage::TextureFactory = value->NativeTextureFactoryPC; 29 | } 30 | } 31 | 32 | public: 33 | IVGrcTexturePC^ CreateTexture(String^ sName, UIntPtr pUnk); 34 | 35 | internal: 36 | IVGrcTextureFactoryPC(rage::grcTextureFactoryPC* nativePtr); 37 | 38 | internal: 39 | rage::grcTextureFactoryPC* NativeTextureFactoryPC; 40 | }; 41 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGrcWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGrcWindow.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Methods / Functions - - - 8 | bool IVGrcWindow::ProcessWindowMessage() 9 | { 10 | return rage::grcWindow::ProcessWindowMessage(); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGrcWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVGrcWindow 6 | { 7 | public: 8 | static bool ProcessWindowMessage(); 9 | }; 10 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVGtaFragType.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVGtaFragType.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVGtaFragType::IVGtaFragType(gtaFragType* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeGtaFragType = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVGtaFragType^ IVGtaFragType::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVGtaFragType((gtaFragType*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVGtaFragType::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeGtaFragType, UIntPtr::Zero); 23 | return UIntPtr(NativeGtaFragType); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVHandlingData.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVHandlingData.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVHandlingDataModelFlags::IVHandlingDataModelFlags(tHandlingData* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeHandlingData = nativePtr; 12 | } 13 | IVHandlingDataHandlingFlags::IVHandlingDataHandlingFlags(tHandlingData* nativePtr) 14 | { 15 | NULLPTR_CHECK(nativePtr); 16 | NativeHandlingData = nativePtr; 17 | } 18 | IVHandlingData::IVHandlingData(tHandlingData* nativePtr) 19 | { 20 | NULLPTR_CHECK(nativePtr); 21 | NativeHandlingData = nativePtr; 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVHandlingDataMgr.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVHandlingDataMgr.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | void IVHandlingDataMgr::Initialise() 7 | { 8 | cHandlingDataMgr::Initialise(); 9 | } 10 | void IVHandlingDataMgr::LoadHandlingData(String^ sPath) 11 | { 12 | CHECK_NULL_OR_WHITESPACE_STRING(sPath); 13 | msclr::interop::marshal_context ctx; 14 | cHandlingDataMgr::LoadHandlingData((char*)ctx.marshal_as(sPath)); 15 | } 16 | IVHandlingData^ IVHandlingDataMgr::GetHandlingData(int id) 17 | { 18 | tHandlingData* ptr = cHandlingDataMgr::GetHandlingData(id); 19 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 20 | return gcnew IVHandlingData(ptr); 21 | } 22 | int IVHandlingDataMgr::GetHandlingId(String^ handlingName) 23 | { 24 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(handlingName, 0); 25 | msclr::interop::marshal_context ctx; 26 | return cHandlingDataMgr::GetHandlingId((char*)ctx.marshal_as(handlingName)); 27 | } 28 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVHudColours.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVHudColours.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVHudColours.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVHudColours 6 | { 7 | public: 8 | static property Color HudColour 9 | { 10 | public: 11 | Color get() 12 | { 13 | CRGBA* v = CHudColours::ms_HudColour; 14 | NULLPTR_CHECK_WITH_RETURN(v, Color::Empty); 15 | return Color::FromArgb(v->a, v->r, v->g, v->b); 16 | } 17 | void set(Color value) 18 | { 19 | CRGBA* v = CHudColours::ms_HudColour; 20 | NULLPTR_CHECK(v); 21 | 22 | v->a = value.A; 23 | v->r = value.R; 24 | v->g = value.G; 25 | v->b = value.B; 26 | } 27 | } 28 | }; 29 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVInteriorInst.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVInteriorInst.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVInteriorInst::IVInteriorInst(CInteriorInst* nativePtr) : IVBuilding(nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NaiveInteriorInst = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVInteriorInst.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVInteriorInst : IVBuilding 6 | { 7 | internal: 8 | IVInteriorInst(CInteriorInst* nativePtr); 9 | 10 | internal: 11 | CInteriorInst* NaiveInteriorInst; 12 | }; 13 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVIplStore.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVIplStore.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | void IVIplStore::LoadIpls(Vector3 pos, bool unk) 8 | { 9 | CIplStore::LoadIpls(Vector3ToCVector(pos), unk); 10 | } 11 | void IVIplStore::SetIplsRequired(Vector3 pos) 12 | { 13 | CIplStore::SetIplsRequired(Vector3ToCVector(pos)); 14 | } 15 | void IVIplStore::SetIfIplIsRequiredAtPos(Vector2 pos, UIntPtr def) 16 | { 17 | UINTPTR_ZERO_CHECK(def); 18 | SetIfIplIsRequired(&Vector2ToCVector2D(pos), (IplDef*)def.ToPointer()); 19 | } 20 | void IVIplStore::SetIfIplIsRequiredAtPosReducedBB(Vector2 pos, UIntPtr def) 21 | { 22 | UINTPTR_ZERO_CHECK(def); 23 | SetIfIplIsRequiredReducedBB(&Vector2ToCVector2D(pos), (IplDef*)def.ToPointer()); 24 | } 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVMenuManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVMenuManager.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | uint32_t IVMenuManager::GetSetting(eSettings setting) 8 | { 9 | return AddressSetter::GetRef(0xCC7A00 + (uint32_t)setting, 0xCFC0D0 + (uint32_t)setting); 10 | } 11 | void IVMenuManager::SetSetting(eSettings setting, uint32_t value) 12 | { 13 | AddressSetter::GetRef(0xCC7A00 + (uint32_t)setting, 0xCFC0D0 + (uint32_t)setting) = value; 14 | } 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVNetwork.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVNetwork.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVNetwork::IsNetworkGameRunning() 8 | { 9 | return CNetwork::IsNetworkGameRunning(); 10 | } 11 | bool IVNetwork::IsNetworkSession() 12 | { 13 | return CNetwork::IsNetworkSession(); 14 | } 15 | void IVNetwork::CheckFramerate(bool bUnk, int time) 16 | { 17 | CNetwork::CheckFramerate(bUnk, time); 18 | } 19 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVObject.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVObject.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVObject::IVObject(CObject* nativePtr) : IVPhysical(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeObject = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVObject^ IVObject::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVObject((CObject*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVObject::GetUIntPtr() 21 | { 22 | return UIntPtr(NativeObject); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVObject : IVPhysical 6 | { 7 | public: 8 | /// 9 | /// This is set by SET_OBJECT_SCALE but unused. 10 | /// 11 | property float Scale 12 | { 13 | public: 14 | float get() 15 | { 16 | NULLPTR_CHECK_WITH_RETURN(NativeObject, 0.0F); 17 | return NativeObject->m_fScale; 18 | } 19 | void set(float value) 20 | { 21 | NULLPTR_CHECK(NativeObject); 22 | NativeObject->m_fScale = value; 23 | } 24 | } 25 | 26 | public: 27 | static IVObject^ FromUIntPtr(UIntPtr ptr); 28 | UIntPtr GetUIntPtr(); 29 | 30 | internal: 31 | IVObject(CObject* nativePtr); 32 | 33 | internal: 34 | CObject* NativeObject; 35 | }; 36 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPad.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPad.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPad::IVPad(CPad* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePad = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPad^ IVPad::GetPad() 16 | { 17 | CPad* ptr = CPad::GetPad(); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVPad(ptr); 20 | } 21 | 22 | IVPad^ IVPad::FromUIntPtr(UIntPtr ptr) 23 | { 24 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 25 | return gcnew IVPad((CPad*)ptr.ToPointer()); 26 | } 27 | UIntPtr IVPad::GetUIntPtr() 28 | { 29 | NULLPTR_CHECK_WITH_RETURN(NativePad, UIntPtr::Zero); 30 | return UIntPtr(NativePad); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPadValues.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPadValues.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPadValues::IVPadValues(tPadValues* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativePadValues = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPcSave.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPcSave.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | int IVPcSave::SaveSlot(int32_t slotNum) 7 | { 8 | return C_PcSave::SaveSlot(slotNum); 9 | } 10 | int IVPcSave::LoadSlot(int32_t slotNum) 11 | { 12 | return C_PcSave::LoadSlot(slotNum);; 13 | } 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPcSave.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPcSave 6 | { 7 | public: 8 | // slot -1 is autosave 9 | static int SaveSlot(int32_t slotNum); 10 | static int LoadSlot(int32_t slotNum); 11 | }; 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedComponentModels.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedComponentModels.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedComponentModels::IVPedComponentModels(tPedComponentModels* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePedComponentModels = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedComponentModels^ IVPedComponentModels::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedComponentModels((tPedComponentModels*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedComponentModels::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedComponentModels, UIntPtr::Zero); 23 | return UIntPtr(NativePedComponentModels); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedDrawableInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedDrawableInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedDrawableInfo::IVPedDrawableInfo(tPedDrawableInfo* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePedDrawableInfo = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedDrawableInfo^ IVPedDrawableInfo::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedDrawableInfo((tPedDrawableInfo*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedDrawableInfo::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedDrawableInfo, UIntPtr::Zero) 23 | return UIntPtr(NativePedDrawableInfo); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedFactoryNY.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPedFactoryNY 6 | { 7 | public: 8 | static property IVPedFactoryNY^ ThePedFactory 9 | { 10 | public: 11 | IVPedFactoryNY^ get() 12 | { 13 | CPedFactoryNY* ptr = PedFactory; 14 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 15 | return gcnew IVPedFactoryNY(ptr); 16 | } 17 | } 18 | 19 | public: 20 | IVPed^ CreatePed(IVControlledByInfo info, int32_t model, IVMatrix mat, bool bNetwork, bool bUnk1); 21 | IVPed^ CreatePed(IVControlledByInfo info, int32_t model, Vector3 pos, bool bNetwork, bool bUnk1); 22 | int DeletePed(IVPed^ ped); 23 | 24 | internal: 25 | IVPedFactoryNY(CPedFactoryNY* nativePtr); 26 | 27 | internal: 28 | CPedFactoryNY* NativePedFactoryNY; 29 | }; 30 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedIntelligence.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedIntelligence.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedIntelligence::IVPedIntelligence(CPedIntelligence* nativePedIntelligence) 9 | { 10 | NULLPTR_CHECK(nativePedIntelligence); 11 | NativePedIntelligence = nativePedIntelligence; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedIntelligence^ IVPedIntelligence::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedIntelligence((CPedIntelligence*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedIntelligence::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedIntelligence, UIntPtr::Zero); 23 | return UIntPtr(NativePedIntelligence); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedIntelligenceNY.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedIntelligenceNY.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedIntelligenceNY::IVPedIntelligenceNY(CPedIntelligenceNY* nativePedIntelligenceNY) : IVPedIntelligence(nativePedIntelligenceNY) 9 | { 10 | NULLPTR_CHECK(nativePedIntelligenceNY); 11 | NativePedIntelligenceNY = nativePedIntelligenceNY; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedIntelligenceNY^ IVPedIntelligenceNY::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedIntelligenceNY((CPedIntelligenceNY*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedIntelligenceNY::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedIntelligenceNY, UIntPtr::Zero); 23 | return UIntPtr(NativePedIntelligenceNY); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedModelInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPedModelInfo::IVPedModelInfo(CPedModelInfo* nativePtr) : IVBaseModelInfo(nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativePedModelInfo = nativePtr; 11 | } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedMoveBlendOnFoot.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedMoveBlendOnFoot.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedMoveBlendOnFoot::IVPedMoveBlendOnFoot(CPedMoveBlendOnFoot* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePedMoveBlendOnFoot = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedMoveBlendOnFoot^ IVPedMoveBlendOnFoot::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedMoveBlendOnFoot((CPedMoveBlendOnFoot*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedMoveBlendOnFoot::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedMoveBlendOnFoot, UIntPtr::Zero); 23 | return UIntPtr(NativePedMoveBlendOnFoot); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedTasks.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedTasks.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedTasks::IVPedTasks(CPedTasks* nativePedTasks) 9 | { 10 | NULLPTR_CHECK(nativePedTasks); 11 | NativePedTasks = nativePedTasks; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedTasks^ IVPedTasks::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedTasks((CPedTasks*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedTasks::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedTasks, UIntPtr::Zero); 23 | return UIntPtr(NativePedTasks); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedType.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedType.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVPedType::IsPedTypePlayer(String^ type) 8 | { 9 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(type, false); 10 | msclr::interop::marshal_context ctx; 11 | return CPedType::IsPedTypePlayer((char*)ctx.marshal_as(type)); 12 | } 13 | int IVPedType::FindPedType(String^ type) 14 | { 15 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(type, 0); 16 | msclr::interop::marshal_context ctx; 17 | return CPedType::FindPedType((char*)ctx.marshal_as(type)); 18 | } 19 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPedType 6 | { 7 | public: 8 | 9 | /// 10 | /// Checks if the given type is a player. 11 | /// If true, the game sets CPedModelInfo::m_bStreamedPed to 1. 12 | /// 13 | /// The ped type to check. 14 | /// True if the type is PLAYER1, PLAYER2, PLAYER_NETWORK or PLAYER_UNUSED. 15 | static bool IsPedTypePlayer(String^ type); 16 | 17 | /// 18 | /// Gets the pedtype id from string. 19 | /// 20 | /// The ped type to get the id from. 21 | /// The id from the given type. 22 | static int FindPedType(String^ type); 23 | 24 | }; 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedWeaponSlot.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedWeaponSlot.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPedWeaponSlot::IVPedWeaponSlot(PedWeaponSlot* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativePedWeaponSlot = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPedWeapons.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPedWeapons.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPedWeapons::IVPedWeapons(PedWeapons* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePedWeapons = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPedWeapons^ IVPedWeapons::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPedWeapons((PedWeapons*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPedWeapons::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePedWeapons, UIntPtr::Zero); 23 | return UIntPtr(NativePedWeapons); 24 | } 25 | 26 | void IVPedWeapons::GiveWeapon(int weaponType, uint32_t ammoQuantity, bool unk1, bool unk2, bool unk3) 27 | { 28 | NULLPTR_CHECK(NativePedWeapons); 29 | NativePedWeapons->GiveWeapon(weaponType, ammoQuantity, unk1, unk2, unk3); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhArchetypeGta.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhArchetypeGta.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPhArchetypeGta::IVPhArchetypeGta(phArchetypeGta* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePhArchetypeGta = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPhArchetypeGta^ IVPhArchetypeGta::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPhArchetypeGta((phArchetypeGta*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPhArchetypeGta::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePhArchetypeGta, UIntPtr::Zero); 23 | return UIntPtr(NativePhArchetypeGta); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhBound.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhBound.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPhBound::IVPhBound(rage::phBound* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeBound = nativePtr; 11 | } 12 | IVPhBoundComposite::IVPhBoundComposite(rage::phBoundComposite* nativePtr) : IVPhBound(nativePtr) 13 | { 14 | NULLPTR_CHECK(nativePtr); 15 | NativeBoundComposite = nativePtr; 16 | } 17 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhBound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPhBound 6 | { 7 | internal: 8 | IVPhBound(rage::phBound* nativePtr); 9 | 10 | internal: 11 | rage::phBound* NativeBound; 12 | }; 13 | 14 | public ref class IVPhBoundComposite : IVPhBound 15 | { 16 | internal: 17 | IVPhBoundComposite(rage::phBoundComposite* nativePtr); 18 | 19 | internal: 20 | rage::phBoundComposite* NativeBoundComposite; 21 | }; 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhInst.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhInst.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPhInst::IVPhInst(rage::phInst* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativePhInst = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhInstGta.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhInstGta.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPhInstGta::IVPhInstGta(phInstGta* nativePtr) : IVPhInst(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePhInstGta = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPhInstGta^ IVPhInstGta::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPhInstGta((phInstGta*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPhInstGta::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePhInstGta, UIntPtr::Zero); 23 | return UIntPtr(NativePhInstGta); 24 | } 25 | 26 | IVPhInstGta^ IVPhInstGta::DetachFragmentGroup(uint32_t groupId) 27 | { 28 | NULLPTR_CHECK_WITH_RETURN(NativePhInstGta, nullptr); 29 | 30 | phInstGta* ptr = NativePhInstGta->DetachFragmentGroup(groupId); 31 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 32 | 33 | return gcnew IVPhInstGta(ptr); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhSleep.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhSleep.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVPhSleep::IVPhSleep(rage::phSleep* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeSleep = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhSleep.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPhSleep 6 | { 7 | public: 8 | property float MinVelocity 9 | { 10 | public: 11 | float get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeSleep, 0.0F); 14 | return NativeSleep->m_fMinVelocity; 15 | } 16 | void set(float value) 17 | { 18 | NULLPTR_CHECK(NativeSleep); 19 | NativeSleep->m_fMinVelocity = value; 20 | } 21 | } 22 | 23 | internal: 24 | IVPhSleep(rage::phSleep* nativePtr); 25 | 26 | internal: 27 | rage::phSleep* NativeSleep; 28 | }; 29 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPhoneInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPhoneInfo.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVPhoneInfo::IVPhoneInfo(sPhoneInfo* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativePhoneInfo = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVPhoneInfo^ IVPhoneInfo::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVPhoneInfo((sPhoneInfo*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVPhoneInfo::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativePhoneInfo, UIntPtr::Zero); 23 | return UIntPtr(NativePhoneInfo); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVPools 6 | { 7 | public: 8 | static IVPool^ GetPedPool(); 9 | static IVPool^ GetVehiclePool(); 10 | static IVPool^ GetBuildingPool(); 11 | static IVPool^ GetObjectPool(); 12 | static IVPool^ GetCameraPool(); 13 | static IVPool^ GetTaskPool(); 14 | static IVPool^ GetInteriorInstPool(); 15 | static IVPool^ GetVehicleStructPool(); 16 | static IVPool^ GetPedMoveBlendPool(); 17 | static IVPool^ GetDummyPedPool(); 18 | static IVPool^ GetDummyTaskPool(); 19 | static IVPool^ GetUnkPedDataPool(); 20 | static IVPool^ GetPedIntelligencePool(); 21 | static IVPool^ GetAnimBlenderPool(); 22 | static IVPool^ GetFragInstNMGtaPool(); 23 | static IVPool^ GetPedDataPool(); 24 | static IVPool^ GetQuadTreeNodePool(); 25 | static IVPool^ GetTxdPool(); 26 | static IVPool^ GetIplPool(); 27 | static IVPool^ GetPedTargettingPool(); 28 | static IVPool^ GetStuntJumpPool(); 29 | static IVPool^ GetScriptStorePool(); 30 | }; 31 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVPopulation.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVPopulation.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | void IVPopulation::Initialise() 8 | { 9 | CPopulation::Initialise(); 10 | } 11 | void IVPopulation::RemovePed(IVPed^ pPed, bool unk) 12 | { 13 | NULLPTR_CHECK(pPed); 14 | CPopulation::RemovePed(pPed->NativePed, unk); 15 | } 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVProjectileInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVProjectileInfo 6 | { 7 | public: 8 | /// 9 | /// Adds a projectile to the world. 10 | /// 11 | /// The owner of the projectile. 12 | /// The projectile type. Only '4' (Grenade), '5' (Molotov) and '6' (Rocket) worked for me. 13 | /// The actual position of the projectile. 14 | /// Start pos of the projectile? (The actual position of the projectile is read from the given matrix so no idea what this does.) 15 | /// End pos (or direction) of the projectile? 16 | /// Can be null. 17 | /// If the projectile should be synced over the network or not. 18 | /// The projectile object to shoot. Can be null. 19 | /// 20 | static bool AddProjectile(IVEntity^ pEntProjOwner, int projType, IVMatrix pMatrix, Vector3 vecStart, Vector3 vecEnd, IVEntity^ pTargetEntity, bool noMPSync, IVObject^ pProjectileObject); 21 | }; 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVQuadTreeNode.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVQuadTreeNode.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVQuadTreeNode::IVQuadTreeNode(CQuadTreeNode* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeQuadTreeNode = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVQuadTreeNode^ IVQuadTreeNode::Create(RectangleF rect, int levels) 16 | { 17 | CRect* nRect = new CRect(); 18 | nRect->bottom = rect.Bottom; 19 | nRect->left = rect.X; 20 | nRect->right = rect.Right; 21 | nRect->top = rect.Y; 22 | 23 | CQuadTreeNode* ptr = new CQuadTreeNode(nRect, levels); 24 | 25 | delete nRect; 26 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 27 | 28 | return gcnew IVQuadTreeNode(ptr); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRadioStation.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVRadioStation.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVRadioStation::IVRadioStation(CRadioStation* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeRadioStation = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVRadioStation::ForceTrack(String^ trackName, int unk1, int unk2) 16 | { 17 | NULLPTR_CHECK(NativeRadioStation); 18 | 19 | if (String::IsNullOrWhiteSpace(trackName)) 20 | return; 21 | 22 | msclr::interop::marshal_context ctx; 23 | NativeRadioStation->ForceTrack((char*)ctx.marshal_as(trackName), unk1, unk2); 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRadioStation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVRadioStation 6 | { 7 | public: 8 | /// 9 | /// Gets the name of the radio station. 10 | /// 11 | property String^ Name 12 | { 13 | public: 14 | String^ get() 15 | { 16 | NULLPTR_CHECK_WITH_RETURN(NativeRadioStation, String::Empty); 17 | return gcnew String(NativeRadioStation->m_sName); 18 | } 19 | } 20 | 21 | property bool IsFrozen 22 | { 23 | public: 24 | bool get() 25 | { 26 | NULLPTR_CHECK_WITH_RETURN(NativeRadioStation, false); 27 | return NativeRadioStation->m_bFrozen == 0 ? false : true; 28 | } 29 | void set(bool value) 30 | { 31 | NULLPTR_CHECK(NativeRadioStation); 32 | NativeRadioStation->m_bFrozen = value ? 1 : 0; 33 | } 34 | } 35 | 36 | public: 37 | void ForceTrack(String^ trackName, int unk1, int unk2); 38 | 39 | internal: 40 | IVRadioStation(CRadioStation* nativePtr); 41 | 42 | internal: 43 | CRadioStation* NativeRadioStation; 44 | }; 45 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRadioTrackManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVRadioTrackManager.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | IVRadioStation^ IVRadioTrackManager::GetRadioStation(int32_t id) 7 | { 8 | CRadioStation* c = CAERadioTrackManager::GetRadioStation(id); 9 | NULLPTR_CHECK_WITH_RETURN(c, nullptr); 10 | 11 | return gcnew IVRadioStation(c); 12 | } 13 | IVRadioStation^ IVRadioTrackManager::GetRadioStationByName(String^ name) 14 | { 15 | if (String::IsNullOrWhiteSpace(name)) 16 | return nullptr; 17 | 18 | msclr::interop::marshal_context ctx; 19 | 20 | CRadioStation* c = CAERadioTrackManager::GetRadioStationByName((char*)ctx.marshal_as(name)); 21 | NULLPTR_CHECK_WITH_RETURN(c, nullptr); 22 | 23 | return gcnew IVRadioStation(c); 24 | } 25 | IVRadioStation^ IVRadioTrackManager::GetRadioStationByHash(uint32_t hash) 26 | { 27 | CRadioStation* c = CAERadioTrackManager::GetRadioStationByHash(hash); 28 | NULLPTR_CHECK_WITH_RETURN(c, nullptr); 29 | 30 | return gcnew IVRadioStation(c); 31 | } 32 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRenderPhases.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVRenderPhases.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVRenderPhases::IVRenderPhases(tRenderPhases* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeRenderPhases = nativePtr; 11 | } 12 | 13 | // - - - Methods / Functions - - - 14 | IVRenderPhases IVRenderPhases::FromUIntPtr(UIntPtr ptr) 15 | { 16 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, IVRenderPhases()); 17 | return IVRenderPhases((tRenderPhases*)ptr.ToPointer()); 18 | } 19 | UIntPtr IVRenderPhases::GetUIntPtr() 20 | { 21 | NULLPTR_CHECK_WITH_RETURN(NativeRenderPhases, UIntPtr::Zero); 22 | return UIntPtr(NativeRenderPhases); 23 | } 24 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRenderPhases.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public value struct IVRenderPhases 6 | { 7 | public: 8 | // TODO 9 | //property array^ RenderPhases 10 | //{ 11 | //public: 12 | // array^ get() 13 | // { 14 | // NULLPTR_CHECK_WITH_RETURN(NativeRenderPhases, nullptr); 15 | 16 | // CRenderPhase** phases = NativeRenderPhases->m_aRenderPhases; 17 | // NULLPTR_CHECK_WITH_RETURN(phases, nullptr); 18 | 19 | // array^ arr = gcnew array(32); 20 | 21 | // for (int i = 0; i < 32; i++) 22 | // arr[i] = gcnew IVRenderPhases(phases[i]); 23 | 24 | // return arr; 25 | // } 26 | // void set(array^ value) 27 | // { 28 | // NULLPTR_CHECK(NativeRenderPhases); 29 | // NULLPTR_CHECK(value); 30 | // // TODO 31 | // } 32 | //} 33 | 34 | public: 35 | static IVRenderPhases FromUIntPtr(UIntPtr ptr); 36 | UIntPtr GetUIntPtr(); 37 | 38 | internal: 39 | IVRenderPhases(tRenderPhases* nativePtr); 40 | 41 | internal: 42 | tRenderPhases* NativeRenderPhases; 43 | }; 44 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVReplay.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVReplay.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVReplay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVReplay 6 | { 7 | public: 8 | static property uint32_t Mode 9 | { 10 | public: 11 | uint32_t get() 12 | { 13 | return CReplay::Mode; 14 | } 15 | void set(uint32_t value) 16 | { 17 | CReplay::Mode = value; 18 | } 19 | } 20 | }; 21 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRestart.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVRestart.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVRestart::Save() 8 | { 9 | return CRestart::Save(); 10 | } 11 | bool IVRestart::Load() 12 | { 13 | return CRestart::Load(); 14 | } 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVRmcDrawable.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVRmcDrawable.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVRmcDrawable::IVRmcDrawable(rage::rmcDrawable* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeRmcDrawable = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSDKDotNetWrapper.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Mixed 5 | WindowsLocalDebugger 6 | C:\Games\GTAIV 1080 IV-SDK .NET WO Radio\GTAIV.exe 7 | C:\Games\GTAIV 1080 IV-SDK .NET WO Radio 8 | 9 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSafehouse.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVSafehouse.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVSafehouse::IVSafehouse(CRestart::tSafehouse* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeSafehouse = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSaveGarage.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVSaveGarage.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVSaveGarage::IVSaveGarage(CSaveGarage* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeSaveGarage = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVSaveGarage::CopyGarageIntoSaveGarage(IVGarage^ pGarage) 16 | { 17 | NULLPTR_CHECK(NativeSaveGarage); 18 | NULLPTR_CHECK(pGarage); 19 | NativeSaveGarage->CopyGarageIntoSaveGarage(pGarage->NativeGarage); 20 | } 21 | void IVSaveGarage::CopyGarageOutOfSaveGarage(IVGarage^ pGarage) 22 | { 23 | NULLPTR_CHECK(NativeSaveGarage); 24 | NULLPTR_CHECK(pGarage); 25 | NativeSaveGarage->CopyGarageOutOfSaveGarage(pGarage->NativeGarage); 26 | } 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVShaderLib.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVShaderLib.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | int IVShaderLib::GetTechniqueID(String^ name) 8 | { 9 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(name, 0); 10 | msclr::interop::marshal_context ctx; 11 | return CShaderLib::GetTechniqueID((char*)ctx.marshal_as(name)); 12 | } 13 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVShaderLib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVShaderLib 6 | { 7 | public: 8 | /// 9 | /// Gets the technique id based on the technique name. 10 | /// 11 | /// The name of the technique like default, unlit, deferred, etc. 12 | /// The technique id. 13 | static int GetTechniqueID(String^ name); 14 | }; 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSkyDome.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVSkyDome.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVSkyDome::IVSkyDome(rage::SkyDome* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeSkyDome = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSkyhatMiniNoise.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVSkyhatMiniNoise.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVSkyhatMiniNoise::IVSkyhatMiniNoise(rage::SkyhatMiniNoise* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeSkyhatMiniNoise = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSprite2D.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVSprite2D.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVSprite2D::IVSprite2D(CSprite2d* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeSprite2D = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVSprite2D^ IVSprite2D::FromUIntPtr(UIntPtr ptr) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 18 | return gcnew IVSprite2D((CSprite2d*)ptr.ToPointer()); 19 | } 20 | UIntPtr IVSprite2D::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeSprite2D, UIntPtr::Zero); 23 | return UIntPtr(NativeSprite2D); 24 | } 25 | 26 | void IVSprite2D::SetTexture(String^ sName) 27 | { 28 | NULLPTR_CHECK(NativeSprite2D); 29 | CHECK_NULL_OR_WHITESPACE_STRING(sName); 30 | 31 | msclr::interop::marshal_context ctx; 32 | NativeSprite2D->SetTexture((char*)ctx.marshal_as(sName)); 33 | } 34 | void IVSprite2D::Delete() 35 | { 36 | NULLPTR_CHECK(NativeSprite2D); 37 | NativeSprite2D->Delete(); 38 | } 39 | 40 | 41 | 42 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVSprite2D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVSprite2D 6 | { 7 | public: 8 | property IVGrcTexturePC^ Texture 9 | { 10 | public: 11 | IVGrcTexturePC^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeSprite2D, nullptr); 14 | return gcnew IVGrcTexturePC(NativeSprite2D->m_pTexture); 15 | } 16 | void set(IVGrcTexturePC^ value) 17 | { 18 | NULLPTR_CHECK(NativeSprite2D); 19 | NULLPTR_CHECK(value); 20 | NativeSprite2D->m_pTexture = value->NativeTexturePC; 21 | } 22 | } 23 | 24 | public: 25 | void SetTexture(String^ sName); 26 | void Delete(); 27 | 28 | public: 29 | static IVSprite2D^ FromUIntPtr(UIntPtr ptr); 30 | UIntPtr GetUIntPtr(); 31 | 32 | internal: 33 | IVSprite2D(CSprite2d* nativePtr); 34 | 35 | internal: 36 | CSprite2d* NativeSprite2D; 37 | }; 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStats.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVStats.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | float IVStats::GetStatValue(uint16_t index) 8 | { 9 | return CStats::GetStatValue(index); 10 | } 11 | void IVStats::SetStatValue(uint16_t index, float newValue) 12 | { 13 | CStats::SetStatValue(index, newValue); 14 | } 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVStats 6 | { 7 | public: 8 | static property String^ LastMissionPassedName 9 | { 10 | public: 11 | String^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(CStats::LastMissionPassedName, nullptr); 14 | return gcnew String(CStats::LastMissionPassedName); 15 | } 16 | } 17 | 18 | public: 19 | static float GetStatValue(uint16_t index); 20 | static void SetStatValue(uint16_t index, float newValue); 21 | 22 | }; 23 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStore.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVStore.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVStore::IVStore(uint32_t* nativePtr, eStoreType storeType) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeStore = nativePtr; 12 | StoreType = storeType; 13 | } 14 | 15 | // - - - Methods / Functions - - - 16 | 17 | template 18 | CStore* IVStore::GetNativeStore() 19 | { 20 | return (CStore*)NativeStore; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStoredCar.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVStoredCar.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVStoredCar::IVStoredCar(CStoredCar* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeStoredCar = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | void IVStoredCar::StoreCar(UIntPtr pCar) 16 | { 17 | NULLPTR_CHECK(NativeStoredCar); 18 | UINTPTR_ZERO_CHECK(pCar); 19 | NativeStoredCar->StoreCar((CVehicle*)pCar.ToPointer()); 20 | } 21 | void IVStoredCar::RestoreCar() 22 | { 23 | NULLPTR_CHECK(NativeStoredCar); 24 | NativeStoredCar->RestoreCar(); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStuntJump.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVStuntJump.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVStuntJump::IVStuntJump(CStuntJump* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeStuntJump = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStuntJumpManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVStuntJumpManager.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVStuntJumpManager::Save() 8 | { 9 | return CStuntJumpManager::Save(); 10 | } 11 | bool IVStuntJumpManager::Load() 12 | { 13 | return CStuntJumpManager::Load(); 14 | } 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVStuntJumpManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVStuntJumpManager 6 | { 7 | public: 8 | static property bool Active 9 | { 10 | public: 11 | bool get() 12 | { 13 | return CStuntJumpManager::m_bActive; 14 | } 15 | void set(bool value) 16 | { 17 | CStuntJumpManager::m_bActive = value; 18 | } 19 | } 20 | static property uint32_t NumCompleted 21 | { 22 | public: 23 | uint32_t get() 24 | { 25 | return CStuntJumpManager::m_iNumCompleted; 26 | } 27 | void set(uint32_t value) 28 | { 29 | CStuntJumpManager::m_iNumCompleted = value; 30 | } 31 | } 32 | static property uint32_t NumJumps 33 | { 34 | public: 35 | uint32_t get() 36 | { 37 | return CStuntJumpManager::m_iNumJumps; 38 | } 39 | void set(uint32_t value) 40 | { 41 | CStuntJumpManager::m_iNumJumps = value; 42 | } 43 | } 44 | 45 | public: 46 | static bool Save(); 47 | static bool Load(); 48 | 49 | }; 50 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTask.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTask.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTask::IVTask(CTask* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeBaseTask = nativePtr; 12 | } 13 | IVTaskComplex::IVTaskComplex(CTaskComplex* nativePtr) : IVTask(nativePtr) 14 | { 15 | NULLPTR_CHECK(nativePtr); 16 | NativeComplexTask = nativePtr; 17 | } 18 | IVTaskSimple::IVTaskSimple(CTaskSimple* nativePtr) : IVTask(nativePtr) 19 | { 20 | NULLPTR_CHECK(nativePtr); 21 | NativeSimpleTask = nativePtr; 22 | } 23 | 24 | IVTask^ IVTask::FromUIntPtr(UIntPtr ptr) 25 | { 26 | UINTPTR_ZERO_CHECK_WITH_RETURN(ptr, nullptr); 27 | return gcnew IVTask((CTask*)ptr.ToPointer()); 28 | } 29 | UIntPtr IVTask::GetUIntPtr() 30 | { 31 | NULLPTR_CHECK_WITH_RETURN(NativeBaseTask, UIntPtr::Zero); 32 | return UIntPtr(NativeBaseTask); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexClimbLadder.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexClimbLadder.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexClimbLadder::IVTaskComplexClimbLadder(CTaskComplexClimbLadder* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexClimbLadder^ IVTaskComplexClimbLadder::Create(IVObject^ ladder, int32_t type, uint32_t unk0) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(ladder, nullptr); 18 | CTaskComplexClimbLadder* ptr = new CTaskComplexClimbLadder(ladder->NativeObject, type, unk0); 19 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 20 | return gcnew IVTaskComplexClimbLadder(ptr); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexClimbLadder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexClimbLadder : IVTaskComplex 6 | { 7 | public: 8 | /// 9 | /// Creates a new climb ladder task. 10 | /// 11 | /// The target ladder to climb. 12 | /// Not quite sure what this does. 13 | /// 0 = Only get on the ladder, 1 = Get on and climb, 2 = Get on and climb fast 14 | /// 15 | static IVTaskComplexClimbLadder^ Create(IVObject^ ladder, int32_t type, uint32_t unk0); 16 | 17 | internal: 18 | IVTaskComplexClimbLadder(CTaskComplexClimbLadder* nativePtr); 19 | 20 | internal: 21 | CTaskComplexClimbLadder* NativeTask; 22 | }; 23 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexDie.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexDie.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexDie::IVTaskComplexDie(CTaskComplexDie* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexDie^ IVTaskComplexDie::Create(uint32_t unk, uint32_t unk2, uint32_t unk3_44, uint32_t unk4_190, float fBlendDelta, float fAnimSpeed, uint32_t unk5_1) 16 | { 17 | CTaskComplexDie* ptr = new CTaskComplexDie(unk, unk2, unk3_44, unk4_190, fBlendDelta, fAnimSpeed, unk5_1); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexDie(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexDie.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexDie : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexDie^ Create(uint32_t unk, uint32_t unk2, uint32_t unk3_44, uint32_t unk4_190, float fBlendDelta, float fAnimSpeed, uint32_t unk5_1); 9 | 10 | internal: 11 | IVTaskComplexDie(CTaskComplexDie* nativePtr); 12 | 13 | internal: 14 | CTaskComplexDie* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexInWater.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexInWater.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexInWater::IVTaskComplexInWater(CTaskComplexInWater* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexInWater^ IVTaskComplexInWater::Create(uint32_t unk, uint32_t unk2, bool bUnk) 16 | { 17 | CTaskComplexInWater* ptr = new CTaskComplexInWater(unk, unk2, bUnk); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexInWater(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexInWater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexInWater : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexInWater^ Create(uint32_t unk, uint32_t unk2, bool bUnk); 9 | 10 | internal: 11 | IVTaskComplexInWater(CTaskComplexInWater* nativePtr); 12 | 13 | internal: 14 | CTaskComplexInWater* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexMobileMakeCall.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexMobileMakeCall.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexMobileMakeCall::IVTaskComplexMobileMakeCall(CTaskComplexMobileMakeCall* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexMobileMakeCall^ IVTaskComplexMobileMakeCall::Create(String^ speechLine, bool bUnk1, bool bUnk2) 16 | { 17 | CHECK_NULL_OR_WHITESPACE_STRING_WITH_RETURN(speechLine, nullptr); 18 | 19 | msclr::interop::marshal_context ctx; 20 | CTaskComplexMobileMakeCall* ptr = new CTaskComplexMobileMakeCall((char*)ctx.marshal_as(speechLine), bUnk1, bUnk2); 21 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 22 | 23 | return gcnew IVTaskComplexMobileMakeCall(ptr); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexMobileMakeCall.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexMobileMakeCall : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexMobileMakeCall^ Create(String^ speechLine, bool bUnk1, bool bUnk2); 9 | 10 | internal: 11 | IVTaskComplexMobileMakeCall(CTaskComplexMobileMakeCall* nativePtr); 12 | 13 | internal: 14 | CTaskComplexMobileMakeCall* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexNM.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexNM.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexNM::IVTaskComplexNM(CTaskComplexNM* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexNM^ IVTaskComplexNM::Create(uint32_t nUnk, uint32_t nUnk2, IVTaskSimple^ pSubTask, float fUnk) 16 | { 17 | NULLPTR_CHECK_WITH_RETURN(pSubTask, nullptr); 18 | 19 | CTaskComplexNM* ptr = new CTaskComplexNM(nUnk, nUnk2, pSubTask->NativeSimpleTask, fUnk); 20 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 21 | 22 | return gcnew IVTaskComplexNM(ptr); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexNM.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexNM : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexNM^ Create(uint32_t nUnk, uint32_t nUnk2, IVTaskSimple^ pSubTask, float fUnk); 9 | 10 | internal: 11 | IVTaskComplexNM(CTaskComplexNM* nativePtr); 12 | 13 | internal: 14 | CTaskComplexNM* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexNewGetInVehicle.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexNewGetInVehicle.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexNewGetInVehicle::IVTaskComplexNewGetInVehicle(CTaskComplexNewGetInVehicle* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexNewGetInVehicle^ IVTaskComplexNewGetInVehicle::Create(UIntPtr veh, int32_t getInType, uint32_t unk27, int32_t unk, float fUnk) 16 | { 17 | UINTPTR_ZERO_CHECK_WITH_RETURN(veh, nullptr); 18 | 19 | CTaskComplexNewGetInVehicle* ptr = new CTaskComplexNewGetInVehicle((CVehicle*)veh.ToPointer(), getInType, unk27, unk, fUnk); 20 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 21 | 22 | return gcnew IVTaskComplexNewGetInVehicle(ptr); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexNewGetInVehicle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexNewGetInVehicle : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexNewGetInVehicle^ Create(UIntPtr veh, int32_t getInType, uint32_t unk27, int32_t unk, float fUnk); 9 | 10 | internal: 11 | IVTaskComplexNewGetInVehicle(CTaskComplexNewGetInVehicle* nativePtr); 12 | 13 | internal: 14 | CTaskComplexNewGetInVehicle* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexPlayerOnFoot.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexPlayerOnFoot.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexPlayerOnFoot::IVTaskComplexPlayerOnFoot(CTaskComplexPlayerOnFoot* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexPlayerOnFoot^ IVTaskComplexPlayerOnFoot::Create() 16 | { 17 | CTaskComplexPlayerOnFoot* ptr = new CTaskComplexPlayerOnFoot(); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexPlayerOnFoot(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexPlayerOnFoot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexPlayerOnFoot : IVTaskComplex 6 | { 7 | public: 8 | static IVTaskComplexPlayerOnFoot^ Create(); 9 | 10 | internal: 11 | IVTaskComplexPlayerOnFoot(CTaskComplexPlayerOnFoot* nativePtr); 12 | 13 | internal: 14 | CTaskComplexPlayerOnFoot* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexPlayerSettingsTask.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexPlayerSettingsTask.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexPlayerSettingsTask::IVTaskComplexPlayerSettingsTask(CTaskComplexPlayerSettingsTask* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexPlayerSettingsTask^ IVTaskComplexPlayerSettingsTask::Create(uint32_t unkFromPed) 16 | { 17 | CTaskComplexPlayerSettingsTask* ptr = new CTaskComplexPlayerSettingsTask(unkFromPed); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexPlayerSettingsTask(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexWander.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexWander.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexWander::IVTaskComplexWander(CTaskComplexWander* nativePtr) : IVTaskComplex(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexWander^ IVTaskComplexWander::Create(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1) 16 | { 17 | CTaskComplexWander* ptr = new CTaskComplexWander(moveState, initialDir, bSensibly, targetRadius, unk1); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexWander(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexWander.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexWander : IVTaskComplex 6 | { 7 | public: 8 | property float Unk 9 | { 10 | public: 11 | float get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeTask, 0.0F); 14 | return NativeTask->m_fUnk; 15 | } 16 | void set(float value) 17 | { 18 | NULLPTR_CHECK(NativeTask); 19 | NativeTask->m_fUnk = value; 20 | } 21 | } 22 | 23 | public: 24 | static IVTaskComplexWander^ Create(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1); 25 | 26 | internal: 27 | IVTaskComplexWander(CTaskComplexWander* nativePtr); 28 | 29 | internal: 30 | CTaskComplexWander* NativeTask; 31 | }; 32 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexWanderStandard.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskComplexWanderStandard.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskComplexWanderStandard::IVTaskComplexWanderStandard(CTaskComplexWanderStandard* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskComplexWanderStandard^ IVTaskComplexWanderStandard::Create(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1) 16 | { 17 | CTaskComplexWanderStandard* ptr = new CTaskComplexWanderStandard(moveState, initialDir, bSensibly, targetRadius, unk1); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskComplexWanderStandard(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskComplexWanderStandard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskComplexWanderStandard 6 | { 7 | public: 8 | static IVTaskComplexWanderStandard^ Create(uint32_t moveState, float initialDir, bool bSensibly, float targetRadius, uint32_t unk1); 9 | 10 | internal: 11 | IVTaskComplexWanderStandard(CTaskComplexWanderStandard* nativePtr); 12 | 13 | internal: 14 | CTaskComplexWanderStandard* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleNMHighFall.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskSimpleNMHighFall.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskSimpleNMHighFall::IVTaskSimpleNMHighFall(CTaskSimpleNMHighFall* nativePtr) : IVTaskSimple(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskSimpleNMHighFall^ IVTaskSimpleNMHighFall::Create(uint32_t nUnk, uint32_t nUnk2, uint32_t nUnk3, uint32_t nUnk4) 16 | { 17 | CTaskSimpleNMHighFall* ptr = new CTaskSimpleNMHighFall(nUnk, nUnk2, nUnk3, nUnk4); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskSimpleNMHighFall(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleNMHighFall.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskSimpleNMHighFall : IVTaskSimple 6 | { 7 | public: 8 | static IVTaskSimpleNMHighFall^ Create(uint32_t nUnk, uint32_t nUnk2, uint32_t nUnk3, uint32_t nUnk4); 9 | 10 | internal: 11 | IVTaskSimpleNMHighFall(CTaskSimpleNMHighFall* nativePtr); 12 | 13 | internal: 14 | CTaskSimpleNMHighFall* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleNMJumpRollFromRoadVehicle.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskSimpleNMJumpRollFromRoadVehicle.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskSimpleNMJumpRollFromRoadVehicle::IVTaskSimpleNMJumpRollFromRoadVehicle(CTaskSimpleNMJumpRollFromRoadVehicle* nativePtr) : IVTaskSimple(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskSimpleNMJumpRollFromRoadVehicle^ IVTaskSimpleNMJumpRollFromRoadVehicle::Create(uint32_t time, uint32_t time2) 16 | { 17 | CTaskSimpleNMJumpRollFromRoadVehicle* ptr = new CTaskSimpleNMJumpRollFromRoadVehicle(time, time2); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskSimpleNMJumpRollFromRoadVehicle(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleNMJumpRollFromRoadVehicle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskSimpleNMJumpRollFromRoadVehicle : IVTaskSimple 6 | { 7 | public: 8 | static IVTaskSimpleNMJumpRollFromRoadVehicle^ Create(uint32_t time, uint32_t time2); 9 | 10 | internal: 11 | IVTaskSimpleNMJumpRollFromRoadVehicle(CTaskSimpleNMJumpRollFromRoadVehicle* nativePtr); 12 | 13 | internal: 14 | CTaskSimpleNMJumpRollFromRoadVehicle* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleSidewaysDive.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTaskSimpleSidewaysDive.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVTaskSimpleSidewaysDive::IVTaskSimpleSidewaysDive(CTaskSimpleSidewaysDive* nativePtr) : IVTaskSimple(nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeTask = nativePtr; 12 | } 13 | 14 | // - - - Methods / Functions - - - 15 | IVTaskSimpleSidewaysDive^ IVTaskSimpleSidewaysDive::Create(bool bDirection) 16 | { 17 | CTaskSimpleSidewaysDive* ptr = new CTaskSimpleSidewaysDive(bDirection); 18 | NULLPTR_CHECK_WITH_RETURN(ptr, nullptr); 19 | return gcnew IVTaskSimpleSidewaysDive(ptr); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTaskSimpleSidewaysDive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTaskSimpleSidewaysDive : IVTaskSimple 6 | { 7 | public: 8 | static IVTaskSimpleSidewaysDive^ Create(bool bDirection); 9 | 10 | internal: 11 | IVTaskSimpleSidewaysDive(CTaskSimpleSidewaysDive* nativePtr); 12 | 13 | internal: 14 | CTaskSimpleSidewaysDive* NativeTask; 15 | }; 16 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVText.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVText 6 | { 7 | public: 8 | static property IVText^ TheIVText 9 | { 10 | public: 11 | IVText^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(&TheText, nullptr); 14 | return gcnew IVText(&TheText); 15 | } 16 | } 17 | 18 | public: 19 | String^ Get(String^ ident); 20 | String^ Get(uint32_t hash, String^ ident); 21 | 22 | void ReplaceTextOfTextLabel(String^ ident, String^ newText); 23 | void ReplaceTextOfTextLabel(uint32_t hash, String^ newText); 24 | 25 | internal: 26 | IVText(CText* nativePtr); 27 | 28 | internal: 29 | CText* NativeText; 30 | }; 31 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTheZones.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTheZones.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVTheZones::Save() 8 | { 9 | return CTheZones::Save(); 10 | } 11 | bool IVTheZones::Load() 12 | { 13 | return CTheZones::Load(); 14 | } 15 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTimer.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVTimer.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | bool IVTimer::GetIsPaused() 8 | { 9 | return CTimer::GetIsPaused(); 10 | } 11 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVTxdStore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVTxdStore 6 | { 7 | public: 8 | static void AddRef(int slot); 9 | static int AddTxdSlot(String^ sName); 10 | static int FindTxdSlot(uint32_t nHash); 11 | static int FindTxdSlot(String^ sName); 12 | static bool LoadTxd(int slot, String^ sName); 13 | static void PushCurrentTxd(); 14 | static void SetCurrentTxd(int slot); 15 | static void PopCurrentTxd(); 16 | static IVSprite2D^ GetTexture(String^ sName); 17 | }; 18 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVUnkColliderParams.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVUnkColliderParams.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVUnkColliderParams2::IVUnkColliderParams2(rage::tUnkColliderParams2* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeColliderParams2 = nativePtr; 11 | } 12 | IVUnkColliderParams::IVUnkColliderParams(rage::tUnkColliderParams* nativePtr) 13 | { 14 | NULLPTR_CHECK(nativePtr); 15 | NativeColliderParams = nativePtr; 16 | } 17 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVValueHistory.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVValueHistory.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVValueHistory::IVValueHistory(tValueHistory* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeValueHistory = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVValueHistory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVValueHistory 6 | { 7 | public: 8 | property array^ Items 9 | { 10 | public: 11 | array^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeValueHistory, nullptr); 14 | 15 | array^ arr = gcnew array(64); 16 | 17 | for(int i = 0; i < arr->Length; i++) 18 | { 19 | arr[i] = IVValueHistoryItem(&NativeValueHistory->m_aItems[i]); 20 | } 21 | 22 | return arr; 23 | } 24 | void set(array^ value) 25 | { 26 | NULLPTR_CHECK(NativeValueHistory); 27 | NULLPTR_CHECK(value); 28 | 29 | for(int i = 0; i < value->Length; i++) 30 | NativeValueHistory->m_aItems[i] = *value[i].NativeValueHistoryItem; 31 | } 32 | } 33 | 34 | internal: 35 | IVValueHistory(tValueHistory* nativePtr); 36 | 37 | internal: 38 | tValueHistory* NativeValueHistory; 39 | }; 40 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVValueHistoryItem.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVValueHistoryItem.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVValueHistoryItem::IVValueHistoryItem(tValueHistoryItem* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeValueHistoryItem = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVValueHistoryItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public value struct IVValueHistoryItem 6 | { 7 | public: 8 | property uint8_t Value 9 | { 10 | public: 11 | uint8_t get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeValueHistoryItem, 0); 14 | return NativeValueHistoryItem->m_nValue; 15 | } 16 | void set(uint8_t value) 17 | { 18 | NULLPTR_CHECK(NativeValueHistoryItem); 19 | NativeValueHistoryItem->m_nValue = value; 20 | } 21 | } 22 | property uint32_t LastUpdateTime 23 | { 24 | public: 25 | uint32_t get() 26 | { 27 | NULLPTR_CHECK_WITH_RETURN(NativeValueHistoryItem, 0); 28 | return NativeValueHistoryItem->m_nLastUpdateTime; 29 | } 30 | void set(uint32_t value) 31 | { 32 | NULLPTR_CHECK(NativeValueHistoryItem); 33 | NativeValueHistoryItem->m_nLastUpdateTime = value; 34 | } 35 | } 36 | 37 | internal: 38 | IVValueHistoryItem(tValueHistoryItem* nativePtr); 39 | 40 | internal: 41 | tValueHistoryItem* NativeValueHistoryItem; 42 | }; 43 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVehicleDoor.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVVehicleDoor.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVVehicleDoor::IVVehicleDoor(CVehicleDoor* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeVehicleDoor = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVehicleFactoryNY.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVVehicleFactoryNY 6 | { 7 | public: 8 | static property IVVehicleFactoryNY^ TheVehicleFactory 9 | { 10 | public: 11 | IVVehicleFactoryNY^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(VehicleFactory, nullptr); 14 | return gcnew IVVehicleFactoryNY(VehicleFactory); 15 | } 16 | void set(IVVehicleFactoryNY^ value) 17 | { 18 | NULLPTR_CHECK(value); 19 | VehicleFactory = value->NativeVehicleFactoryNY; 20 | } 21 | } 22 | 23 | public: 24 | IVVehicle^ CreateVehicle(int32_t modelIndex, int32_t createdBy, IVMatrix mat, bool bNetwork); 25 | IVVehicle^ CreateVehicle(int32_t modelIndex, int32_t createdBy, Vector3 pos, bool bNetwork); 26 | int DeleteVehicle(IVVehicle^ veh); 27 | 28 | internal: 29 | IVVehicleFactoryNY(CVehicleFactoryNY* nativePtr); 30 | 31 | internal: 32 | CVehicleFactoryNY* NativeVehicleFactoryNY; 33 | }; 34 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVehicleStructure.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVVehicleStructure.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVVehicleStructure::IVVehicleStructure(CVehicleStructure* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeVehicleStructure = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVehicleStructure.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVVehicleStructure 6 | { 7 | public: 8 | property array^ Bones 9 | { 10 | public: 11 | array^ get() 12 | { 13 | NULLPTR_CHECK_WITH_RETURN(NativeVehicleStructure, nullptr); 14 | 15 | array^ arr = gcnew array(102); 16 | 17 | for(int i = 0; i < arr->Length; i++) 18 | arr[i] = NativeVehicleStructure->m_nBones[i]; 19 | 20 | return arr; 21 | } 22 | void set(array^ value) 23 | { 24 | NULLPTR_CHECK(NativeVehicleStructure); 25 | NULLPTR_CHECK(value); 26 | 27 | for(int i = 0; i < value->Length; i++) 28 | NativeVehicleStructure->m_nBones[i] = value[i]; 29 | } 30 | } 31 | 32 | internal: 33 | IVVehicleStructure(CVehicleStructure* nativePtr); 34 | 35 | internal: 36 | CVehicleStructure* NativeVehicleStructure; 37 | }; 38 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVehicleWheel.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVVehicleWheel.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVVehicleWheelFlags::IVVehicleWheelFlags(CVehicleWheel* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeVehicleWheel = nativePtr; 12 | } 13 | IVVehicleWheel::IVVehicleWheel(CVehicleWheel* nativePtr) 14 | { 15 | NULLPTR_CHECK(nativePtr); 16 | NativeVehicleWheel = nativePtr; 17 | } 18 | 19 | // - - - Methods / Functions - - - 20 | UIntPtr IVVehicleWheel::GetUIntPtr() 21 | { 22 | NULLPTR_CHECK_WITH_RETURN(NativeVehicleWheel, UIntPtr::Zero); 23 | return UIntPtr(NativeVehicleWheel); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVViewport.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVViewport.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructors - - - 8 | IVViewport::IVViewport(CViewport* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeViewport = nativePtr; 12 | } 13 | 14 | IVViewportPrimaryOrtho::IVViewportPrimaryOrtho(CViewportPrimaryOrtho* nativePtr) : IVViewport(nativePtr) 15 | { 16 | NULLPTR_CHECK(nativePtr); 17 | NativeViewportPrimaryOrtho = nativePtr; 18 | } 19 | IVViewportGame::IVViewportGame(CViewportGame* nativePtr) : IVViewport(nativePtr) 20 | { 21 | NULLPTR_CHECK(nativePtr); 22 | NativeViewportGame = nativePtr; 23 | } 24 | IVViewportRadar::IVViewportRadar(CViewportRadar* nativePtr) : IVViewport(nativePtr) 25 | { 26 | NULLPTR_CHECK(nativePtr); 27 | NativeViewportRadar = nativePtr; 28 | } 29 | IVViewportMobilePhone::IVViewportMobilePhone(CViewportMobilePhone* nativePtr) : IVViewport(nativePtr) 30 | { 31 | NULLPTR_CHECK(nativePtr); 32 | NativeViewportMobilePhone = nativePtr; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVViewportData.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVViewportData.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Constructor - - - 8 | IVViewportData::IVViewportData(tViewportData* nativePtr) 9 | { 10 | NULLPTR_CHECK(nativePtr); 11 | NativeData = nativePtr; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVVisibilityPlugins.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVVisibilityPlugins.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVWanted.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVWanted.h" 3 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVWanted.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | public ref class IVWanted 6 | { 7 | public: 8 | static property uint32_t MaximumWantedLevel 9 | { 10 | public: 11 | uint32_t get() 12 | { 13 | return CWanted::MaximumWantedLevel; 14 | } 15 | void set(uint32_t value) 16 | { 17 | CWanted::MaximumWantedLevel = value; 18 | } 19 | } 20 | static property uint32_t nMaximumWantedLevel 21 | { 22 | public: 23 | uint32_t get() 24 | { 25 | return CWanted::nMaximumWantedLevel; 26 | } 27 | void set(uint32_t value) 28 | { 29 | CWanted::nMaximumWantedLevel = value; 30 | } 31 | } 32 | }; 33 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVWeather.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVWeather.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Methods / Functions - - - 7 | void IVWeather::ForceWeatherNow(int type) 8 | { 9 | CWeather::ForceWeatherNow(type); 10 | } 11 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/IVZone.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "IVZone.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | // - - - Constructor - - - 7 | IVZone::IVZone(CZone* nativePtr) 8 | { 9 | NULLPTR_CHECK(nativePtr); 10 | NativeZone = nativePtr; 11 | } 12 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/ImGui/ImGuiIncludes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define IMGUI_DEFINE_MATH_OPERATORS 4 | 5 | #include "imconfig.h" 6 | #include "imgui.h" 7 | #include "imgui_stdlib.h" 8 | #include "imgui_internal.h" 9 | #include "imgui_impl_win32.h" 10 | #include "imgui_impl_dx9_shader.h" 11 | #include "imgui_extensions.h" 12 | #include "imgui_hex.h" 13 | #include "imgui_knobs.h" 14 | #include "imspinner.h" 15 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2023 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/ManagedD3D9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Internal only 4 | private ref class ManagedD3D9 5 | { 6 | public: 7 | static bool CreateTextureFromFile(String^ fileName, [OutAttribute] IntPtr% texturePtr, [OutAttribute] int% textureWidth, [OutAttribute] int% textureHeight, [OutAttribute] eResult% result); 8 | static bool CreateTextureFromMemory(array^ data, [OutAttribute] IntPtr% texturePtr, [OutAttribute] int% textureWidth, [OutAttribute] int% textureHeight, [OutAttribute] eResult% result); 9 | static bool ReleaseTexture(IntPtr% texturePtr); 10 | static bool IsTextureValid(IntPtr texturePtr); 11 | }; -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/Patterns.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Patterns.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | namespace Hooking 7 | { 8 | 9 | // - - - Methods / Functions - - - 10 | UIntPtr Patterns::GetAddress(IntPtr moduleAddress, String^ pattern, uint32_t index, uint32_t offset) 11 | { 12 | if (moduleAddress == IntPtr::Zero) 13 | return UIntPtr::Zero; 14 | if (String::IsNullOrWhiteSpace(pattern)) 15 | return UIntPtr::Zero; 16 | 17 | msclr::interop::marshal_context ctx; 18 | 19 | auto scan = hook::pattern(moduleAddress.ToPointer(), std::string_view(ctx.marshal_as(pattern), pattern->Length)); 20 | 21 | return UIntPtr(scan.get(index).get(offset)); 22 | } 23 | UIntPtr Patterns::GetAddress(String^ pattern, uint32_t index, uint32_t offset) 24 | { 25 | if (String::IsNullOrWhiteSpace(pattern)) 26 | return UIntPtr::Zero; 27 | 28 | msclr::interop::marshal_context ctx; 29 | 30 | auto scan = hook::pattern(std::string_view(ctx.marshal_as(pattern), pattern->Length)); 31 | 32 | return UIntPtr(scan.get(index).get(offset)); 33 | } 34 | 35 | } 36 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/Patterns.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | namespace Hooking 6 | { 7 | 8 | public ref class Patterns 9 | { 10 | public: 11 | 12 | /// 13 | /// Scans for the given pattern at the given module and returns the address. 14 | /// 15 | /// The pattern to scan for. 16 | /// Get the match at that index. 17 | /// Offset for the pattern. 18 | /// The address from the given pattern. 19 | static UIntPtr GetAddress(IntPtr moduleAddress, String^ pattern, uint32_t index, uint32_t offset); 20 | 21 | /// 22 | /// Scans for the given pattern and returns the address. 23 | /// 24 | /// The pattern to scan for. 25 | /// Get the match at that index. 26 | /// Offset for the pattern. 27 | /// The address from the given pattern. 28 | static UIntPtr GetAddress(String^ pattern, uint32_t index, uint32_t offset); 29 | 30 | }; 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/TlsHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "TlsHelper.h" 3 | 4 | #pragma unmanaged 5 | 6 | // Read FS:[0x2C] (the linear address of the TLS array on x86) 7 | DWORD_PTR __cdecl _GetTlsContext() 8 | { 9 | return __readfsdword(0x2C); 10 | } 11 | 12 | // Write FS:[0x2C] 13 | void __cdecl _SetTlsContext(DWORD_PTR ctx) 14 | { 15 | __writefsdword(0x2C, static_cast(ctx)); 16 | } 17 | 18 | #pragma managed 19 | 20 | namespace IVSDKDotNet 21 | { 22 | namespace Internal 23 | { 24 | 25 | UIntPtr TlsHelper::GetTlsContext() 26 | { 27 | return UIntPtr(static_cast(_GetTlsContext())); 28 | } 29 | void TlsHelper::SetTlsContext(UIntPtr ctx) 30 | { 31 | _SetTlsContext(static_cast(ctx.ToUInt32())); 32 | } 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/TlsHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace IVSDKDotNet 4 | { 5 | namespace Internal 6 | { 7 | 8 | public ref class TlsHelper 9 | { 10 | public: 11 | /// 12 | /// Gets the current thread local storage context. 13 | /// 14 | static UIntPtr GetTlsContext(); 15 | /// 16 | /// Sets the current thread local storage context. 17 | /// 18 | static void SetTlsContext(UIntPtr ctx); 19 | }; 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/UnsafeMemory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | namespace Internal 7 | { 8 | public ref class UnsafeMemory 9 | { 10 | public: 11 | 12 | static IntPtr MemoryCopy(IntPtr dest, IntPtr source, uint32_t size) 13 | { 14 | return IntPtr(memcpy(dest.ToPointer(), source.ToPointer(), size)); 15 | } 16 | 17 | }; 18 | } 19 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/app.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/app.aps -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/app.ico -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/app.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/app.rc -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/libMinHook-x86-v141-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/libMinHook-x86-v141-mt.lib -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/libMinHook.x86_DBG.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/libMinHook.x86_DBG.lib -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/libMinHook.x86_REL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/IVSDKDotNetWrapper/libMinHook.x86_REL.lib -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/rage.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "rage.h" 3 | 4 | namespace IVSDKDotNet 5 | { 6 | 7 | // - - - Methods / Functions - - - 8 | IntPtr RAGE::GetHWND() 9 | { 10 | return IntPtr(rage::g_pHWND); 11 | } 12 | IntPtr RAGE::GetDirect3DDevice9() 13 | { 14 | return IntPtr(rage::g_pDirect3DDevice); 15 | } 16 | 17 | uint32_t RAGE::AtStringHash(String^ sString) 18 | { 19 | msclr::interop::marshal_context ctx; 20 | return rage::atStringHash(ctx.marshal_as(sString)); 21 | } 22 | uint32_t RAGE::AtStringHash(String^ sString, UIntPtr nExistingHash) 23 | { 24 | msclr::interop::marshal_context ctx; 25 | return rage::atStringHash(ctx.marshal_as(sString), (uint32_t*)nExistingHash.ToPointer()); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /IVSDKDotNetWrapper/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by app.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NO_MFC 1 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Manager/Classes/Attributes/LocalCommandDescAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Attributes 4 | { 5 | internal class LocalCommandDescAttribute : Attribute 6 | { 7 | 8 | #region Variables 9 | public string ShortDescription; 10 | public string[] DetailedDescription; 11 | #endregion 12 | 13 | #region Constructor 14 | public LocalCommandDescAttribute(string shortDesc, string[] detailedDesc = null) 15 | { 16 | ShortDescription = shortDesc; 17 | DetailedDescription = detailedDesc; 18 | } 19 | #endregion 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Manager/Classes/Attributes/LocalCommandNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Attributes 4 | { 5 | internal class LocalCommandNameAttribute : Attribute 6 | { 7 | 8 | #region Variables 9 | public string[] CommandNames; 10 | #endregion 11 | 12 | #region Constructor 13 | public LocalCommandNameAttribute(params string[] names) 14 | { 15 | // Convert names to lowercase 16 | for (int i = 0; i < names.Length; i++) 17 | { 18 | names[i] = names[i].ToLower(); 19 | } 20 | 21 | CommandNames = names; 22 | } 23 | #endregion 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Manager/Classes/Attributes/LocalCommandOptionsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Attributes 4 | { 5 | internal class LocalCommandOptionsAttribute : Attribute 6 | { 7 | 8 | #region Variables 9 | public bool CanOnlyBeCalledOnceInGame; 10 | public int RequiredArgumentsCount; 11 | #endregion 12 | 13 | #region Constructor 14 | public LocalCommandOptionsAttribute(bool canOnlyBeCalledOnceInGame = false, int requiredArgumentsCount = 0) 15 | { 16 | CanOnlyBeCalledOnceInGame = canOnlyBeCalledOnceInGame; 17 | RequiredArgumentsCount = requiredArgumentsCount; 18 | } 19 | #endregion 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Manager/Classes/Attributes/LocalCommandSuggestionsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Attributes 4 | { 5 | internal class LocalCommandSuggestionsAttribute : Attribute 6 | { 7 | 8 | #region Variables 9 | public string[] Suggestions; 10 | public DynamicConsoleCommandSuggestions DynamicSuggestions; 11 | #endregion 12 | 13 | #region Constructor 14 | public LocalCommandSuggestionsAttribute(string[] suggestions = default, DynamicConsoleCommandSuggestions dynamicSuggestions = DynamicConsoleCommandSuggestions.DontUse) 15 | { 16 | Suggestions = suggestions; 17 | DynamicSuggestions = dynamicSuggestions; 18 | } 19 | #endregion 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Manager/Classes/BoundPhoneNumber.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes 4 | { 5 | public class BoundPhoneNumber 6 | { 7 | #region Variables 8 | public string Number; 9 | public bool WasDialed; 10 | public Action DialedAction; 11 | #endregion 12 | 13 | #region Constructor 14 | public BoundPhoneNumber(string number, Action dialedAction) 15 | { 16 | Number = number; 17 | DialedAction = dialedAction; 18 | } 19 | #endregion 20 | 21 | public void Invoke() 22 | { 23 | DialedAction?.Invoke(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Manager/Classes/Json/IVPresenceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Policy; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | using IVSDKDotNet; 9 | using IVSDKDotNet.Enums; 10 | 11 | namespace Manager.Classes.Json 12 | { 13 | public class IVPresenceInfo 14 | { 15 | 16 | #region Variables 17 | // General 18 | public bool IsDead; 19 | 20 | public float Health; 21 | public float Armour; 22 | 23 | public uint WantedLevel; 24 | 25 | public eWeaponType WeaponType; 26 | public uint Ammo; 27 | 28 | // Vehicle 29 | public bool InVehicle; 30 | 31 | public string VehicleName; 32 | public string CurrentRadioStationName; 33 | #endregion 34 | 35 | #region Constructor 36 | internal IVPresenceInfo() 37 | { 38 | 39 | } 40 | #endregion 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Manager/Classes/Json/IVSessionInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Manager.Classes.Json 4 | { 5 | public class IVSessionInfo 6 | { 7 | 8 | #region Variables 9 | public bool IsNetworkSession; 10 | public bool IsNetworkSessionStarted; 11 | public bool IsLANSession; 12 | public bool IsThisMachineTheServer; 13 | public IVGameMode GameMode; 14 | public List Players; 15 | 16 | public uint PlayerCount; 17 | public uint MaxPlayerCount; 18 | 19 | public uint Team; 20 | public uint Score; 21 | 22 | public string ServerName; 23 | public int ServerID; 24 | #endregion 25 | 26 | #region Constructor 27 | internal IVSessionInfo() 28 | { 29 | Players = new List(); 30 | } 31 | #endregion 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Manager/Classes/Json/ManagerApiPreferences.cs: -------------------------------------------------------------------------------- 1 | namespace Manager.Classes.Json 2 | { 3 | #pragma warning disable CS0649 // Field '...' is never assigned to, and will always have its default value '...' 4 | internal class ManagerApiPreferences 5 | { 6 | public bool ShowNotificationOnConnection; 7 | public bool AllowRemoteReloadScripts; 8 | public bool AllowRemoteLoadScripts; 9 | public bool AllowRemoteAbortScripts; 10 | public bool AllowRemoteNativeFunctionCalls; 11 | } 12 | #pragma warning restore CS0649 13 | } 14 | -------------------------------------------------------------------------------- /Manager/Classes/Json/NativeCallContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Json 4 | { 5 | public class NativeCallContext 6 | { 7 | 8 | #region Variables 9 | public string Name; 10 | public object[] Arguments; 11 | public Type[] ArgumentTypes; 12 | #endregion 13 | 14 | #region Constructor 15 | internal NativeCallContext() 16 | { 17 | 18 | } 19 | #endregion 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Manager/Classes/Json/NativeCallResult.cs: -------------------------------------------------------------------------------- 1 | namespace Manager.Classes.Json 2 | { 3 | public class NativeCallResult 4 | { 5 | 6 | #region Variables 7 | public object Result; 8 | public object[] Arguments; 9 | #endregion 10 | 11 | #region Constructor 12 | internal NativeCallResult(object result, object[] args) 13 | { 14 | Result = result; 15 | Arguments = args; 16 | } 17 | internal NativeCallResult() 18 | { 19 | 20 | } 21 | #endregion 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Manager/Classes/Json/RunningScriptInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Json 4 | { 5 | public class RunningScriptInfo 6 | { 7 | 8 | #region Variables 9 | public string Name; 10 | public string FullPath; 11 | public Guid ScriptID; 12 | public Guid IVLauncherWorkshopID; 13 | #endregion 14 | 15 | #region Constructor 16 | internal RunningScriptInfo(string name, string fullPath, Guid scriptId, Guid ivLauncherWorkshopID) 17 | { 18 | Name = name; 19 | FullPath = fullPath; 20 | ScriptID = scriptId; 21 | IVLauncherWorkshopID = ivLauncherWorkshopID; 22 | } 23 | internal RunningScriptInfo() 24 | { 25 | 26 | } 27 | #endregion 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Manager/Classes/Json/Script/ScriptConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Manager.Classes.Json.Script 5 | { 6 | public class ScriptConfig 7 | { 8 | #region Variables 9 | public bool ForceNoAbort; 10 | public Guid IVLauncherWorkshopID; 11 | 12 | public List Dependencies; 13 | public List IncompatibleMods; 14 | #endregion 15 | 16 | #region Constructor 17 | internal ScriptConfig() 18 | { 19 | 20 | } 21 | #endregion 22 | 23 | #region Functions 24 | public bool HasDependencyInfo() 25 | { 26 | return Dependencies != null && Dependencies.Count > 0; 27 | } 28 | public bool HasIncompatibleMods() 29 | { 30 | return IncompatibleMods != null && IncompatibleMods.Count > 0; 31 | } 32 | #endregion 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Manager/Classes/Json/Script/ScriptDependencyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Json.Script 4 | { 5 | public class ScriptDependencyInfo 6 | { 7 | 8 | #region Variables 9 | public string FileName; 10 | public string SpecificVersion; 11 | public string DownloadURL; 12 | public Guid IVLauncherWorkshopID; 13 | #endregion 14 | 15 | #region Constructor 16 | public ScriptDependencyInfo() 17 | { 18 | 19 | } 20 | #endregion 21 | 22 | public override string ToString() 23 | { 24 | return string.Concat(FileName, ", Version: ", SpecificVersion); 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Manager/Classes/Tasks/CustomTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Manager.Classes.Tasks 6 | { 7 | internal class CustomTask 8 | { 9 | 10 | #region Variables 11 | public Guid ID; 12 | public Task TheTask; 13 | public CancellationTokenSource TokenSource; 14 | #endregion 15 | 16 | #region Constructor 17 | private CustomTask() 18 | { 19 | ID = Guid.NewGuid(); 20 | TokenSource = new CancellationTokenSource(); 21 | } 22 | #endregion 23 | 24 | #region Methods 25 | protected void SetTask(Task task) 26 | { 27 | TheTask = task; 28 | } 29 | #endregion 30 | 31 | public static CustomTask StartNew(Action actionToExecute, TaskCreationOptions options, TaskScheduler scheduler) 32 | { 33 | CustomTask task = new CustomTask(); 34 | task.SetTask(Task.Factory.StartNew(actionToExecute, task.TokenSource.Token, options, scheduler)); 35 | return task; 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Manager/Classes/Threading/GenericThread.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Threading 4 | { 5 | public class GenericThread : NetThread 6 | { 7 | 8 | #region Variables 9 | private Action onTickAction; 10 | private Action onStartupAction; 11 | private Action onEndAction; 12 | #endregion 13 | 14 | #region Constructor 15 | public GenericThread(Action onTick, Action onStartup = null, Action onEnd = null) : base(ThreadType.GenericThread) 16 | { 17 | onTickAction = onTick; 18 | onStartupAction = onStartup; 19 | onEndAction = onEnd; 20 | } 21 | #endregion 22 | 23 | public override void OnStartup() 24 | { 25 | onStartupAction?.Invoke(); 26 | } 27 | public override void OnTick() 28 | { 29 | onTickAction?.Invoke(); 30 | } 31 | public override void OnEnd() 32 | { 33 | onEndAction?.Invoke(); 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Manager/Classes/Threading/ScriptThread.cs: -------------------------------------------------------------------------------- 1 | using Manager.Classes.Scripts; 2 | 3 | namespace Manager.Classes.Threading 4 | { 5 | public class ScriptThread : NetThread 6 | { 7 | 8 | #region Variables 9 | public FoundScript OwnerScript; 10 | #endregion 11 | 12 | #region Constructor 13 | public ScriptThread(FoundScript owner) : base(ThreadType.ScriptThread) 14 | { 15 | OwnerScript = owner; 16 | } 17 | #endregion 18 | 19 | public override void OnStartup() 20 | { 21 | OwnerScript.ConstructScript(); 22 | } 23 | 24 | public override void OnTick() 25 | { 26 | OwnerScript.RaiseThreadedTick(); 27 | } 28 | 29 | public override void OnEnd() 30 | { 31 | 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Manager/Classes/Threading/ThreadData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Manager.Classes.Threading 4 | { 5 | internal class ThreadData 6 | { 7 | 8 | #region Variables 9 | public int ThreadID; 10 | public UIntPtr TlsContext; 11 | #endregion 12 | 13 | #region Constructor 14 | public ThreadData(int threadId, UIntPtr tlsContext) 15 | { 16 | ThreadID = threadId; 17 | TlsContext = tlsContext; 18 | } 19 | #endregion 20 | 21 | public void UpdateTlsContext(UIntPtr newContext) 22 | { 23 | TlsContext = newContext; 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Manager/Manager.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Manager/Resources/ivsdkdotnet_logo_small.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/Manager/Resources/ivsdkdotnet_logo_small.bin -------------------------------------------------------------------------------- /Manager/Riptide/IMessageSerializable.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of RiptideNetworking. 2 | // Copyright (c) Tom Weiland 3 | // For additional information please see the included LICENSE.md file or view it on GitHub: 4 | // https://github.com/tom-weiland/RiptideNetworking/blob/main/LICENSE.md 5 | 6 | namespace Riptide 7 | { 8 | /// Represents a type that can be added to and retrieved from messages using the and methods. 9 | internal interface IMessageSerializable 10 | { 11 | /// Adds the type to the message. 12 | /// The message to add the type to. 13 | void Serialize(Message message); 14 | /// Retrieves the type from the message. 15 | /// The message to retrieve the type from. 16 | void Deserialize(Message message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Manager/Riptide/Utils/Extensions.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of RiptideNetworking. 2 | // Copyright (c) Tom Weiland 3 | // For additional information please see the included LICENSE.md file or view it on GitHub: 4 | // https://github.com/tom-weiland/RiptideNetworking/blob/main/LICENSE.md 5 | 6 | using System.Net; 7 | 8 | namespace Riptide.Utils 9 | { 10 | /// Contains extension methods for various classes. 11 | internal static class Extensions 12 | { 13 | /// Takes the 's IP address and port number and converts it to a string, accounting for whether the address is an IPv4 or IPv6 address. 14 | /// A string containing the IP address and port number of the endpoint. 15 | public static string ToStringBasedOnIPFormat(this IPEndPoint endPoint) 16 | { 17 | if (endPoint.Address.IsIPv4MappedToIPv6) 18 | return $"{endPoint.Address.MapToIPv4()}:{endPoint.Port}"; 19 | 20 | return endPoint.ToString(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Manager/Riptide/version.txt: -------------------------------------------------------------------------------- 1 | RiptideNetworking v2.0.0 2 | https://github.com/RiptideNetworking/Riptide -------------------------------------------------------------------------------- /Manager/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /TestScript/ListExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | using IVSDKDotNet.Native; 5 | 6 | namespace TestScript 7 | { 8 | internal static class ListExtensions 9 | { 10 | 11 | public static List Randomize(this List list) 12 | { 13 | // Create a copy of the original list so it doesnt modify the original list 14 | List result = list.ToList(); 15 | 16 | // Go through list and insert items at random places 17 | for (int i = 0; i < result.Count; i++) 18 | { 19 | T item = result[i]; 20 | 21 | result.RemoveAt(i); 22 | 23 | result.Insert(Natives.GENERATE_RANDOM_INT_IN_RANGE(0, list.Capacity - 1), item); 24 | } 25 | 26 | return result; 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TestScript/Resources/Bck.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/TestScript/Resources/Bck.bin -------------------------------------------------------------------------------- /TestScript/Resources/Pin.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/TestScript/Resources/Pin.bin -------------------------------------------------------------------------------- /TestScript/Resources/arrowUp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/TestScript/Resources/arrowUp.bin -------------------------------------------------------------------------------- /TestScript/Resources/discordTestLogo.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/TestScript/Resources/discordTestLogo.bin -------------------------------------------------------------------------------- /TestScript/Resources/rpm_needle.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/IV-SDK-DotNet/f5f5d63f705819525fe2f5307648661fb5613124/TestScript/Resources/rpm_needle.bin --------------------------------------------------------------------------------