├── TestScriptCS ├── bin │ └── _postbuild.bat ├── Resources │ ├── rpm_gauge.png │ └── rpm_needle.png ├── TestScriptCS.sln ├── Properties │ └── AssemblyInfo.cs └── Scripts │ ├── ScriptCommunicationExample.cs │ └── BodyguardScript.cs ├── DebugTest ├── obj │ └── Debug │ │ ├── DebugTest.csproj.Up2Date │ │ ├── DebugTest.csproj.CoreCompileInputs.cache │ │ ├── DebugTest.net.dll │ │ ├── DebugTest.net.pdb │ │ ├── DebugTest.csproj.AssemblyReference.cache │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ ├── .NETFramework,Version=v4.8.AssemblyAttributes.cs │ │ └── DebugTest.csproj.FileListAbsolute.txt ├── bin │ └── Debug │ │ ├── DebugTest.net.dll │ │ ├── DebugTest.net.pdb │ │ ├── IVSDKDotNetWrapper.dll │ │ ├── IVSDKDotNetWrapper.pdb │ │ ├── ScriptHookDotNet.dll │ │ ├── ScriptHookDotNet.pdb │ │ ├── ClonksCodingLib.GTAIV.dll │ │ └── ClonksCodingLib.GTAIV.pdb ├── Main.cs ├── Properties │ └── AssemblyInfo.cs └── DebugTest.csproj ├── ScriptHookDotNet ├── Resource.aps ├── Resource.rc ├── vHelper.cpp ├── d3d9Includes.h ├── ScriptHookDotNet.vcxproj.user ├── resource.h ├── AssemblyInfo.cpp ├── bConsole.cpp ├── dFormRootDesigner.cpp ├── dFormRootDesigner.h ├── NmCommands.h ├── mHost.h ├── fLabel.h ├── bScriptChild.h ├── fLabel.cpp ├── fTextbox.cpp ├── D3D_Device.h ├── NmArmsWindmillHelper.h ├── ScriptedFire.h ├── vVehicleExtra.h ├── fFormHost.h ├── fImagebox.cpp ├── fCheckbox.cpp ├── bConsole.h ├── Console.h ├── bMouse.cpp ├── NmPedalLegsHelper.h ├── PedCollection.h ├── mHost.cpp ├── vGlobals.h ├── Light.cpp ├── nFunction.h ├── Checkpoint.cpp ├── PedCollection.cpp ├── TaskSequence.h ├── vPedAnimation.h ├── Texture.h ├── NmLeanToPositionHelper.h ├── fImagebox.h ├── sRoom.h ├── vResources.cpp ├── fButton.h ├── NetHook.h ├── vDynamicMetadata.h ├── AnimationSet.h ├── stdafx.h ├── fFormHost.cpp ├── vVehicleExtra.cpp ├── vVehicleDoor.h ├── Console.cpp ├── bObject.cpp ├── fButton.cpp ├── bMouse.h ├── fMouse.cpp ├── sRoom.cpp ├── fKeybox.cpp ├── vResources.h ├── NmBeingShotHelper.h ├── ScriptedFire.cpp ├── fTextbox.h ├── fListbox.cpp ├── dEventArgs.h ├── NmLeanTowardsObjectHelper.h ├── Team.h ├── ModelConverter.h ├── Team.cpp ├── nTemplate.cpp ├── vGlobals.cpp ├── nTemplate.h ├── vWeapon.h ├── Garage.h ├── vPedAnimation.cpp ├── Texture.cpp ├── NetHook.cpp ├── fCheckbox.h ├── dColorConverter.h ├── Pickup.h ├── Garage.cpp ├── SkinTemplate.h ├── Camera.h ├── Timer.h ├── Checkpoint.h ├── NmCustom.h ├── vPedSkin.h ├── TaskSequence.cpp ├── fKeybox.h └── NmBodyBalanceHelper.h ├── TestScriptVB ├── Resources │ ├── rpm_gauge.png │ └── rpm_needle.png ├── My Project │ ├── Settings.settings │ ├── Application.Designer.vb │ ├── Application.myapp │ ├── AssemblyInfo.vb │ ├── Resources.Designer.vb │ └── Settings.Designer.vb ├── TestScriptVB.sln └── Scripts │ ├── ScriptCommunicationExample.vb │ └── BodyguardScript.vb ├── LICENSE-SlimDX.txt ├── LICENSE ├── LICENSE.txt ├── README.md └── ScriptHookDotNet.sln /TestScriptCS/bin/_postbuild.bat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.csproj.Up2Date: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 3ad0579edfe9f7b587fbb1ed223920e0e6d5a9e253a619e14650d0e6b270e2b0 2 | -------------------------------------------------------------------------------- /ScriptHookDotNet/Resource.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/ScriptHookDotNet/Resource.aps -------------------------------------------------------------------------------- /ScriptHookDotNet/Resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/ScriptHookDotNet/Resource.rc -------------------------------------------------------------------------------- /ScriptHookDotNet/vHelper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/ScriptHookDotNet/vHelper.cpp -------------------------------------------------------------------------------- /DebugTest/bin/Debug/DebugTest.net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/DebugTest.net.dll -------------------------------------------------------------------------------- /DebugTest/bin/Debug/DebugTest.net.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/DebugTest.net.pdb -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/obj/Debug/DebugTest.net.dll -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.net.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/obj/Debug/DebugTest.net.pdb -------------------------------------------------------------------------------- /TestScriptCS/Resources/rpm_gauge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/TestScriptCS/Resources/rpm_gauge.png -------------------------------------------------------------------------------- /TestScriptCS/Resources/rpm_needle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/TestScriptCS/Resources/rpm_needle.png -------------------------------------------------------------------------------- /TestScriptVB/Resources/rpm_gauge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/TestScriptVB/Resources/rpm_gauge.png -------------------------------------------------------------------------------- /TestScriptVB/Resources/rpm_needle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/TestScriptVB/Resources/rpm_needle.png -------------------------------------------------------------------------------- /DebugTest/bin/Debug/IVSDKDotNetWrapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/IVSDKDotNetWrapper.dll -------------------------------------------------------------------------------- /DebugTest/bin/Debug/IVSDKDotNetWrapper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/IVSDKDotNetWrapper.pdb -------------------------------------------------------------------------------- /DebugTest/bin/Debug/ScriptHookDotNet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/ScriptHookDotNet.dll -------------------------------------------------------------------------------- /DebugTest/bin/Debug/ScriptHookDotNet.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/ScriptHookDotNet.pdb -------------------------------------------------------------------------------- /ScriptHookDotNet/d3d9Includes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #pragma comment(lib, "d3d9.lib") 6 | #pragma comment(lib, "d3dx9.lib") -------------------------------------------------------------------------------- /DebugTest/bin/Debug/ClonksCodingLib.GTAIV.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/ClonksCodingLib.GTAIV.dll -------------------------------------------------------------------------------- /DebugTest/bin/Debug/ClonksCodingLib.GTAIV.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/bin/Debug/ClonksCodingLib.GTAIV.pdb -------------------------------------------------------------------------------- /ScriptHookDotNet/ScriptHookDotNet.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/obj/Debug/DebugTest.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/HEAD/DebugTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /DebugTest/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] 5 | -------------------------------------------------------------------------------- /TestScriptVB/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ScriptHookDotNet/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /TestScriptVB/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.1 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /TestScriptVB/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /ScriptHookDotNet/AssemblyInfo.cpp: -------------------------------------------------------------------------------- 1 | using namespace System; 2 | using namespace System::Reflection; 3 | using namespace System::Runtime::CompilerServices; 4 | using namespace System::Runtime::InteropServices; 5 | using namespace System::Security::Permissions; 6 | 7 | [assembly:AssemblyTitleAttribute(L"ScriptHookDotNet")] ; 8 | [assembly:AssemblyDescriptionAttribute(L"ScriptHookDotNet - IV-SDK .NET Compatible")] ; 9 | [assembly:AssemblyConfigurationAttribute(L"")] ; 10 | [assembly:AssemblyCompanyAttribute(L"HazardX / ItsClonkAndre")] ; 11 | [assembly:AssemblyProductAttribute(L"ScriptHookDotNet")] ; 12 | [assembly:AssemblyCopyrightAttribute(L"Copyright (c) HazardX / ItsClonkAndre 2024-2025")] ; 13 | [assembly:AssemblyTrademarkAttribute(L"")] ; 14 | [assembly:AssemblyCultureAttribute(L"")] ; 15 | 16 | [assembly:AssemblyVersionAttribute(L"1.7.2.5")]; 17 | 18 | [assembly:ComVisible(false)] ; -------------------------------------------------------------------------------- /DebugTest/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using GTA; 4 | using GTA.Native; 5 | 6 | namespace DebugTest 7 | { 8 | public class Main : Script 9 | { 10 | 11 | public Main() 12 | { 13 | Tick += Main_Tick; 14 | } 15 | 16 | private void Main_Tick(object sender, EventArgs e) 17 | { 18 | Vector3 v = Game.LocalPlayer.Character.Position; 19 | Function.Call("DRAW_CHECKPOINT", v.X, v.Y, v.Z, 1f, 255, 255, 255); 20 | 21 | //GTA.Object[] objects = World.GetAllObjects(); 22 | //Game.DisplayText("objects length: " + objects.Length.ToString()); 23 | //for (int i = 0; i < objects.Length; i++) 24 | //{ 25 | // GTA.Object obj = objects[i]; 26 | // Function.Call("DRAW_CHECKPOINT", obj.Position.X, obj.Position.Y, obj.Position.Z, 1f, 255, 255, 255); 27 | //} 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TestScriptCS/TestScriptCS.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestScriptCS", "TestScriptCS.csproj", "{09ED29FD-8D44-4DE6-8CB3-783C9D13EE77}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {09ED29FD-8D44-4DE6-8CB3-783C9D13EE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {09ED29FD-8D44-4DE6-8CB3-783C9D13EE77}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {09ED29FD-8D44-4DE6-8CB3-783C9D13EE77}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {09ED29FD-8D44-4DE6-8CB3-783C9D13EE77}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /TestScriptVB/TestScriptVB.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestScriptVB", "TestScriptVB.vbproj", "{2765B56D-7F88-4A20-A2F8-42697112D58D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {2765B56D-7F88-4A20-A2F8-42697112D58D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {2765B56D-7F88-4A20-A2F8-42697112D58D}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {2765B56D-7F88-4A20-A2F8-42697112D58D}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {2765B56D-7F88-4A20-A2F8-42697112D58D}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /LICENSE-SlimDX.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2010 SlimDX Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 E. S. 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 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | This software has been modified by third party to support latest version of GTA IV and EFLC. -------------------------------------------------------------------------------- /ScriptHookDotNet/bConsole.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /TestScriptVB/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ScriptHookDotNet/dFormRootDesigner.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | #include "dEventArgs.h" 25 | #include "dControlDesigner.h" 26 | 27 | #include "dFormRootDesigner.h" -------------------------------------------------------------------------------- /DebugTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DebugTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DebugTest")] 13 | [assembly: AssemblyCopyright("Copyright © 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ed9bb8a9-8456-4d1d-8d65-11cc8b49dc13")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /ScriptHookDotNet/dFormRootDesigner.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Design { 28 | 29 | [System::ComponentModel::EditorBrowsableAttribute(EditorBrowsableState::Never)] 30 | public ref class FormRootDesigner : public ControlDesigner { 31 | 32 | 33 | 34 | }; 35 | 36 | } 37 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmCommands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #include "NmMessage.h" 25 | #include "NmCustom.h" 26 | 27 | #include "NmArmsWindmillHelper.h" 28 | #include "NmBodyBalanceHelper.h" 29 | #include "NmBeingShotHelper.h" 30 | #include "NmGrabHelper.h" 31 | #include "NmLeanToPositionHelper.h" 32 | #include "NmLeanTowardsObjectHelper.h" 33 | #include "NmPedalLegsHelper.h" -------------------------------------------------------------------------------- /ScriptHookDotNet/mHost.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Multiplayer { 28 | 29 | public ref class Host sealed { 30 | 31 | private: 32 | Host() {} 33 | 34 | public: 35 | static property bool isHost { 36 | bool get(); 37 | } 38 | 39 | static void KickPlayer(GTA::Player^ Player); 40 | 41 | }; 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /TestScriptCS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TestScriptCS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("TestScriptCS")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cad8122d-51c0-40c1-b0ee-5ba42044a065")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ScriptHookDotNet/fLabel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | CLASS_ATTRIBUTES 31 | public ref class Label : public GTA::Forms::Control 32 | { 33 | public: 34 | Label() {} 35 | 36 | internal: 37 | virtual void OnPaint() override; 38 | 39 | protected: 40 | virtual void OnTextChanged(EventArgs^ e) override; 41 | 42 | }; 43 | } 44 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/bScriptChild.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace base 29 | { 30 | CLASS_ATTRIBUTES 31 | public ref class ScriptChild abstract 32 | { 33 | private: 34 | Script^ pParent; 35 | 36 | protected: 37 | property Script^ Parent 38 | { 39 | Script^ get() { return pParent; } 40 | } 41 | 42 | internal: 43 | ScriptChild(System::Object^ callingScript); 44 | }; 45 | } 46 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fLabel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fLabel.h" 28 | 29 | #include "Font.h" 30 | #include "Graphics.h" 31 | 32 | #pragma managed 33 | 34 | using namespace IVSDKDotNet; 35 | 36 | namespace GTA 37 | { 38 | namespace Forms 39 | { 40 | 41 | void Label::OnPaint() 42 | { 43 | ImGuiIV::TextUnformatted(Text); 44 | } 45 | 46 | void Label::OnTextChanged(EventArgs^ e) 47 | { 48 | Control::OnTextChanged(e); 49 | } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fTextbox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fTextbox.h" 28 | 29 | #include "Font.h" 30 | #include "Graphics.h" 31 | 32 | #pragma managed 33 | 34 | using namespace IVSDKDotNet; 35 | 36 | namespace GTA 37 | { 38 | namespace Forms 39 | { 40 | 41 | void Textbox::OnPaint() 42 | { 43 | ImGuiIV::InputText(Name, pText); 44 | } 45 | 46 | void Textbox::OnKeyDown(GTA::KeyEventArgs^ e) 47 | { 48 | Control::OnKeyDown(e); 49 | } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/D3D_Device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | private ref class Direct3D sealed 29 | { 30 | internal: 31 | static void ReleaseFont(GTA::Font^ Font); 32 | static void ReleaseTexture(GTA::Texture^ Texture); 33 | 34 | /// 35 | /// Creates a new Direct3D Font and returns the pointer. 36 | /// 37 | static IntPtr NewTextureInternal(System::Object^ callingScript, array^ data, [Out] int% textureWidth, [Out] int% textureHeight); 38 | 39 | }; 40 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmArmsWindmillHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class ArmsWindmillHelper : public CustomHelper { 31 | 32 | public: 33 | 34 | ArmsWindmillHelper(GTA::Ped^ Ped) 35 | :CustomHelper(Ped, nmMessageID::nm059_armsWindmillAdaptive){ 36 | } 37 | 38 | property bool DisableOnImpact { 39 | void set(bool value) { 40 | SetValue(nmString::nm066_disableOnImpact,value); 41 | } 42 | } 43 | 44 | }; 45 | 46 | } 47 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/ScriptedFire.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | CLASS_ATTRIBUTES 29 | public ref class ScriptedFire sealed : 30 | public base::HandleObject, 31 | public base::iDeletable 32 | { 33 | public: 34 | ScriptedFire(int Handle); 35 | 36 | internal: 37 | virtual bool InternalCheckExists() override; 38 | 39 | public: 40 | 41 | property Vector3 Position{ 42 | Vector3 get(); 43 | } 44 | 45 | //virtual bool Exists() override; 46 | virtual void Delete(); 47 | 48 | }; 49 | 50 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vVehicleExtra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class VehicleExtra sealed { 31 | 32 | private: 33 | Vehicle^ vehicle; 34 | int pID; 35 | 36 | internal: 37 | VehicleExtra(Vehicle^ vehicle, int ExtraID); 38 | 39 | public: 40 | property int ID { 41 | int get() { 42 | return pID; 43 | } 44 | } 45 | 46 | property bool Enabled { 47 | bool get(); 48 | void set(bool value); 49 | } 50 | 51 | }; 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fFormHost.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | CLASS_ATTRIBUTES 31 | private ref class FormHost sealed 32 | { 33 | private: 34 | GTA::Script^ pScript; 35 | List^ pForms; 36 | 37 | internal: 38 | FormHost(GTA::Script^ forScript); 39 | 40 | public: 41 | property GTA::Script^ Script 42 | { 43 | GTA::Script^ get() { return pScript; } 44 | } 45 | 46 | void Add(Form^ form); 47 | void Remove(Form^ form); 48 | 49 | void Draw(); 50 | 51 | }; 52 | } 53 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fImagebox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fImagebox.h" 28 | 29 | #include "Font.h" 30 | #include "Texture.h" 31 | #include "Graphics.h" 32 | 33 | #pragma managed 34 | 35 | namespace GTA 36 | { 37 | namespace Forms 38 | { 39 | 40 | void Imagebox::OnPaint(GTA::GraphicsEventArgs^ e) 41 | { 42 | if isNotNULL(Image) 43 | IVSDKDotNet::ImGuiIV::Image(IntPtr(Image->GetInternalPointer(true)), System::Numerics::Vector2(Size.Width, Size.Height)); 44 | } 45 | 46 | } 47 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fCheckbox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fCheckbox.h" 28 | 29 | #include "Font.h" 30 | #include "Graphics.h" 31 | 32 | #pragma managed 33 | 34 | using namespace IVSDKDotNet; 35 | 36 | namespace GTA 37 | { 38 | namespace Forms 39 | { 40 | 41 | void Checkbox::OnPaint() 42 | { 43 | if (ImGuiIV::CheckBox(Text, bChecked)) 44 | OnCheckedChanged(EventArgs::Empty); 45 | } 46 | 47 | void Checkbox::OnMouseDown(GTA::MouseEventArgs^ e) 48 | { 49 | Control::OnMouseDown(e); 50 | } 51 | 52 | } 53 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/bConsole.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace base { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class Console abstract { 31 | 32 | internal: 33 | Console() {} 34 | 35 | public: 36 | 37 | property bool isActive { 38 | virtual bool get() abstract; 39 | } 40 | 41 | virtual void Open(String^ DefaultInput) abstract; 42 | virtual void Open() abstract; 43 | 44 | virtual void Close() abstract; 45 | 46 | virtual void SendCommand(String^ CommandLine) abstract; 47 | virtual void Print(String^ Text) abstract; 48 | 49 | }; 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | CLASS_ATTRIBUTES 29 | public ref class RemoteConsole sealed : base::Console 30 | { 31 | internal: 32 | static RemoteConsole^ Instance = gcnew RemoteConsole(); 33 | 34 | public: 35 | property bool isActive 36 | { 37 | virtual bool get() override; 38 | } 39 | 40 | virtual void Open(String^ DefaultInput) override; 41 | virtual void Open() override; 42 | 43 | virtual void Close() override; 44 | 45 | virtual void SendCommand(String^ CommandLine) override; 46 | virtual void Print(String^ Text) override; 47 | 48 | }; 49 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/bMouse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "bMouse.h" 26 | 27 | #include "Graphics.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | namespace base 34 | { 35 | 36 | Drawing::Point Mouse::PositionPixel::get() 37 | { 38 | Drawing::PointF p = Position; 39 | return Drawing::Point((int)Graphics::ConvertUnitsToPixelX(p.X),(int)Graphics::ConvertUnitsToPixelY(p.Y)); 40 | } 41 | Drawing::Point Mouse::MovementPixel::get() 42 | { 43 | Drawing::PointF m = Movement; 44 | return Drawing::Point((int)Graphics::ConvertUnitsToPixelX(m.X),(int)Graphics::ConvertUnitsToPixelY(m.Y)); 45 | } 46 | 47 | } 48 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmPedalLegsHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class PedalLegsHelper : public CustomHelper { 31 | 32 | public: 33 | 34 | PedalLegsHelper(GTA::Ped^ Ped) 35 | :CustomHelper(Ped, nmMessageID::nm067_pedalLegs){ 36 | } 37 | 38 | property bool UseLeftLeg { 39 | void set(bool value) { 40 | SetValue(nmString::nm071_pedalLeftLeg,value); 41 | } 42 | } 43 | property bool UseRightLeg { 44 | void set(bool value) { 45 | SetValue(nmString::nm072_pedalRightLeg,value); 46 | } 47 | } 48 | 49 | }; 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/PedCollection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | 28 | CLASS_ATTRIBUTES 29 | public ref class PedCollection : List { 30 | 31 | private: 32 | 33 | 34 | public: 35 | PedCollection(){}; 36 | 37 | void OrderByDistanceTo(Vector3 Position); 38 | void RemoveDead(); 39 | 40 | }; 41 | 42 | CLASS_ATTRIBUTES 43 | private ref class PedDistanceComparer : IComparer { 44 | 45 | private: 46 | Vector3 pos; 47 | 48 | public: 49 | 50 | PedDistanceComparer(Vector3 Position) { 51 | this->pos = Position; 52 | } 53 | 54 | virtual int Compare(Ped^ x, Ped^ y); 55 | 56 | }; 57 | 58 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/mHost.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "mHost.h" 28 | 29 | #include "Player.h" 30 | 31 | #pragma managed 32 | 33 | namespace GTA 34 | { 35 | namespace Multiplayer 36 | { 37 | 38 | bool Host::isHost::get() 39 | { 40 | return IVSDKDotNet::Native::Natives::IS_THIS_MACHINE_THE_SERVER(); 41 | } 42 | 43 | void Host::KickPlayer(GTA::Player^ Player) 44 | { 45 | if (!isHost) 46 | throw gcnew Exception("Only the host may kick other players!"); 47 | 48 | IVSDKDotNet::Native::Natives::NETWORK_KICK_PLAYER(Player->ID, true); 49 | } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vGlobals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | 28 | using namespace System; 29 | 30 | namespace value { 31 | 32 | CLASS_ATTRIBUTES 33 | public ref class Globals sealed { 34 | 35 | internal: 36 | Globals() { } 37 | 38 | public: 39 | property bool AreGlobalsSupported { 40 | bool get(); 41 | } 42 | 43 | int ReadInteger(int index); // up to index 65056 44 | float ReadFloat(int index); 45 | String^ ReadString(int index); 46 | 47 | void Write(int index, int value); 48 | void Write(int index, float value); 49 | void Write(int index, String^ value, int MaxLength); 50 | 51 | }; 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Light.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Light.h" 28 | 29 | #include "Script.h" 30 | #include "World.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA 35 | { 36 | 37 | void Light::Enabled::set(bool value) 38 | { 39 | if (bEnabled == value) 40 | return; 41 | 42 | if (value) 43 | Parent->EachTick += gcnew EventHandler(this, &Light::EachTick); 44 | else 45 | Parent->EachTick -= gcnew EventHandler(this, &Light::EachTick); 46 | 47 | bEnabled = value; 48 | } 49 | 50 | void Light::EachTick(Object^ sender, EventArgs^ e) 51 | { 52 | World::DrawLight(pPosition, pColor, pRange, pIntensity); 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /DebugTest/obj/Debug/DebugTest.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\DebugTest.net.dll 2 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\DebugTest.net.pdb 3 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ScriptHookDotNet.dll 4 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ClonksCodingLib.GTAIV.dll 5 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\IVSDKDotNetWrapper.dll 6 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ScriptHookDotNet.pdb 7 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ScriptHookDotNet.xml 8 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ClonksCodingLib.GTAIV.pdb 9 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\ClonksCodingLib.GTAIV.xml 10 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\IVSDKDotNetWrapper.pdb 11 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\bin\Debug\IVSDKDotNetWrapper.xml 12 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\obj\Debug\DebugTest.csproj.AssemblyReference.cache 13 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\obj\Debug\DebugTest.csproj.CoreCompileInputs.cache 14 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\obj\Debug\DebugTest.csproj.Up2Date 15 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\obj\Debug\DebugTest.net.dll 16 | C:\Users\Napal\Documents\GitHub\GTAIV\ScriptHookDotNet-for-IVSDKDotNet\DebugTest\obj\Debug\DebugTest.net.pdb 17 | -------------------------------------------------------------------------------- /ScriptHookDotNet/nFunction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | #pragma managed 26 | 27 | namespace GTA 28 | { 29 | 30 | using namespace System; 31 | using namespace System::Collections::Generic; 32 | 33 | namespace Native 34 | { 35 | 36 | ref class Parameter; 37 | 38 | CLASS_ATTRIBUTES 39 | public ref class Function sealed 40 | { 41 | internal: 42 | static System::Object^ ConvertReturnTypeToExpectedType(System::Object^ returnValue, Type^ expectedType); 43 | 44 | public: 45 | ~Function() { } 46 | 47 | generic 48 | static T Call(String^ Name, ... array^ Arguments); 49 | 50 | static void Call(String^ Name, ... array^ Arguments); 51 | 52 | }; 53 | 54 | } 55 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Checkpoint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Checkpoint.h" 28 | 29 | #include "Script.h" 30 | #include "World.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA 35 | { 36 | 37 | void Checkpoint::Visible::set(bool value) 38 | { 39 | if (bVisible == value) 40 | return; 41 | 42 | if (value) 43 | Parent->EachTick += gcnew EventHandler(this, &Checkpoint::EachTick); 44 | else 45 | Parent->EachTick -= gcnew EventHandler(this, &Checkpoint::EachTick); 46 | 47 | bVisible = value; 48 | } 49 | 50 | void Checkpoint::EachTick(Object^ sender, EventArgs^ e) 51 | { 52 | World::DrawCheckpoint(pPosition, pDiameter, pColor); 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/PedCollection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "PedCollection.h" 26 | 27 | #include "Ped.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA { 32 | 33 | void PedCollection::OrderByDistanceTo(Vector3 Position) { 34 | PedDistanceComparer^ compare = gcnew PedDistanceComparer(Position); 35 | Sort(compare); 36 | } 37 | 38 | void PedCollection::RemoveDead() { 39 | for (int i = Count-1; i>=0; i--) { 40 | if (!default[i]->isAliveAndWell) { 41 | RemoveAt(i); 42 | } 43 | } 44 | } 45 | 46 | int PedDistanceComparer::Compare(Ped^ x, Ped^ y) { 47 | float dx = (pos - x->Position).Length(); 48 | float dy = (pos - y->Position).Length(); 49 | if (dx>dy) return 1; 50 | if (dx 29 | /// TaskSequences are used to arrange several Tasks into a sequence. 30 | /// 31 | public ref class TaskSequence sealed { 32 | 33 | private: 34 | int pHandle; 35 | bool bClosed; 36 | 37 | 38 | void CreatePedNull(); 39 | static bool hasPedNull; 40 | static GTA::Ped^ pednull; // = gcnew GTA::Ped(0); 41 | 42 | internal: 43 | TaskSequence(int Handle); 44 | 45 | 46 | 47 | public: 48 | TaskSequence(); 49 | ~TaskSequence(); 50 | 51 | property int Handle { 52 | int get(); 53 | } 54 | property value::Tasks^ AddTask { 55 | value::Tasks^ get(); 56 | } 57 | 58 | void Perform(GTA::Ped^ TargetPed); 59 | 60 | }; 61 | 62 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vPedAnimation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class PedAnimation sealed { 31 | 32 | private: 33 | Ped^ ped; 34 | 35 | internal: 36 | PedAnimation(Ped^ ped); 37 | 38 | public: 39 | bool isPlaying(GTA::AnimationSet^ AnimationSet, String^ AnimationName); 40 | float GetCurrentAnimationTime(GTA::AnimationSet^ AnimationSet, String^ AnimationName); 41 | void WaitUntilFinished(GTA::AnimationSet^ AnimationSet, String^ AnimationName); 42 | 43 | void Play(GTA::AnimationSet^ AnimationSet, String^ AnimationName, float Speed, AnimationFlags Flags); 44 | void Play(GTA::AnimationSet^ AnimationSet, String^ AnimationName, float Speed); 45 | 46 | }; 47 | 48 | } 49 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ScriptHookDotNet-for-IVSDKDotNet 2 | GTA IV [ScriptHookDotNet](https://github.com/HazardX/gta4_scripthookdotnet) from [HazardX](https://twitter.com/HazardX) with a [IV-SDK .NET](https://github.com/ClonkAndre/IV-SDK-DotNet) translation layer on-top to make mods created with ScriptHookDotNet work with IV-SDK .NET! - No more rain bug! 3 | 4 | ### Currently in development! 5 | 6 | ## Limitations / Bugs 7 | There might be things which are not yet implemented, mods that simply crash the game or other weird bugs. 8 | Please open up a new issue in the [issues page](https://github.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/issues) with the mod that you are having trouble with, the error the mod might be spitting out and a basic steps to reproduce this problem section. 9 | 10 | See the currently known issues with this project [here](https://github.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/issues/1). 11 | 12 | ## How to install 13 | This modified version of ScriptHookDotNet gets shipped with IV-SDK .NET since version 1.2 so there's basically no need to install it manually. 14 | If you still need to install it manually, download the latest version from the [releases](https://github.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/releases) tab, and place the ScriptHookDotNet.dll file within the "**IVSDKDotNet -> bin**" directory. 15 | 16 | ## Requirements 17 | - [IV-SDK .NET](https://github.com/ClonkAndre/IV-SDK-DotNet) (Version 1.2 or above) 18 | - [ClonksCodingLib.GTAIV](https://github.com/ClonkAndre/ClonksCodingLib.GTAIV) 19 | - And... ScriptHookDotNet mods i guess 20 | 21 | ## How to Contribute 22 | Do you have an idea on how to improve this project? Or did you happen to run into a bug? Please share your idea or the bug you found in the **[issues page](https://github.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/issues)**. Or even better: feel free to fork and contribute to this project with a **[Pull Request](https://github.com/ClonkAndre/ScriptHookDotNet-for-IVSDKDotNet/pulls)**. 23 | -------------------------------------------------------------------------------- /ScriptHookDotNet/Texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | CLASS_ATTRIBUTES 29 | [Serializable] 30 | public ref class Texture sealed : public base::iD3DObject 31 | { 32 | private: 33 | array^ data; 34 | 35 | System::Object^ pOwningScript; 36 | IntPtr pInternalPointer; 37 | 38 | void InitValues(); 39 | 40 | protected: 41 | !Texture(); // Finalize 42 | 43 | internal: 44 | int GetInternalPointer(bool retrieveNew); 45 | virtual int GetD3DObjectID(bool retrieveNew) = base::iD3DObject::GetD3DObjectID; 46 | virtual void Unload(bool permanent) = base::iD3DObject::Unload; 47 | virtual void Reload() = base::iD3DObject::Reload; 48 | 49 | public: 50 | Texture(array^ ImageData); 51 | ~Texture(); // Dispose 52 | 53 | }; 54 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmLeanToPositionHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class LeanToPositionHelper : public CustomHelper { 31 | 32 | public: 33 | 34 | LeanToPositionHelper(GTA::Ped^ Ped) 35 | :CustomHelper(Ped, nmMessageID::nm119_leanToPosition){ 36 | } 37 | 38 | property Vector3 Position { 39 | void set(Vector3 value) { 40 | SetValue(nmString::nm121_pos,value); 41 | } 42 | } 43 | 44 | property float Amount { 45 | void set(float value) { 46 | SetValue(nmString::nm122_leanAmount,value); 47 | } 48 | } 49 | property bool ApplyAsForce { 50 | void set(bool value) { 51 | SetValue(nmString::nm123_applyAsForce,value); 52 | } 53 | } 54 | 55 | }; 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fImagebox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | 31 | using namespace Drawing; 32 | 33 | CLASS_ATTRIBUTES 34 | public ref class Imagebox : public GTA::Forms::Control 35 | { 36 | private: 37 | BorderType pBorder; 38 | GTA::Texture^ pImage; 39 | 40 | public: 41 | Imagebox() 42 | { 43 | pBorder = BorderType::None; 44 | } 45 | 46 | property BorderType Border 47 | { 48 | BorderType get() { return pBorder; } 49 | void set(BorderType value) { pBorder = value; } 50 | } 51 | property GTA::Texture^ Image 52 | { 53 | GTA::Texture^ get() { return pImage; } 54 | void set(GTA::Texture^ value) { pImage = value; } 55 | } 56 | 57 | protected: 58 | virtual void OnPaint(GTA::GraphicsEventArgs^ e) override; 59 | 60 | }; 61 | 62 | } 63 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/sRoom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | public value class Room { 29 | 30 | private: 31 | int pRoomKey; 32 | int pInteriorID; 33 | 34 | internal: 35 | Room(int RoomKey, int InteriorID) { 36 | pRoomKey = RoomKey; 37 | pInteriorID = InteriorID; 38 | } 39 | property int RoomKey{ 40 | int get() { 41 | return pRoomKey; 42 | } 43 | } 44 | property int InteriorID{ 45 | int get() { 46 | return pInteriorID; 47 | } 48 | } 49 | 50 | public: 51 | 52 | 53 | //property String^ Name{ 54 | // String^ get(); 55 | //} 56 | 57 | static bool operator == ( Room left, Room right ); 58 | static bool operator != ( Room left, Room right ); 59 | 60 | static Room FromString(String^ StringID); 61 | virtual String^ ToString() override; 62 | 63 | }; 64 | 65 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vResources.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "vResources.h" 26 | 27 | #include "Script.h" 28 | #include "Texture.h" 29 | 30 | #pragma managed 31 | 32 | namespace GTA { 33 | namespace value { 34 | 35 | Resources::Resources(Script^ script) { 36 | this->script = script; 37 | } 38 | 39 | array^ Resources::GetData(String^ ResourceName) { 40 | return Helper::GetResourceData(ResourceName, script->GetType()); 41 | } 42 | 43 | String^ Resources::GetText(String^ ResourceName, System::Text::Encoding^ Encoding) { 44 | return Helper::GetResourceString(ResourceName, script->GetType(), Encoding); 45 | } 46 | 47 | String^ Resources::GetText(String^ ResourceName) { 48 | return GetText(ResourceName, nullptr); 49 | } 50 | 51 | Texture^ Resources::GetTexture(String^ ResourceName) { 52 | return gcnew Texture( GetData(ResourceName) ); 53 | } 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | 31 | using namespace Drawing; 32 | 33 | CLASS_ATTRIBUTES 34 | public ref class Button : public GTA::Forms::Control 35 | { 36 | private: 37 | Drawing::Color pDownColor; 38 | 39 | public: 40 | Button() 41 | { 42 | pDownColor = Drawing::Color::FromArgb(50, 0, 0, 0); 43 | } 44 | 45 | public protected: 46 | virtual void OnMouseDown(GTA::MouseEventArgs^ e) override; 47 | virtual void OnDragRelease(GTA::MouseEventArgs^ e) override; 48 | 49 | virtual void OnClick(GTA::MouseEventArgs^ e) override; 50 | 51 | internal: 52 | virtual void OnPaint() override; 53 | 54 | protected: 55 | property Drawing::Size DefaultSize 56 | { 57 | virtual Drawing::Size get() override 58 | { 59 | return Drawing::Size(128, 32); 60 | } 61 | } 62 | 63 | }; 64 | } 65 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NetHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | #include "fMouse.h" 27 | 28 | namespace GTA 29 | { 30 | CLASS_ATTRIBUTES 31 | private ref class NetHook sealed 32 | { 33 | private: 34 | static GTA::base::Mouse^ pMouse; 35 | 36 | public: 37 | static property GTA::base::Mouse^ Mouse 38 | { 39 | GTA::base::Mouse^ get() 40 | { 41 | if (!pMouse) 42 | pMouse = gcnew GTA::Forms::Mouse(); 43 | 44 | return pMouse; 45 | } 46 | } 47 | 48 | static void VerboseLog(String^ Text); 49 | static void VerboseLog(String^ Text, Exception^ ex); 50 | static void VerboseLog(Exception^ ex); 51 | 52 | static void Log(String^ Text); 53 | static void Log(String^ Text, Exception^ ex); 54 | static void Log(Exception^ ex); 55 | static void Log(String^ Text, bool InsertEmptyLine, bool Truncate); 56 | 57 | private: 58 | static void LogInner(Exception^ ex); 59 | 60 | }; 61 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vDynamicMetadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace value 29 | { 30 | CLASS_ATTRIBUTES 31 | public ref class DynamicMetadata sealed : System::Dynamic::DynamicObject 32 | { 33 | internal: 34 | DynamicMetadata(GTA::base::HandleObject^ object, bool global); 35 | 36 | private: 37 | GTA::base::HandleObject^ pObject; 38 | bool bGlobal; 39 | DynamicMetadata^ pGlobalMetadata; 40 | 41 | public: 42 | [System::Runtime::CompilerServices::Dynamic] 43 | property System::Object^ Global 44 | { 45 | System::Object^ get(); 46 | } 47 | 48 | bool Contains(System::String^ MetadataName); 49 | 50 | virtual bool TrySetMember(System::Dynamic::SetMemberBinder^ binder, System::Object^ value) override; 51 | virtual bool TryGetMember(System::Dynamic::GetMemberBinder^ binder, [Out] System::Object^% result) override; 52 | 53 | }; 54 | } 55 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/AnimationSet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | public ref class AnimationSet sealed { 29 | 30 | private: 31 | String^ pName; 32 | 33 | internal: 34 | void LoadToMemory(); 35 | bool LoadToMemoryNow(); 36 | 37 | public: 38 | AnimationSet(String^ Name); 39 | 40 | property String^ Name { 41 | String^ get(); 42 | } 43 | 44 | property bool isInMemory { 45 | bool get(); 46 | } 47 | 48 | void DisposeFromMemoryNow(); 49 | bool isPedPlayingAnimation(Ped^ ped, String^ AnimationName); 50 | float GetPedsCurrentAnimationTime(Ped^ ped, String^ AnimationName); 51 | 52 | static bool operator == ( AnimationSet^ left, AnimationSet^ right ); 53 | static bool operator != ( AnimationSet^ left, AnimationSet^ right ); 54 | //static operator AnimationSet^ (String^ source); 55 | 56 | virtual System::String^ ToString() override; 57 | 58 | }; 59 | 60 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include "enums.h" 36 | #include "NmEnums.h" 37 | 38 | #include "include_defines.h" 39 | 40 | #include "sVector2.h" 41 | #include "sVector3.h" 42 | #include "sQuaternion.h" 43 | #include "sMatrix.h" 44 | #include "sModel.h" 45 | #include "sRoom.h" 46 | #include "dColorConverter.h" 47 | #include "sColorIndex.h" 48 | 49 | #include "interfaces.h" 50 | 51 | #include "bCollection.h" 52 | #include "bObject.h" 53 | #include "bHandleObject.h" 54 | #include "bScriptChild.h" 55 | #include "bConsole.h" 56 | #include "bMouse.h" 57 | 58 | #include "EventArgs.h" 59 | 60 | #include "nFunction.h" 61 | 62 | #include "fControl.h" 63 | #include "fForm.h" 64 | 65 | #include "vHelper.h" 66 | #include "NetHook.h" -------------------------------------------------------------------------------- /TestScriptVB/Scripts/ScriptCommunicationExample.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Windows.Forms 3 | Imports GTA 4 | 5 | 6 | ' ### This example shall show inter-script-communication using ScriptCommands. ### 7 | ' ### The first script gets a random Ped and sends it to the second script. ### 8 | ' ### The second script can then process the Ped as usual. ### 9 | 10 | Public Class ScriptCommunicationExample1 11 | Inherits Script 12 | 13 | ' Scripts are identified by GUIDs. Here we store the GUID of our target script into a global variable for later use 14 | Private GuidOfScript2 As Guid = New Guid("0652B17E-FB29-11DD-97BB-2E9356D89593") 15 | 16 | Private Sub ScriptCommunicationExample1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick 17 | If isKeyPressed(Keys.T) Then SendAPedToScript2() ' Look for Peds every Frame, while T is pressed 18 | End Sub 19 | 20 | Private Sub SendAPedToScript2() 21 | Dim p As Ped = World.GetRandomPed(Player.Character.Position, 10.0F) ' get a random Ped 22 | If Not Exists(p) Then Return ' make sure that p is valid and not empty 23 | SendScriptCommand(GuidOfScript2, "DoSomethingWithPed", p) ' send a command, with our ped attached, to the second script 24 | End Sub 25 | 26 | End Class 27 | 28 | Public Class ScriptCommunicationExample2 29 | Inherits Script 30 | 31 | Public Sub New() 32 | ' set the script's GUID to enable other scripts to send messages to it. 33 | ' IMPORTANT: DO NOT use the same GUID for multiple scripts! Generate a new one instead! 34 | ' Google "generate guid" to find an online GUID generator! 35 | GUID = New Guid("0652B17E-FB29-11DD-97BB-2E9356D89593") 36 | 37 | BindScriptCommand("DoSomethingWithPed", AddressOf ThrowAPed) 38 | End Sub 39 | 40 | Private Sub ThrowAPed(ByVal sender As GTA.Script, ByVal Parameter As GTA.ObjectCollection) 41 | Dim ped As Ped = Parameter.Convert(Of Ped)(0) 42 | If Not Exists(ped) OrElse ped.isInAir Then Return 43 | ped.ApplyForce(New Vector3(0.0F, 0.0F, 5.0F), New Vector3(0.0F, 5.0F, 0.0F)) 44 | End Sub 45 | 46 | End Class 47 | -------------------------------------------------------------------------------- /ScriptHookDotNet/fFormHost.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fFormHost.h" 28 | 29 | #include "Script.h" 30 | 31 | #pragma managed 32 | 33 | namespace GTA 34 | { 35 | namespace Forms 36 | { 37 | 38 | // - - - Constructor - - - 39 | FormHost::FormHost(GTA::Script^ forScript) 40 | { 41 | pScript = forScript; 42 | pForms = gcnew List(); 43 | } 44 | 45 | // - - - Properties, Methods and Functions - - - 46 | void FormHost::Add(Form^ form) 47 | { 48 | if isNULL(form) 49 | return; 50 | if (pForms->Contains(form)) 51 | return; 52 | 53 | pForms->Add(form); 54 | } 55 | void FormHost::Remove(Form^ form) 56 | { 57 | if isNULL(form) 58 | return; 59 | 60 | pForms->Remove(form); 61 | } 62 | 63 | void FormHost::Draw() 64 | { 65 | for (int i = 0; i < pForms->Count; i++) 66 | { 67 | pForms[i]->OnPaint(); 68 | } 69 | } 70 | 71 | } 72 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vVehicleExtra.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "vVehicleExtra.h" 28 | 29 | #include "Vehicle.h" 30 | 31 | #pragma managed 32 | 33 | namespace GTA 34 | { 35 | namespace value 36 | { 37 | 38 | // - - - Constructor - - - 39 | VehicleExtra::VehicleExtra(Vehicle^ vehicle, int ExtraID) 40 | { 41 | this->vehicle = vehicle; 42 | this->pID = ExtraID; 43 | } 44 | 45 | // - - - Properties, Methods and Functions - - - 46 | bool VehicleExtra::Enabled::get() 47 | { 48 | OBJECT_NON_EXISTING_CHECK(vehicle, false); 49 | return IVSDKDotNet::Native::Natives::IS_VEHICLE_EXTRA_TURNED_ON(vehicle->Handle, (u32)pID); 50 | } 51 | void VehicleExtra::Enabled::set(bool value) 52 | { 53 | OBJECT_NON_EXISTING_CHECK_NO_RETURN(vehicle); 54 | IVSDKDotNet::Native::Natives::TURN_OFF_VEHICLE_EXTRA(vehicle->Handle, pID, !value); 55 | } 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vVehicleDoor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class VehicleDoor sealed { 31 | 32 | private: 33 | Vehicle^ vehicle; 34 | GTA::VehicleDoor door; 35 | 36 | internal: 37 | VehicleDoor(Vehicle^ vehicle, GTA::VehicleDoor door); 38 | 39 | public: 40 | property GTA::VehicleDoor Index { 41 | GTA::VehicleDoor get(); 42 | } 43 | 44 | property float Angle { 45 | float get(); 46 | void set(float value); 47 | } 48 | property bool isFullyOpen { 49 | bool get(); 50 | //void set(bool value); 51 | } 52 | property bool isOpen { 53 | bool get(); 54 | void set(bool value); 55 | } 56 | property bool isDamaged { 57 | bool get(); 58 | } 59 | 60 | void Open(); 61 | void Close(); 62 | void Break(); 63 | 64 | static operator GTA::VehicleDoor (GTA::value::VehicleDoor^ source); 65 | 66 | }; 67 | 68 | } 69 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Console.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Console.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | 34 | bool RemoteConsole::isActive::get() 35 | { 36 | return IVSDKDotNet::IVGame::Console::IsConsoleOpen; 37 | } 38 | 39 | void RemoteConsole::Open() 40 | { 41 | IVSDKDotNet::IVGame::Console::Open(); 42 | } 43 | void RemoteConsole::Open(String^ DefaultInput) 44 | { 45 | IVSDKDotNet::IVGame::Console::Open(); 46 | } 47 | 48 | void RemoteConsole::Close() 49 | { 50 | IVSDKDotNet::IVGame::Console::Close(); 51 | } 52 | 53 | void RemoteConsole::Print(String^ Text) 54 | { 55 | IVSDKDotNet::IVGame::Console::Print(Text); 56 | } 57 | 58 | void RemoteConsole::SendCommand(String^ CommandLine) 59 | { 60 | if (isNULL(CommandLine) || (CommandLine->Length == 0)) 61 | return; 62 | 63 | IVSDKDotNet::IVGame::Console::ExecuteCommand(CommandLine); 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/bObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "Player.h" 26 | #include "Ped.h" 27 | #include "Game.h" 28 | #include "bObject.h" 29 | 30 | #pragma managed 31 | 32 | namespace GTA 33 | { 34 | namespace base 35 | { 36 | 37 | bool Object::Exists() 38 | { 39 | if (!bExists) 40 | return false; 41 | 42 | bExists = InternalCheckExists(); 43 | 44 | // Some hacks if the function above returned false 45 | if (!bExists) 46 | { 47 | 48 | int playerPedHandle; 49 | int playerVehicleHandle; 50 | GetManagerScript()->GetPlayerAndCurrentVehicleHandle(playerPedHandle, playerVehicleHandle); 51 | 52 | // HACK: If the UID (Handle) is equal to the player ped handle then always return true as the player ped never stops existing... 53 | if (UID == playerPedHandle) 54 | bExists = true; 55 | 56 | } 57 | 58 | if (bExists) 59 | return true; 60 | 61 | OnCeasedToExist(EventArgs::Empty); 62 | return false; 63 | } 64 | 65 | } 66 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fButton.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fButton.h" 28 | 29 | #include "Font.h" 30 | #include "Graphics.h" 31 | 32 | #pragma managed 33 | 34 | using namespace IVSDKDotNet; 35 | 36 | namespace GTA 37 | { 38 | namespace Forms 39 | { 40 | 41 | void Button::OnPaint() 42 | { 43 | if (ImGuiIV::Button(Text)) 44 | { 45 | System::Numerics::Vector2 mousePos = ImGuiIV::GetMousePos(); 46 | Control::OnClick(gcnew GTA::MouseEventArgs(true, PointF(mousePos.X, mousePos.Y), System::Windows::Forms::MouseButtons::Left)); 47 | } 48 | } 49 | 50 | void Button::OnMouseDown(GTA::MouseEventArgs^ e) 51 | { 52 | Control::OnMouseDown(e); 53 | } 54 | void Button::OnDragRelease(GTA::MouseEventArgs^ e) 55 | { 56 | Control::OnDragRelease(e); 57 | } 58 | 59 | void Button::OnClick(GTA::MouseEventArgs^ e) 60 | { 61 | if (e->Button != Windows::Forms::MouseButtons::Left) 62 | return; 63 | Control::OnClick(e); 64 | } 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/bMouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace base 29 | { 30 | CLASS_ATTRIBUTES 31 | public ref class Mouse abstract 32 | { 33 | internal: 34 | Mouse(){} 35 | 36 | public: 37 | property bool Enabled 38 | { 39 | virtual bool get() abstract; 40 | virtual void set(bool value) abstract; 41 | } 42 | property Drawing::PointF Position 43 | { 44 | virtual Drawing::PointF get() abstract; 45 | } 46 | property Drawing::PointF Movement 47 | { 48 | virtual Drawing::PointF get() abstract; 49 | } 50 | property Drawing::Point PositionPixel 51 | { 52 | Drawing::Point get(); 53 | } 54 | property Drawing::Point MovementPixel 55 | { 56 | Drawing::Point get(); 57 | } 58 | property System::Windows::Forms::MouseButtons PressedButtons 59 | { 60 | virtual System::Windows::Forms::MouseButtons get() abstract; 61 | } 62 | 63 | virtual bool isButtonDown(System::Windows::Forms::MouseButtons Button) abstract; 64 | 65 | }; 66 | } 67 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fMouse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fMouse.h" 28 | 29 | #include "Game.h" 30 | #include "Player.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA 35 | { 36 | namespace Forms 37 | { 38 | 39 | // - - - Properties, Methods and Functions - - - 40 | void Mouse::Enabled::set(bool value) 41 | { 42 | if (value) 43 | Game::LocalPlayer->CanControlCharacter = false; 44 | else 45 | Game::LocalPlayer->CanControlCharacter = true; 46 | 47 | IVSDKDotNet::ImGuiIV::ForceCursor = value; 48 | } 49 | 50 | Drawing::PointF Mouse::GetMovement() 51 | { 52 | float s = IVSDKDotNet::Native::Natives::GET_MOUSE_SENSITIVITY() * 0.0025f; 53 | float ratio = float(GTA::Game::Resolution.Width) / float(GTA::Game::Resolution.Height); // Y axis has to be faster 54 | int x = 0; int y = 0; 55 | IVSDKDotNet::Native::Natives::GET_MOUSE_INPUT(x, y); 56 | return Drawing::PointF(float(x) * s, float(y) * s * ratio); 57 | } 58 | 59 | } 60 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/sRoom.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "sRoom.h" 26 | 27 | #pragma managed 28 | 29 | namespace GTA{ 30 | 31 | //String^ Room::Name::get() { 32 | // //GetStringFromHashKey(pHash) 33 | // if (pName == "") pName = gcnew String( Scripting::GetModelNameForDebug((Scripting::eModel)pHash) ); 34 | // return pName; 35 | //} 36 | 37 | bool Room::operator == (Room left, Room right) { 38 | return ( (left.RoomKey == right.RoomKey) && (left.InteriorID == right.InteriorID) ); 39 | } 40 | bool Room::operator != (Room left, Room right) { 41 | return !(left == right); 42 | } 43 | 44 | Room Room::FromString(String^ StringID) { 45 | if isNULL(StringID) return Room(0,0); 46 | array^ vals = StringID->Trim()->Split('_'); 47 | if ((vals->Length != 3) || (vals[0] != "R")) return Room(0,0); 48 | return Room(Helper::HexToInteger(vals[1]), Helper::HexToInteger(vals[2])); 49 | } 50 | String^ Room::ToString() { 51 | return ( "R_" + Helper::ToHex(pRoomKey) + "_" + Helper::ToHex(pInteriorID) ); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fKeybox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "fKeybox.h" 26 | 27 | #include "Font.h" 28 | #include "Graphics.h" 29 | 30 | #pragma managed 31 | 32 | namespace GTA { 33 | namespace Forms { 34 | 35 | void Keybox::OnPaint(GTA::GraphicsEventArgs^ e) { 36 | 37 | } 38 | 39 | void Keybox::OnClick(GTA::MouseEventArgs^ e) { 40 | if (bAwaitKey) return; 41 | if (e->Button == Windows::Forms::MouseButtons::Left) { 42 | bAwaitKey = true; 43 | pCurrentKey = Windows::Forms::Keys::None; 44 | } else if (e->Button == Windows::Forms::MouseButtons::Right) { 45 | SelectedKey = Windows::Forms::Keys::None; 46 | } 47 | } 48 | void Keybox::OnKeyDown(GTA::KeyEventArgs^ e) { 49 | if (bAwaitKey) { 50 | pCurrentKey = e->KeyWithModifiers; 51 | } 52 | Control::OnKeyDown(e); 53 | } 54 | void Keybox::OnKeyUp(GTA::KeyEventArgs^ e) { 55 | if (bAwaitKey && (pCurrentKey != Windows::Forms::Keys::None)) { 56 | SelectedKey = pCurrentKey; 57 | bAwaitKey = false; 58 | } 59 | Control::OnKeyDown(e); 60 | } 61 | 62 | } 63 | } -------------------------------------------------------------------------------- /TestScriptVB/Scripts/BodyguardScript.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Windows.Forms 3 | Imports GTA 4 | 5 | ' ### Spawn Bodyguards with the INSERT key, and kill them with the DELETE key ### 6 | Public Class BodyguardScript 7 | Inherits Script 8 | 9 | Private Group As Group = Player.Group 10 | Private PedModel As Model = "M_Y_BOUNCER_02" 11 | 12 | Public Sub New() 13 | Interval = 250 14 | End Sub 15 | 16 | Private Sub BodyguardScript_KeyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown 17 | Select Case e.Key 18 | 19 | Case Keys.Insert 20 | If Group.MemberCount < 3 Then ' limit to 3 members, to make sure that all fit in a car 21 | Dim p As Ped = World.CreatePed(PedModel, Player.Character.Position.Around(3.0F), RelationshipGroup.Player) 22 | AddToGroup(p) 23 | End If 24 | 25 | Case Keys.Delete 26 | For Each Member As Ped In Group 27 | Member.Weapons.RemoveAll() 28 | Member.Die() 29 | Next 30 | Group.RemoveAllMembers() 31 | 32 | End Select 33 | End Sub 34 | 35 | Private Sub AddToGroup(ByVal p As Ped) 36 | If Not Exists(p) Then Return ' check if the ped is valid 37 | If Group.isMember(p) Then Return 38 | 39 | p.CurrentRoom = Player.Character.CurrentRoom ' required, or ped won't be visible when spawned inside a building 40 | p.WillDoDrivebys = True 41 | p.PriorityTargetForEnemies = True 42 | p.DuckWhenAimedAtByGroupMember = False 43 | p.SetPathfinding(True, True, True) 44 | p.AlwaysDiesOnLowHealth = True 45 | p.Accuracy = 100 46 | 47 | Dim weap As Weapon = Player.Character.Weapons.Current 48 | p.Weapons(weap).Ammo = 30000 49 | p.Weapons.MP5.Ammo = 30000 50 | p.Weapons.Select(weap) ' activate same weapon as the one the player carries 51 | 52 | p.RelationshipGroup = RelationshipGroup.Player 53 | p.ChangeRelationship(RelationshipGroup.Player, Relationship.Companion) 54 | p.CantBeDamagedByRelationshipGroup(RelationshipGroup.Player, True) 55 | 56 | Group.AddMember(p) 57 | Game.DisplayText(Group.MemberCount & " members in gang") 58 | End Sub 59 | 60 | End Class -------------------------------------------------------------------------------- /ScriptHookDotNet/vResources.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class Resources sealed { 31 | 32 | private: 33 | Script^ script; 34 | 35 | internal: 36 | Resources(Script^ script); 37 | 38 | public: 39 | 40 | /// 41 | /// Returns the data of an embedded resource file included in the script 42 | /// 43 | array^ GetData(String^ ResourceName); 44 | 45 | /// 46 | /// Returns the text of an embedded resource file included in the script 47 | /// 48 | String^ GetText(String^ ResourceName, System::Text::Encoding^ Encoding); 49 | 50 | /// 51 | /// Returns the text of an embedded resource file included in the script 52 | /// 53 | String^ GetText(String^ ResourceName); 54 | 55 | /// 56 | /// Returns a Texture contained as an embedded resource file in the script 57 | /// 58 | Texture^ GetTexture(String^ ResourceName); 59 | 60 | }; 61 | 62 | } 63 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmBeingShotHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class BeingShotHelper : public CustomHelper { 31 | 32 | public: 33 | 34 | BeingShotHelper(GTA::Ped^ Ped) 35 | :CustomHelper(Ped, nmMessageID::nm198_shot){ 36 | } 37 | 38 | property bool ReachForWound { 39 | void set(bool value) { 40 | SetValue(nmString::nm203_reachForWound,value); 41 | } 42 | } 43 | 44 | /// 45 | /// Time before the ped will reach for the wound, given in seconds. 46 | /// 47 | property float TimeBeforeReachForWound { 48 | void set(float value) { 49 | SetValue(nmString::nm215_timeBeforeReachForWound,value); 50 | } 51 | } 52 | 53 | /// 54 | /// Time before the ped will collapse, given in seconds. 55 | /// 56 | property float TimeBeforeCollapse { 57 | void set(float value) { 58 | SetValue(nmString::nm216_timeBeforeCollapseWoundLeg,value); 59 | } 60 | } 61 | 62 | }; 63 | 64 | } 65 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/ScriptedFire.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "ScriptedFire.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | 34 | // - - - Constructor - - - 35 | ScriptedFire::ScriptedFire(int Handle) 36 | :HandleObject(Handle, HandleType::ScriptedFire) 37 | { 38 | } 39 | 40 | // - - - Properties, Methods and Functions - - - 41 | Vector3 ScriptedFire::Position::get() 42 | { 43 | NON_EXISTING_CHECK(V3_NaN); 44 | float x, y, z; 45 | IVSDKDotNet::Native::Natives::GET_SCRIPT_FIRE_COORDS(pHandle, x, y, z); 46 | return Vector3(x, y, z); 47 | } 48 | 49 | bool ScriptedFire::InternalCheckExists() 50 | { 51 | if (pHandle == 0) 52 | return false; 53 | 54 | return IVSDKDotNet::Native::Natives::DOES_SCRIPT_FIRE_EXIST(pHandle); 55 | } 56 | void ScriptedFire::Delete() 57 | { 58 | NON_EXISTING_CHECK_RELAXED_NO_RETURN(); 59 | SetExistsFalse(); 60 | 61 | if (pHandle == 0) 62 | return; 63 | 64 | IVSDKDotNet::Native::Natives::REMOVE_SCRIPT_FIRE(pHandle); 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fTextbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | CLASS_ATTRIBUTES 31 | public ref class Textbox : public GTA::Forms::Control 32 | { 33 | private: 34 | int pMaxLength; 35 | bool pBorder; 36 | 37 | public: 38 | Textbox() 39 | { 40 | BackColor = Drawing::Color::FromArgb(50, 255, 255, 255); 41 | pMaxLength = -1; 42 | pBorder = true; 43 | } 44 | 45 | public protected: 46 | virtual void OnKeyDown(GTA::KeyEventArgs^ e) override; 47 | 48 | internal: 49 | virtual void OnPaint() override; 50 | 51 | protected: 52 | property Drawing::Size DefaultSize 53 | { 54 | virtual Drawing::Size get() override 55 | { 56 | return Drawing::Size(128,32); 57 | } 58 | } 59 | 60 | public: 61 | property bool Border 62 | { 63 | bool get() { return pBorder; } 64 | void set(bool value) { pBorder = value; } 65 | } 66 | property int MaxLength 67 | { 68 | int get() { return pMaxLength; } 69 | void set(int value) { pMaxLength = value; } 70 | } 71 | 72 | }; 73 | } 74 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fListbox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "fListbox.h" 28 | 29 | #include "Font.h" 30 | #include "Graphics.h" 31 | #include "fScrollbar.h" 32 | 33 | #pragma managed 34 | 35 | using namespace IVSDKDotNet; 36 | 37 | namespace GTA 38 | { 39 | namespace Forms 40 | { 41 | 42 | Listbox::Listbox() 43 | { 44 | BackColor = Drawing::Color::FromArgb(50, 255, 255, 255); 45 | pSelectionColor = Drawing::Color::FromArgb(127, 48, 64, 192); 46 | pBorder = true; 47 | pSelectedIndex = -1; 48 | pScrollbarSize = 16; 49 | } 50 | 51 | void Listbox::OnPaint() 52 | { 53 | if (ImGuiIV::BeginListBox(Text)) 54 | { 55 | 56 | for (int i = 0; i < Items->Count; i++) 57 | { 58 | ListboxItem^ item = Items[i]; 59 | 60 | if (ImGuiIV::Selectable(item->DisplayText, i == pSelectedIndex)) 61 | pSelectedIndex = i; 62 | } 63 | 64 | ImGuiIV::EndListBox(); 65 | } 66 | } 67 | 68 | void Listbox::OnMouseDown(GTA::MouseEventArgs^ e) 69 | { 70 | Control::OnMouseDown(e); 71 | } 72 | 73 | } 74 | } -------------------------------------------------------------------------------- /ScriptHookDotNet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34728.123 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptHookDotNet", "ScriptHookDotNet\ScriptHookDotNet.vcxproj", "{5DD209AC-1B5F-483A-BCA9-150CAD228C5A}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugTest", "DebugTest\DebugTest.csproj", "{ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|Win32 = Debug|Win32 14 | Release|Any CPU = Release|Any CPU 15 | Release|Win32 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Debug|Any CPU.ActiveCfg = Debug|Win32 19 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Debug|Any CPU.Build.0 = Debug|Win32 20 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Debug|Win32.Build.0 = Debug|Win32 22 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Release|Any CPU.ActiveCfg = Release|Win32 23 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Release|Any CPU.Build.0 = Release|Win32 24 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Release|Win32.ActiveCfg = Release|Win32 25 | {5DD209AC-1B5F-483A-BCA9-150CAD228C5A}.Release|Win32.Build.0 = Release|Win32 26 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Debug|Win32.ActiveCfg = Debug|Any CPU 29 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Debug|Win32.Build.0 = Debug|Any CPU 30 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Release|Win32.ActiveCfg = Release|Any CPU 33 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13}.Release|Win32.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /DebugTest/DebugTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {ED9BB8A9-8456-4D1D-8D65-11CC8B49DC13} 8 | Library 9 | Properties 10 | DebugTest 11 | DebugTest.net 12 | v4.8 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {5dd209ac-1b5f-483a-bca9-150cad228c5a} 44 | ScriptHookDotNet 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /TestScriptCS/Scripts/ScriptCommunicationExample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using GTA; 4 | 5 | namespace TestScriptCS { 6 | 7 | 8 | // ### This example shall show inter-script-communication using ScriptCommands. ### 9 | // ### The first script gets a random Ped and sends it to the second script. ### 10 | // ### The second script can then process the Ped as usual. ### 11 | 12 | public class ScriptCommunicationExample1 : Script { 13 | 14 | // Scripts are identified by GUIDs. Here we store the GUID of our target script into a global variable for later use 15 | Guid GuidOfScript2 = new Guid("0652B17E-FB29-11DD-97BB-2E9356D89593"); 16 | 17 | public ScriptCommunicationExample1() { 18 | this.Tick += new EventHandler(this.ScriptCommunicationExample1_Tick); 19 | } 20 | 21 | private void ScriptCommunicationExample1_Tick(object sender, EventArgs e) { 22 | if (isKeyPressed(Keys.T)) SendAPedToScript2(); // Look for Peds every Frame, while T is pressed 23 | } 24 | 25 | private void SendAPedToScript2() { 26 | Ped p = World.GetRandomPed(Player.Character.Position, 10.0F); // get a random Ped 27 | if (!Exists(p)) return; // make sure that p is valid and not empty 28 | SendScriptCommand(GuidOfScript2, "DoSomethingWithPed", p); // send a command, with our ped attached, to the second script 29 | } 30 | 31 | } 32 | 33 | public class ScriptCommunicationExample2 : Script { 34 | 35 | public ScriptCommunicationExample2() { 36 | // set the script's GUID to enable other scripts to send messages to it. 37 | // IMPORTANT: DO NOT use the same GUID for multiple scripts! Generate a new one instead! 38 | // Google "generate guid" to find an online GUID generator! 39 | GUID = new Guid("0652B17E-FB29-11DD-97BB-2E9356D89593"); 40 | 41 | BindScriptCommand("DoSomethingWithPed", new ScriptCommandDelegate(ThrowAPed)); 42 | } 43 | 44 | private void ThrowAPed(GTA.Script sender, GTA.ObjectCollection Parameter) { 45 | Ped ped = Parameter.Convert(0); 46 | if (!Exists(ped) || ped.isInAir) return; 47 | ped.ApplyForce(new Vector3(0.0F, 0.0F, 5.0F), new Vector3(0.0F, 5.0F, 0.0F)); 48 | } 49 | 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/dEventArgs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | 28 | using namespace System; 29 | using namespace System::Collections::Generic; 30 | using namespace System::Reflection; 31 | using namespace System::Globalization; 32 | 33 | namespace Design { 34 | 35 | [System::ComponentModel::EditorBrowsableAttribute(EditorBrowsableState::Never)] 36 | [SerializableAttribute] 37 | public ref class DesignerHostEventArgs : System::EventArgs { 38 | private: 39 | System::ComponentModel::Design::IDesignerHost^ pDesignerHost; 40 | 41 | internal: 42 | DesignerHostEventArgs(System::ComponentModel::Design::IDesignerHost^ DesignerHost) { 43 | pDesignerHost = DesignerHost; 44 | } 45 | 46 | public: 47 | property System::ComponentModel::Design::IDesignerHost^ DesignerHost { 48 | System::ComponentModel::Design::IDesignerHost^ get() { 49 | return pDesignerHost; 50 | } 51 | } 52 | 53 | }; 54 | [System::ComponentModel::EditorBrowsableAttribute(EditorBrowsableState::Never)] 55 | public delegate void DesignerHostEventHandler(System::Object^ sender, DesignerHostEventArgs^ e); 56 | 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmLeanTowardsObjectHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | // DOES NOT WORK!!! 30 | CLASS_ATTRIBUTES 31 | private ref class LeanTowardsObjectHelper : public CustomHelper { 32 | 33 | public: 34 | 35 | LeanTowardsObjectHelper(GTA::Ped^ Ped) 36 | :CustomHelper(Ped, nmMessageID::nm124_leanTowardsObject){ 37 | } 38 | 39 | /// 40 | /// The offset from the object. 41 | /// positive X is right, positive Y is in front, positive Z is on Top 42 | /// 43 | property Vector3 Offset { 44 | void set(Vector3 value) { 45 | SetValue(nmString::nm126_offset,value); 46 | } 47 | } 48 | 49 | property float Amount { 50 | void set(float value) { 51 | SetValue(nmString::nm127_leanAmount,value); 52 | } 53 | } 54 | property bool ApplyAsForce { 55 | void set(bool value) { 56 | SetValue(nmString::nm129_applyAsForce,value); 57 | } 58 | } 59 | 60 | property base::HandleObject^ ObjectToLeanTo { 61 | void set(base::HandleObject^ value) { 62 | SetValue(nmString::nm128_instanceIndex,value); 63 | } 64 | } 65 | 66 | }; 67 | 68 | } 69 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Team.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Multiplayer { 28 | 29 | public ref class Team sealed { 30 | 31 | private: 32 | int pID; 33 | 34 | public: 35 | Team(int ID); 36 | 37 | property int ID { 38 | int get(); 39 | } 40 | 41 | property int MemberCount { 42 | int get(); 43 | } 44 | 45 | property int ColorID { 46 | int get(); 47 | void set(int value); 48 | } 49 | property Drawing::Color Color { 50 | Drawing::Color get(); 51 | } 52 | 53 | property GTA::RelationshipGroup RelationshipGroup { 54 | GTA::RelationshipGroup get() { 55 | if (ID < 0) return GTA::RelationshipGroup::Player; 56 | return (GTA::RelationshipGroup)(int(GTA::RelationshipGroup::NetworkTeam_1) + ID); 57 | } 58 | } 59 | 60 | static bool operator == ( Team^ left, Team^ right ) { 61 | if (Object::ReferenceEquals(left,nullptr)) return Object::ReferenceEquals(right,nullptr); 62 | if (Object::ReferenceEquals(right,nullptr)) return false; 63 | return (left->ID == right->ID); 64 | } 65 | static bool operator != ( Team^ left, Team^ right ) { 66 | return !(left == right); 67 | } 68 | 69 | }; 70 | 71 | } 72 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/ModelConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | namespace GTA { 26 | 27 | value class Model; 28 | 29 | namespace Design { 30 | 31 | public ref class ModelConverter : System::ComponentModel::ExpandableObjectConverter { 32 | 33 | public: 34 | ModelConverter() { } 35 | 36 | virtual bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext^ context, System::Type^ destinationType) override; 37 | virtual bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext^ context, System::Type^ sourceType) override; 38 | virtual System::Object^ ConvertTo(System::ComponentModel::ITypeDescriptorContext^ context, System::Globalization::CultureInfo^ culture, System::Object^ value, System::Type^ destinationType) override; 39 | virtual System::Object^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext^ context, System::Globalization::CultureInfo^ culture, System::Object^ value) override; 40 | virtual bool GetCreateInstanceSupported(System::ComponentModel::ITypeDescriptorContext^ context) override; 41 | virtual System::Object^ CreateInstance(System::ComponentModel::ITypeDescriptorContext^ context, System::Collections::IDictionary^ propertyValues) override; 42 | }; 43 | } 44 | } -------------------------------------------------------------------------------- /TestScriptCS/Scripts/BodyguardScript.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using GTA; 4 | 5 | namespace TestScriptCS { 6 | 7 | 8 | // ### Spawn Bodyguards with the INSERT key, and kill them with the DELETE key ### 9 | public class BodyguardScript : Script { 10 | 11 | Group group; 12 | Model PedModel = "M_Y_BOUNCER_02"; 13 | 14 | public BodyguardScript() { 15 | Interval = 250; 16 | group = Player.Group; 17 | 18 | this.KeyDown += new GTA.KeyEventHandler(this.BodyguardScript_KeyDown); 19 | } 20 | 21 | private void BodyguardScript_KeyDown(object sender, GTA.KeyEventArgs e) { 22 | switch (e.Key) { 23 | 24 | case Keys.Insert: 25 | if (group.MemberCount < 3) { // limit to 3 members, to make sure that all fit in a car 26 | Ped p = World.CreatePed(PedModel, Player.Character.Position.Around(3.0F), RelationshipGroup.Player); 27 | AddToGroup(p); 28 | } 29 | break; 30 | 31 | case Keys.Delete: 32 | foreach (Ped member in group) { 33 | member.Weapons.RemoveAll(); 34 | member.Die(); 35 | } 36 | group.RemoveAllMembers(); 37 | break; 38 | } 39 | } 40 | 41 | private void AddToGroup(Ped p) { 42 | if (!Exists(p)) return; // check if the ped is valid 43 | 44 | p.CurrentRoom = Player.Character.CurrentRoom; // required, or ped won't be visible when spawned inside a building 45 | p.WillDoDrivebys = true; 46 | p.PriorityTargetForEnemies = true; 47 | p.DuckWhenAimedAtByGroupMember = false; 48 | p.AlwaysDiesOnLowHealth = true; 49 | p.SetPathfinding(true, true, true); 50 | 51 | Weapon weap = Player.Character.Weapons.CurrentType; 52 | p.Weapons.FromType(weap).Ammo = 30000; 53 | p.Weapons.MP5.Ammo = 30000; 54 | p.Weapons.Select(weap); // activate same weapon as the one the player carries 55 | 56 | p.RelationshipGroup = RelationshipGroup.Player; 57 | p.ChangeRelationship(RelationshipGroup.Player, Relationship.Companion); 58 | p.CantBeDamagedByRelationshipGroup(RelationshipGroup.Player, true); 59 | 60 | group.AddMember(p); 61 | Game.DisplayText(group.MemberCount + " members in gang"); 62 | } 63 | 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Team.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Team.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | namespace Multiplayer 34 | { 35 | 36 | // - - - Constructor - - - 37 | Team::Team(int ID) 38 | { 39 | this->pID = ID; 40 | } 41 | 42 | // - - - Properties, Methods and Functions - - - 43 | int Team::ID::get() 44 | { 45 | return pID; 46 | } 47 | 48 | int Team::MemberCount::get() 49 | { 50 | return IVSDKDotNet::Native::Natives::GET_NO_OF_PLAYERS_IN_TEAM(pID); 51 | } 52 | 53 | int Team::ColorID::get() 54 | { 55 | NotImplementedYet("Team::ColorID::get"); 56 | //u32 pCol = 0; 57 | //IVSDKDotNet::Native::Natives::GET_TEAM_COLOUR(pID, pCol); 58 | //return (int)pCol; 59 | return 0; 60 | } 61 | void Team::ColorID::set(int value) 62 | { 63 | NotImplementedYet("Team::ColorID::set"); 64 | //IVSDKDotNet::Native::Natives::SET_TEAM_COLOUR(pID,value); 65 | } 66 | 67 | Drawing::Color Team::Color::get() 68 | { 69 | int R = 0; int G = 0; int B = 0; 70 | IVSDKDotNet::Native::Natives::GET_TEAM_RGB_COLOUR(pID, R, G, B); 71 | return Drawing::Color::FromArgb(R, G, B); 72 | } 73 | 74 | } 75 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/nTemplate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include "stdafx.h" 26 | //#include "nFunction.h" 27 | #include "nTemplate.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | namespace Native 34 | { 35 | 36 | Template::Template(String^ Name, ... array^ Arguments) 37 | { 38 | pName = Name; 39 | pReturnType = nullptr; 40 | pArguments = Arguments; 41 | bInvoked = false; 42 | } 43 | Template::Template(String^ Name, System::Type^ ReturnType, ... array^ Arguments) 44 | { 45 | pName = Name; 46 | pReturnType = ReturnType; 47 | pArguments = Arguments; 48 | bInvoked = false; 49 | } 50 | 51 | System::Object^ Template::Invoke() 52 | { 53 | //if isNULL(pReturnType) 54 | //{ 55 | // Function::Call(pName, pArguments); 56 | // pReturnValue = nullptr; 57 | //} 58 | //else 59 | //{ 60 | // pReturnValue = Function::Call(pName, pReturnType, pArguments); 61 | //} 62 | bInvoked = true; 63 | //if isNotNULL(wInvoked) wInvoked->Set(); 64 | return pReturnValue; 65 | } 66 | 67 | //void Template::WaitForInvoke() { 68 | // if isNULL(wInvoked) wInvoked = gcnew System::Threading::ManualResetEvent(false); 69 | // wInvoked->WaitOne(); 70 | //} 71 | 72 | } 73 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vGlobals.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "vGlobals.h" 28 | 29 | #pragma managed 30 | 31 | namespace GTA 32 | { 33 | namespace value 34 | { 35 | 36 | // - - - Properties, Methods and Functions - - - 37 | bool Globals::AreGlobalsSupported::get() 38 | { 39 | return IVSDKDotNet::IVTheScripts::GetGlobalAddress(0) != 0; 40 | } 41 | 42 | int Globals::ReadInteger(int index) 43 | { 44 | return IVSDKDotNet::IVTheScripts::GetGlobalInteger(index); 45 | } 46 | float Globals::ReadFloat(int index) 47 | { 48 | return IVSDKDotNet::IVTheScripts::GetGlobalFloat(index); 49 | } 50 | String^ Globals::ReadString(int index) 51 | { 52 | return IVSDKDotNet::IVTheScripts::GetGlobalString(index); 53 | } 54 | 55 | void Globals::Write(int index, int value) 56 | { 57 | IVSDKDotNet::IVTheScripts::SetGlobal(index, value); 58 | } 59 | void Globals::Write(int index, float value) 60 | { 61 | IVSDKDotNet::IVTheScripts::SetGlobal(index, value); 62 | } 63 | void Globals::Write(int index, String^ value, int MaxLength) 64 | { 65 | if (MaxLength <= 0) 66 | value = String::Empty; 67 | else if (value->Length > MaxLength) 68 | value = value->Substring(0, MaxLength); 69 | 70 | IVSDKDotNet::IVTheScripts::SetGlobal(index, value); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/nTemplate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | 29 | namespace Native 30 | { 31 | 32 | ref class Parameter; 33 | 34 | CLASS_ATTRIBUTES 35 | [SerializableAttribute] 36 | public ref class Template sealed 37 | { 38 | 39 | private: 40 | 41 | String^ pName; 42 | array^ pArguments; 43 | System::Type^ pReturnType; 44 | System::Object^ pReturnValue; 45 | bool bInvoked; 46 | //System::Threading::ManualResetEvent^ wInvoked; 47 | 48 | public: 49 | 50 | Template(String^ Name, ... array^ Arguments); 51 | Template(String^ Name, System::Type^ ReturnType, ... array^ Arguments); 52 | 53 | property String^ Name { 54 | String^ get() 55 | { 56 | return pName; 57 | } 58 | } 59 | property System::Object^ ReturnValue { 60 | System::Object^ get() 61 | { 62 | return pReturnValue; 63 | } 64 | } 65 | property bool wasInvoked { 66 | bool get() 67 | { 68 | return bInvoked; 69 | } 70 | } 71 | property int ArgumentCount { 72 | int get() 73 | { 74 | return pArguments->Length; 75 | } 76 | } 77 | 78 | Parameter^ Argument(int index) 79 | { 80 | return pArguments[index]; 81 | } 82 | 83 | System::Object^ Invoke(); 84 | 85 | //void WaitForInvoke(); 86 | 87 | }; 88 | 89 | } 90 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vWeapon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class Weapon sealed { 31 | 32 | private: 33 | Ped^ pOwner; 34 | GTA::Weapon pID; 35 | 36 | internal: 37 | Weapon(Ped^ Owner, GTA::Weapon ID); 38 | 39 | public: 40 | 41 | property GTA::Weapon Type { 42 | GTA::Weapon get() { 43 | return pID; 44 | } 45 | } 46 | property GTA::WeaponSlot Slot { 47 | GTA::WeaponSlot get(); 48 | } 49 | property bool isPresent { 50 | bool get(); 51 | } 52 | 53 | property int Ammo { 54 | int get(); 55 | void set(int value); 56 | } 57 | property int AmmoInClip { 58 | int get(); 59 | void set(int value); 60 | } 61 | property int MaxAmmo { 62 | int get(); 63 | } 64 | property int MaxAmmoInClip { 65 | int get(); 66 | } 67 | 68 | void Select(); 69 | void Remove(); 70 | 71 | static operator GTA::Weapon (Weapon^ source); 72 | 73 | static bool operator == ( Weapon^ left, Weapon^ right ); 74 | static bool operator != ( Weapon^ left, Weapon^ right ); 75 | 76 | static bool operator == ( GTA::Weapon left, Weapon^ right ); 77 | static bool operator != ( GTA::Weapon left, Weapon^ right ); 78 | 79 | static bool operator == ( Weapon^ left, GTA::Weapon right ); 80 | static bool operator != ( Weapon^ left, GTA::Weapon right ); 81 | 82 | }; 83 | 84 | } 85 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Garage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | public ref class Garage sealed 29 | { 30 | private: 31 | String^ pName; 32 | 33 | internal: 34 | Garage(String^ Name); 35 | 36 | public: 37 | property String^ Name 38 | { 39 | String^ get() 40 | { 41 | return pName; 42 | } 43 | } 44 | property bool DontAffectCamera 45 | { 46 | void set(bool value); 47 | } 48 | property GarageType Type 49 | { 50 | void set(GarageType value); 51 | } 52 | property bool isClosed 53 | { 54 | bool get(); 55 | } 56 | property bool isOpen 57 | { 58 | bool get(); 59 | //void set(bool value); 60 | } 61 | 62 | void Open(); 63 | void Close(); 64 | 65 | bool isVehicleInside(Vehicle^ vehicle); 66 | 67 | /// 68 | /// Returns all vehicles inside the garage. SLOW! Use isVehicleInside istead if possible! 69 | /// 70 | array^ GetVehiclesInside(); 71 | 72 | static void AbortAllGarageActivity(); 73 | 74 | static bool operator == ( Garage^ left, Garage^ right ) 75 | { 76 | if (Object::ReferenceEquals(left,nullptr)) return Object::ReferenceEquals(right,nullptr); 77 | if (Object::ReferenceEquals(right,nullptr)) return false; 78 | return (left->Name == right->Name); 79 | } 80 | static bool operator != ( Garage^ left, Garage^ right ) 81 | { 82 | return !(left == right); 83 | } 84 | 85 | }; 86 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vPedAnimation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #include "stdafx.h" 24 | 25 | #include "vPedAnimation.h" 26 | 27 | #include "AnimationSet.h" 28 | #include "Game.h" 29 | #include "Ped.h" 30 | #include "vTasks.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA { 35 | namespace value { 36 | 37 | PedAnimation::PedAnimation(Ped^ ped) { 38 | this->ped = ped; 39 | } 40 | 41 | bool PedAnimation::isPlaying(GTA::AnimationSet^ AnimationSet, String^ AnimationName) { 42 | if isNULL(AnimationSet) return false; 43 | return AnimationSet->isPedPlayingAnimation(ped,AnimationName); 44 | } 45 | float PedAnimation::GetCurrentAnimationTime(GTA::AnimationSet^ AnimationSet, String^ AnimationName) { 46 | if isNULL(AnimationSet) return 0.0f; 47 | return AnimationSet->GetPedsCurrentAnimationTime(ped,AnimationName); 48 | } 49 | void PedAnimation::WaitUntilFinished(GTA::AnimationSet^ AnimationSet, String^ AnimationName) { 50 | if isNULL(AnimationSet) return; 51 | while (AnimationSet->isPedPlayingAnimation(ped,AnimationName)) { 52 | //WHILE_LOG("PedAnimation::WaitUntilFinished"); // <- This should work now 53 | GTA::Game::WaitInCurrentScript(0); 54 | } 55 | } 56 | 57 | void PedAnimation::Play(GTA::AnimationSet^ AnimationSet, String^ AnimationName, float Speed, AnimationFlags Flags) { 58 | ped->Task->PlayAnimation(AnimationSet, AnimationName, Speed, Flags); 59 | } 60 | void PedAnimation::Play(GTA::AnimationSet^ AnimationSet, String^ AnimationName, float Speed) { 61 | ped->Task->PlayAnimation(AnimationSet, AnimationName, Speed); 62 | } 63 | 64 | } 65 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Texture.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Texture.h" 28 | 29 | #include "D3D_Device.h" 30 | 31 | #pragma managed 32 | 33 | namespace GTA 34 | { 35 | 36 | Texture::Texture(array^ ImageData) 37 | { 38 | pOwningScript = GetCallingScript(); 39 | 40 | InitValues(); 41 | 42 | if ( isNULL(ImageData) || (ImageData->Length == 0) ) 43 | throw gcnew Exception("ImageData for Texture is empty!"); 44 | 45 | data = ImageData; 46 | } 47 | Texture::~Texture() 48 | { // Dispose 49 | this->!Texture(); 50 | } 51 | Texture::!Texture() 52 | { // Finalize 53 | 54 | } 55 | 56 | void Texture::InitValues() 57 | { 58 | pInternalPointer = IntPtr::Zero; 59 | } 60 | 61 | void Texture::Unload(bool permanent) 62 | { 63 | if (pInternalPointer != IntPtr::Zero) 64 | { 65 | Direct3D::ReleaseTexture(this); 66 | pInternalPointer = IntPtr::Zero; 67 | } 68 | } 69 | void Texture::Reload() 70 | { 71 | //Unload(false); 72 | 73 | if (isNULL(data) || data->Length == 0) 74 | throw gcnew Exception("No image data!"); 75 | 76 | int textureWidth; 77 | int textureHeight; 78 | pInternalPointer = Direct3D::NewTextureInternal(pOwningScript, data, textureWidth, textureHeight); 79 | } 80 | 81 | int Texture::GetInternalPointer(bool retrieveNew) 82 | { 83 | if (pInternalPointer == IntPtr::Zero && retrieveNew) 84 | Reload(); 85 | 86 | return pInternalPointer.ToInt32(); 87 | } 88 | int Texture::GetD3DObjectID(bool retrieveNew) 89 | { 90 | return -1; 91 | } 92 | 93 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NetHook.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #pragma once 26 | #include "stdafx.h" 27 | 28 | #include "NetHook.h" 29 | 30 | #pragma managed 31 | 32 | namespace GTA 33 | { 34 | 35 | void NetHook::VerboseLog(String^ Text) 36 | { 37 | if (VERBOSE) 38 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Verbose Log] {0}", Text)); 39 | } 40 | void NetHook::VerboseLog(String^ Text, Exception^ ex) 41 | { 42 | if (VERBOSE) 43 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Exception Verbose] {0} - Exception: {1}", Text, ex)); 44 | } 45 | void NetHook::VerboseLog(Exception^ ex) 46 | { 47 | if (VERBOSE) 48 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Exception Verbose] {0}", ex)); 49 | } 50 | 51 | void NetHook::Log(String^ Text) 52 | { 53 | Log(Text, false, false); 54 | } 55 | void NetHook::Log(String^ Text, Exception^ ex) 56 | { 57 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Exception] {0} - Exception: {1}", Text, ex)); 58 | } 59 | void NetHook::Log(Exception^ ex) 60 | { 61 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Exception] {0}", ex)); 62 | } 63 | void NetHook::Log(String^ Text, bool InsertEmptyLine, bool Truncate) 64 | { 65 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook Log] {0}", Text)); 66 | } 67 | void NetHook::LogInner(Exception^ ex) 68 | { 69 | IVSDKDotNet::IVGame::Console::PrintWarning(String::Format("[SHDN: NetHook LogInner Exception] {0}", ex)); 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fCheckbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | namespace Forms 29 | { 30 | 31 | using namespace Drawing; 32 | 33 | CLASS_ATTRIBUTES 34 | [System::ComponentModel::DefaultEventAttribute("CheckedChanged")] 35 | public ref class Checkbox : public GTA::Forms::Control 36 | { 37 | private: 38 | Drawing::Color pCheckColor; 39 | bool bChecked; 40 | 41 | public: 42 | event EventHandler^ CheckedChanged; 43 | 44 | public protected: 45 | 46 | virtual void OnMouseDown(GTA::MouseEventArgs^ e) override; 47 | 48 | internal: 49 | virtual void OnPaint() override; 50 | virtual void OnCheckedChanged(EventArgs^ e) 51 | { 52 | CheckedChanged(this, e); 53 | } 54 | 55 | protected: 56 | property Drawing::Size DefaultSize 57 | { 58 | virtual Drawing::Size get() override 59 | { 60 | return Drawing::Size(128,32); 61 | } 62 | } 63 | 64 | public: 65 | Checkbox() 66 | { 67 | pCheckColor = Drawing::Color::FromArgb(240, 48, 64, 192); 68 | bChecked = false; 69 | } 70 | 71 | property Drawing::Color CheckColor 72 | { 73 | Drawing::Color get() 74 | { 75 | return pCheckColor; 76 | } 77 | void set(Drawing::Color value) 78 | { 79 | pCheckColor = value; 80 | } 81 | } 82 | 83 | property bool Checked 84 | { 85 | bool get() 86 | { 87 | return bChecked; 88 | } 89 | void set(bool value) 90 | { 91 | if (bChecked == value) 92 | return; 93 | bChecked = value; 94 | OnCheckedChanged(EventArgs::Empty); 95 | } 96 | } 97 | 98 | }; 99 | 100 | } 101 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/dColorConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | 28 | using namespace System; 29 | using namespace System::ComponentModel; 30 | using namespace System::ComponentModel::Design; 31 | using namespace System::ComponentModel::Design::Serialization; 32 | using namespace System::Collections::Generic; 33 | using namespace System::Reflection; 34 | using namespace System::Globalization; 35 | 36 | namespace Design { 37 | 38 | [System::ComponentModel::EditorBrowsableAttribute(EditorBrowsableState::Never)] 39 | public ref class ColorConverter : public TypeConverter { 40 | 41 | private: 42 | static bool bInit = false; 43 | //static Dictionary^ Methods; 44 | //static List^ MethodNames; 45 | static TypeConverter::StandardValuesCollection^ stdval; 46 | 47 | //static void GetStaticMethods(Type^ enumType, Type^ returnType); 48 | 49 | public: 50 | ColorConverter(); 51 | 52 | virtual bool CanConvertFrom(ITypeDescriptorContext^ context, Type^ sourceType) override; 53 | virtual bool CanConvertTo(ITypeDescriptorContext^ context, Type^ destinationType) override; 54 | 55 | virtual Object^ ConvertFrom(ITypeDescriptorContext^ context, CultureInfo^ culture, Object^ value) override; 56 | virtual Object^ ConvertTo(ITypeDescriptorContext^ context, CultureInfo^ culture, Object^ value, Type^ destinationType) override; 57 | 58 | virtual StandardValuesCollection^ GetStandardValues(ITypeDescriptorContext^ context) override; 59 | virtual bool GetStandardValuesSupported(ITypeDescriptorContext^ context) override; 60 | virtual bool GetStandardValuesExclusive(ITypeDescriptorContext^ context) override; 61 | 62 | }; 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ScriptHookDotNet/Pickup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | CLASS_ATTRIBUTES 29 | [SerializableAttribute] 30 | public ref class Pickup sealed : 31 | public base::HandleObject, 32 | public base::iPositioned, 33 | public base::iInteriorObject, 34 | public base::iDeletable 35 | { 36 | public: 37 | Pickup(int Handle); 38 | 39 | internal: 40 | virtual bool InternalCheckExists() override; 41 | 42 | public: 43 | 44 | property Vector3 Position { 45 | virtual Vector3 get(); 46 | private: virtual void set(Vector3 value) sealed = base::iPositioned::Position::set; 47 | } 48 | /// 49 | /// Gets or sets the interior room the pickup currently is at. It needs to be set correctly for the pickup to be visible inside the room. 50 | /// 51 | property Room CurrentRoom { 52 | virtual Room get(); 53 | virtual void set(Room value); 54 | } 55 | 56 | property bool CollectableByCar { 57 | void set(bool value); 58 | } 59 | 60 | property bool HasBeenCollected { 61 | bool get(); 62 | } 63 | 64 | void GiveToPed(Ped^ ped); 65 | 66 | Blip^ AttachBlip(); 67 | 68 | //virtual bool Exists() override; 69 | 70 | virtual void Delete(); 71 | 72 | static GTA::Pickup^ CreatePickup(Vector3 Position, GTA::Model Model, PickupType Type, Vector3 Rotation); 73 | static GTA::Pickup^ CreatePickup(Vector3 Position, GTA::Model Model, PickupType Type); 74 | static GTA::Pickup^ CreateWeaponPickup(Vector3 Position, GTA::Weapon Weapon, int Ammo, Vector3 Rotation); 75 | static GTA::Pickup^ CreateWeaponPickup(Vector3 Position, GTA::Weapon Weapon, int Ammo); 76 | static GTA::Pickup^ CreateMoneyPickup(Vector3 Position, int MoneyAmount); 77 | 78 | }; 79 | 80 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Garage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "Garage.h" 28 | 29 | #include "Vehicle.h" 30 | #include "World.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA 35 | { 36 | 37 | // - - - Constructor - - - 38 | Garage::Garage(String^ Name) 39 | { 40 | this->pName = Name; 41 | } 42 | 43 | // - - - Properties, Methods and Functions - - - 44 | void Garage::DontAffectCamera::set(bool value) 45 | { 46 | IVSDKDotNet::Native::Natives::SET_GARAGE_LEAVE_CAMERA_ALONE(pName, value); 47 | } 48 | void Garage::Type::set(GarageType value) 49 | { 50 | IVSDKDotNet::Native::Natives::CHANGE_GARAGE_TYPE(pName, (int)value); 51 | } 52 | 53 | bool Garage::isClosed::get() 54 | { 55 | return IVSDKDotNet::Native::Natives::IS_GARAGE_CLOSED(pName); 56 | } 57 | bool Garage::isOpen::get() 58 | { 59 | return IVSDKDotNet::Native::Natives::IS_GARAGE_OPEN(pName); 60 | } 61 | 62 | void Garage::Open() 63 | { 64 | IVSDKDotNet::Native::Natives::OPEN_GARAGE(pName); 65 | } 66 | void Garage::Close() 67 | { 68 | IVSDKDotNet::Native::Natives::CLOSE_GARAGE(pName); 69 | } 70 | 71 | bool Garage::isVehicleInside(Vehicle^ vehicle) 72 | { 73 | OBJECT_NON_EXISTING_CHECK(vehicle, false); 74 | return IVSDKDotNet::Native::Natives::IS_CAR_IN_GARAGE_AREA(pName, vehicle->Handle); 75 | } 76 | 77 | array^ Garage::GetVehiclesInside() 78 | { 79 | List^ list = gcnew List(); 80 | for each (Vehicle ^ v in World::GetAllVehicles()) 81 | { 82 | if (isVehicleInside(v)) 83 | list->Add(v); 84 | } 85 | return list->ToArray(); 86 | } 87 | 88 | void Garage::AbortAllGarageActivity() 89 | { 90 | IVSDKDotNet::Native::Natives::ABORT_ALL_GARAGE_ACTIVITY(); 91 | } 92 | 93 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/SkinTemplate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | CLASS_ATTRIBUTES 29 | public ref class SkinTemplate sealed { 30 | 31 | private: 32 | 33 | GTA::Model pModel; 34 | array^ PropIndices; 35 | array^ ComponentModel; 36 | array^ ComponentTexture; 37 | 38 | void Initialize(); 39 | 40 | internal: 41 | static const int PROP_COUNT = 20; 42 | static const int COMPONENT_COUNT = 20; 43 | 44 | SkinTemplate(value::PedSkin^ sk); 45 | 46 | void FromPedSkin(value::PedSkin^ sk); 47 | void ApplyToPed(Ped^ ped); 48 | void ApplyToPlayer(Player^ player); 49 | 50 | public: 51 | SkinTemplate(); 52 | 53 | property GTA::Model Model { 54 | GTA::Model get(); 55 | void set(GTA::Model value); 56 | } 57 | 58 | int GetPropIndex(PedProp proptype) { 59 | return PropIndices[(int)proptype]; 60 | } 61 | void SetPropIndex(PedProp proptype, int index) { 62 | PropIndices[(int)proptype] = index; 63 | } 64 | 65 | int GetComponentModel(PedComponent component) { 66 | return ComponentModel[(int)component]; 67 | } 68 | void SetComponentModel(PedComponent component, int model) { 69 | ComponentModel[(int)component] = model; 70 | } 71 | 72 | int GetComponentTexture(PedComponent component) { 73 | return ComponentTexture[(int)component]; 74 | } 75 | void SetComponentTexture(PedComponent component, int texture) { 76 | ComponentTexture[(int)component] = texture; 77 | } 78 | 79 | void SetComponent(PedComponent component, int model, int texture) { 80 | SetComponentModel(component, model); 81 | SetComponentTexture(component, texture); 82 | } 83 | 84 | virtual String^ ToString() override; 85 | static SkinTemplate^ FromString(String^ input); 86 | 87 | }; 88 | 89 | } -------------------------------------------------------------------------------- /TestScriptVB/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.1 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | Imports System 15 | 16 | Namespace My.Resources 17 | 18 | 'This class was auto-generated by the StronglyTypedResourceBuilder 19 | 'class via a tool like ResGen or Visual Studio. 20 | 'To add or remove a member, edit your .ResX file then rerun ResGen 21 | 'with the /str option, or rebuild your VS project. 22 | ''' 23 | ''' A strongly-typed resource class, for looking up localized strings, etc. 24 | ''' 25 | _ 29 | Friend Module Resources 30 | 31 | Private resourceMan As Global.System.Resources.ResourceManager 32 | 33 | Private resourceCulture As Global.System.Globalization.CultureInfo 34 | 35 | ''' 36 | ''' Returns the cached ResourceManager instance used by this class. 37 | ''' 38 | _ 39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 40 | Get 41 | If Object.ReferenceEquals(resourceMan, Nothing) Then 42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("TestScriptVB.Resources", GetType(Resources).Assembly) 43 | resourceMan = temp 44 | End If 45 | Return resourceMan 46 | End Get 47 | End Property 48 | 49 | ''' 50 | ''' Overrides the current thread's CurrentUICulture property for all 51 | ''' resource lookups using this strongly typed resource class. 52 | ''' 53 | _ 54 | Friend Property Culture() As Global.System.Globalization.CultureInfo 55 | Get 56 | Return resourceCulture 57 | End Get 58 | Set 59 | resourceCulture = value 60 | End Set 61 | End Property 62 | End Module 63 | End Namespace 64 | -------------------------------------------------------------------------------- /ScriptHookDotNet/Camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA{ 27 | 28 | CLASS_ATTRIBUTES 29 | [SerializableAttribute] 30 | public ref class Camera sealed : 31 | public base::HandleObject, 32 | public base::iPositioned, 33 | public base::iRotatable, 34 | public base::iDeletable 35 | { 36 | public: 37 | Camera(int Handle); 38 | 39 | internal: 40 | virtual bool InternalCheckExists() override; 41 | 42 | public: 43 | Camera(); 44 | 45 | property Vector3 Position { 46 | virtual Vector3 get(); 47 | virtual void set(Vector3 value); 48 | } 49 | 50 | property Vector3 Rotation { 51 | Vector3 get(); 52 | void set(Vector3 value); 53 | } 54 | property Vector3 Direction { 55 | virtual Vector3 get(); 56 | void set(Vector3 value); 57 | } 58 | 59 | property float Heading { 60 | virtual float get(); 61 | virtual void set(float value); 62 | } 63 | property float Roll { 64 | float get(); 65 | void set(float value); 66 | } 67 | 68 | property float FOV { 69 | float get(); 70 | void set(float value); 71 | } 72 | property bool isActive { 73 | bool get(); 74 | void set(bool value); 75 | } 76 | property float DrunkEffectIntensity { 77 | void set(float value); 78 | } 79 | 80 | void Activate(); 81 | void Deactivate(); 82 | virtual void Delete(); 83 | bool isSphereVisible(Vector3 Position, float Radius); 84 | void TargetPed(Ped^ ped); 85 | void LookAt(GTA::Object^ object); 86 | void LookAt(Vehicle^ vehicle); 87 | void LookAt(Ped^ ped); 88 | void LookAt(Vector3 Position); 89 | 90 | //virtual bool Exists() override; 91 | 92 | //static bool operator == ( Camera^ left, Camera^ right ); 93 | //static bool operator != ( Camera^ left, Camera^ right ); 94 | 95 | }; 96 | 97 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | CLASS_ATTRIBUTES 29 | public ref class Timer : base::ScriptChild 30 | { 31 | private: 32 | int pStartTime; 33 | int pStoppedElapsedTime; 34 | int pLastTick; 35 | int pInterval; 36 | bool bRunning; 37 | bool bHandled; 38 | 39 | property int CurrentTime 40 | { 41 | int get(); 42 | } 43 | 44 | void EachTick(Object^ sender, EventArgs^ e); 45 | void CheckHandler(); 46 | void InitValues(); 47 | 48 | public: 49 | Timer(int Interval, bool StartNow); 50 | Timer(int Interval); 51 | Timer(); 52 | 53 | event EventHandler^ Tick; 54 | 55 | /// 56 | /// Time elapsed since the last Start. Does not increase when the Timer is stopped. 57 | /// 58 | property int ElapsedTime 59 | { 60 | int get(); 61 | } 62 | 63 | property bool isRunning 64 | { 65 | bool get() { return bRunning; } 66 | } 67 | 68 | /// 69 | /// The interval (in Milliseconds) at which the Tick event will be fired. The Tick event will not run if Interval is negative. 70 | /// Any Wait() in your Script will delay the next Tick until after the Wait is finished. 71 | /// 72 | property int Interval 73 | { 74 | int get() { return pInterval; } 75 | void set(int value); 76 | } 77 | 78 | /// 79 | /// Starts the Timer and resets the ElapsedTime back to 0. The Tick event will fire each Interval if Interval is greater than or equal to 0. 80 | /// 81 | void Start(); 82 | 83 | /// 84 | /// Stops the Timer from firing Tick events and freezes the current value of ElapsedTime. 85 | /// 86 | void Stop(); 87 | 88 | protected: 89 | virtual void OnTick(EventArgs^ e) 90 | { 91 | Tick(this, e); 92 | } 93 | 94 | }; 95 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/Checkpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA 27 | { 28 | using namespace System; 29 | 30 | CLASS_ATTRIBUTES 31 | public ref class Checkpoint sealed : public base::ScriptChild 32 | { 33 | private: 34 | System::Drawing::Color pColor; 35 | bool bVisible; 36 | float pDiameter; 37 | Vector3 pPosition; 38 | 39 | void EachTick(Object^ sender, EventArgs^ e); 40 | 41 | public: 42 | Checkpoint(Vector3 Position, System::Drawing::Color Color, float Diameter) : base::ScriptChild(GetCallingScript()) 43 | { 44 | bVisible = false; 45 | pColor = Color; 46 | pDiameter = Diameter; 47 | pPosition = Position; 48 | Visible = true; 49 | } 50 | Checkpoint() : base::ScriptChild(GetCallingScript()) 51 | { 52 | bVisible = false; 53 | pColor = System::Drawing::Color::White; 54 | pDiameter = 3.0F; 55 | pPosition = Vector3(); 56 | } 57 | 58 | void Disable() 59 | { 60 | Visible = false; 61 | } 62 | 63 | property bool Visible 64 | { 65 | bool get() 66 | { 67 | return bVisible; 68 | } 69 | void set(bool value); 70 | } 71 | property System::Drawing::Color Color 72 | { 73 | System::Drawing::Color get() 74 | { 75 | return pColor; 76 | } 77 | void set(System::Drawing::Color value) 78 | { 79 | pColor = value; 80 | } 81 | } 82 | property Vector3 Position 83 | { 84 | Vector3 get() 85 | { 86 | return pPosition; 87 | } 88 | void set(Vector3 value) 89 | { 90 | pPosition = value; 91 | } 92 | } 93 | property float Diameter 94 | { 95 | float get() 96 | { 97 | return pDiameter; 98 | } 99 | void set(float value) 100 | { 101 | pDiameter = value; 102 | } 103 | } 104 | }; 105 | 106 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmCustom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class CustomMessage : public BaseMessage { 31 | 32 | public: 33 | 34 | CustomMessage(nmMessageID MessageID) 35 | :BaseMessage(MessageID){ 36 | } 37 | 38 | property nmMessageID MessageID { 39 | nmMessageID get() { 40 | return pMessageID; 41 | } 42 | } 43 | 44 | /// 45 | /// Start the Euphoria animation. Maximum duration is 65535 milliseconds. Calling this will disable previous Euphoria animations. 46 | /// 47 | void SendTo(GTA::Ped^ TargetPed, int Duration) { 48 | pApplyTo(TargetPed,Duration); 49 | } 50 | 51 | /// 52 | /// Start the Euphoria animation. It will run up to a maximum of 65 seconds, or until the first previous Euphoria animation ends. Previous Euphoria animations will NOT be disabled. 53 | /// 54 | void SendTo(GTA::Ped^ TargetPed) { 55 | pApplyTo(TargetPed); 56 | } 57 | 58 | void Abort(GTA::Ped^ TargetPed) { 59 | General::Abort(TargetPed,pMessageID); 60 | } 61 | 62 | }; 63 | 64 | public ref class CustomHelper : public BaseHelper { 65 | 66 | public: 67 | 68 | CustomHelper(GTA::Ped^ Ped, nmMessageID MessageID) 69 | :BaseHelper(Ped, MessageID){ 70 | } 71 | 72 | /// 73 | /// Start the Euphoria animation. Maximum duration is 65535 milliseconds. Calling this will disable previous Euphoria animations. 74 | /// 75 | void Start(int Duration) { 76 | pStart(Duration); 77 | } 78 | /// 79 | /// Start the Euphoria animation. It will run up to a maximum of 65 seconds, or until the first previous Euphoria animation ends. Previous Euphoria animations will NOT be disabled. 80 | /// 81 | void Start() { 82 | pStart(); 83 | } 84 | 85 | }; 86 | 87 | } 88 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/vPedSkin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace value { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class PedSkin { 31 | 32 | private: 33 | PedComponentCollection^ pComponent; 34 | 35 | internal: 36 | Ped^ ped; 37 | 38 | PedSkin(Ped^ ped) { 39 | this->ped = ped; 40 | } 41 | 42 | public: 43 | 44 | property value::PedComponentCollection^ Component { 45 | value::PedComponentCollection^ get(); 46 | } 47 | 48 | property GTA::Model Model { 49 | virtual GTA::Model get(); 50 | } 51 | 52 | property SkinTemplate^ Template { 53 | virtual SkinTemplate^ get(); 54 | virtual void set(SkinTemplate^ value); 55 | } 56 | 57 | int GetPropIndex(PedProp proptype); 58 | void SetPropIndex(PedProp proptype, int index); 59 | 60 | //int GetAvailableModelCount(PedComponent component); 61 | //int GetAvailableTextureCount(PedComponent component); 62 | 63 | //int GetComponentModel(PedComponent component); 64 | //void SetComponentModel(PedComponent component, int model); 65 | 66 | //int GetComponentTexture(PedComponent component); 67 | //void SetComponentTexture(PedComponent component, int texture); 68 | 69 | //void SetComponent(PedComponent component, int model, int texture); 70 | 71 | static operator SkinTemplate^ (PedSkin^ source); 72 | 73 | }; 74 | 75 | CLASS_ATTRIBUTES 76 | public ref class PlayerSkin sealed : public PedSkin { 77 | 78 | private: 79 | Player^ player; 80 | 81 | internal: 82 | PlayerSkin(Player^ player); 83 | 84 | public: 85 | 86 | property GTA::Model Model { 87 | virtual GTA::Model get() override { return PedSkin::Model; } 88 | void set(GTA::Model value); 89 | } 90 | property SkinTemplate^ Template { 91 | virtual SkinTemplate^ get() override { return PedSkin::Template; } 92 | virtual void set(SkinTemplate^ value) override; 93 | } 94 | 95 | }; 96 | 97 | } 98 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/TaskSequence.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | // IV-SDK .NET translation layer by ItsClonkAndre 24 | 25 | #include "stdafx.h" 26 | 27 | #include "TaskSequence.h" 28 | 29 | #include "Ped.h" 30 | #include "vTasks.h" 31 | 32 | #pragma managed 33 | 34 | namespace GTA 35 | { 36 | 37 | // - - - Constructor - - - 38 | TaskSequence::TaskSequence(int Handle) 39 | { 40 | this->pHandle = Handle; 41 | CreatePedNull(); 42 | } 43 | TaskSequence::TaskSequence() 44 | { 45 | int task = 0; 46 | IVSDKDotNet::Native::Natives::OPEN_SEQUENCE_TASK(task); 47 | this->pHandle = task; 48 | CreatePedNull(); 49 | } 50 | TaskSequence::~TaskSequence() 51 | { 52 | IVSDKDotNet::Native::Natives::CLEAR_SEQUENCE_TASK(pHandle); 53 | } 54 | 55 | // - - - Properties, Methods and Functions - - - 56 | void TaskSequence::CreatePedNull() 57 | { 58 | if (hasPedNull) 59 | return; 60 | 61 | hasPedNull = true; 62 | //if (TaskSequence::pednull == nullptr) TaskSequence::pednull = gcnew GTA::Ped(0); 63 | pednull = gcnew GTA::Ped(0); 64 | //pednull = gcnew GTA::Ped(0); 65 | } 66 | 67 | int TaskSequence::Handle::get() 68 | { 69 | return pHandle; 70 | } 71 | value::Tasks^ TaskSequence::AddTask::get() 72 | { 73 | if (bClosed) 74 | { 75 | throw gcnew Exception("You can't add Tasks to a closed TaskSequence!"); 76 | return nullptr; 77 | } 78 | 79 | return pednull->Task; 80 | } 81 | 82 | void TaskSequence::Perform(GTA::Ped^ TargetPed) 83 | { 84 | OBJECT_NON_EXISTING_CHECK_NO_RETURN(TargetPed); 85 | 86 | if (!bClosed) 87 | { 88 | bClosed = true; 89 | IVSDKDotNet::Native::Natives::CLOSE_SEQUENCE_TASK(pHandle); 90 | } 91 | 92 | IVSDKDotNet::Native::Natives::CLEAR_CHAR_TASKS(TargetPed->Handle); 93 | //Scripting::SetCharKeepTask(TargetPed->Handle,cbool(true)); 94 | TargetPed->BlockPermanentEvents = true; 95 | IVSDKDotNet::Native::Natives::_TASK_PERFORM_SEQUENCE(TargetPed->Handle, pHandle); 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/fKeybox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Forms { 28 | 29 | using namespace Drawing; 30 | 31 | CLASS_ATTRIBUTES 32 | [System::ComponentModel::DefaultEventAttribute("SelectedKeyChanged")] 33 | public ref class Keybox : public GTA::Forms::Control { 34 | 35 | private: 36 | //int pEdgeSize; 37 | //int pEdgeAlpha; 38 | //Drawing::Color pEdgeColorLight; 39 | //Drawing::Color pEdgeColorDark; 40 | System::Windows::Forms::Keys pSelectedKey; 41 | System::Windows::Forms::Keys pCurrentKey; 42 | bool bAwaitKey; 43 | 44 | public: // Events 45 | event GTA::KeyEventHandler^ SelectedKeyChanged; 46 | 47 | public protected: 48 | virtual void OnClick(GTA::MouseEventArgs^ e) override; 49 | virtual void OnKeyDown(GTA::KeyEventArgs^ e) override; 50 | virtual void OnKeyUp(GTA::KeyEventArgs^ e) override; 51 | 52 | protected: 53 | virtual void OnPaint(GTA::GraphicsEventArgs^ e) override; 54 | virtual void OnSelectedKeyChanged(GTA::KeyEventArgs^ e) { 55 | SelectedKeyChanged(this, e); 56 | } 57 | 58 | property Drawing::Size DefaultSize { 59 | virtual Drawing::Size get() override { 60 | return Drawing::Size(192,32); 61 | } 62 | } 63 | 64 | public: 65 | Keybox() { 66 | //pEdgeSize = 2; 67 | //pEdgeAlpha = 100; 68 | BackColor = Drawing::Color::FromArgb(50, 255, 255, 255); 69 | //pEdgeColorLight = Drawing::Color::FromArgb(pEdgeAlpha, 255, 255, 255); 70 | //pEdgeColorDark = Drawing::Color::FromArgb(pEdgeAlpha, 0, 0, 0); 71 | pSelectedKey = System::Windows::Forms::Keys::None; 72 | bAwaitKey = false; 73 | } 74 | 75 | property System::Windows::Forms::Keys SelectedKey { 76 | System::Windows::Forms::Keys get() { 77 | return pSelectedKey; 78 | } 79 | void set(System::Windows::Forms::Keys value) { 80 | if (pSelectedKey == value) return; 81 | pSelectedKey = value; 82 | OnSelectedKeyChanged(gcnew GTA::KeyEventArgs(value)); 83 | } 84 | } 85 | 86 | }; 87 | 88 | } 89 | } -------------------------------------------------------------------------------- /ScriptHookDotNet/NmBodyBalanceHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX) 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #pragma managed 25 | 26 | namespace GTA { 27 | namespace Euphoria { 28 | 29 | CLASS_ATTRIBUTES 30 | public ref class BodyBalanceHelper : public CustomHelper { 31 | 32 | public: 33 | 34 | BodyBalanceHelper(GTA::Ped^ Ped) 35 | :CustomHelper(Ped, nmMessageID::nm079_bodyBalance){ 36 | } 37 | 38 | property bool isBalanced { 39 | bool get() { 40 | return !GetFeedback(nmString::nm080_balance,1); 41 | } 42 | } 43 | 44 | property float Stiffness { 45 | void set(float value) { 46 | SetValue(nmString::nm081_bodyStiffness,value); 47 | } 48 | } 49 | property float Damping { 50 | void set(float value) { 51 | SetValue(nmString::nm082_damping,value); 52 | } 53 | } 54 | 55 | property int MaxSteps { 56 | void set(int value) { 57 | SetValue(nmString::nm085_maxSteps,value); 58 | } 59 | } 60 | 61 | //nm083_elbow, // 1.95 62 | //nm084_shoulder, // 1.4 63 | //nm086_useHeadLook, 64 | //nm087_headLookPos, 65 | //nm088_headLookInstanceIndex, 66 | //nm089_headLookAlwaysTimeout, // 8.7 67 | //nm090_somersaultAngle, 68 | //nm091_somersaultAngleThreshold, // 0.1 69 | //nm092_sideSomersaultAngle, 70 | //nm093_sideSomersaultAngleThreshold, // 0.1 71 | //nm094_returningToBalanceArmsOut, // 1.0 72 | //nm095_armsOutOnPush, // True 73 | //nm096_armsOutStraightenElbows, 74 | //nm097_armsOutMinLean2, 75 | //nm098_bodyTurnTimeout, // 0.6 76 | //nm099_angVelMultiplier, 77 | //nm100_angVelThreshold, 78 | //nm101_armsOutOnPushMultiplier, // 0.8 79 | //nm102_armsOutOnPushTimeout, // 999.0 80 | //nm103_useBodyTurn, 81 | //nm104_elbowAngleOnContact, 82 | //nm105_bendElbowsTime, 83 | //nm106_bendElbowsGait, // -0.3 84 | //nm107_headLookAtVelProb, 85 | //nm108_turnOffProb, // 0.0 86 | //nm109_turn2VelProb, // 0.2 87 | //nm110_turnAwayProb, // 0.0 88 | //nm111_turnLeftProb, // 0.1 89 | //nm112_turnRightProb, // 0.1 90 | //nm113_turn2TargetProb, // 0.6 91 | 92 | }; 93 | 94 | } 95 | } -------------------------------------------------------------------------------- /TestScriptVB/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.1 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.TestScriptVB.My.MySettings 68 | Get 69 | Return Global.TestScriptVB.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | --------------------------------------------------------------------------------