-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slight changes to fix compatibilities for workshop
- Loading branch information
Showing
22 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.2.32519.379 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaserPlugin", "TaserPlugin\TaserPlugin.csproj", "{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {8211B4C0-C2A5-4F47-9273-403B2FE8B55D} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("TaserPlugin")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("TaserPlugin")] | ||
[assembly: AssemblyCopyright("Copyright © 2022")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("91687c7c-8ee8-41ce-88a7-d89e7ecc4d70")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.6")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Rocket.Core.Plugins; | ||
using Rocket.Core; | ||
using Rocket.API; | ||
using Logger = Rocket.Core.Logging.Logger; | ||
using Rocket.Unturned.Events; | ||
using Rocket.Unturned.Player; | ||
using UnityEngine; | ||
using SDG.Unturned; | ||
using Steamworks; | ||
using System.Collections; | ||
using Rocket.Unturned.Chat; | ||
|
||
namespace TaserPlugin | ||
{ | ||
public class TaserPlugin : RocketPlugin<TaserPluginConfig> | ||
{ | ||
public static TaserPlugin instance; | ||
public static List<CSteamID> Tased; | ||
|
||
|
||
|
||
protected override void Load() | ||
{ | ||
instance = this; | ||
|
||
Tased = new List<CSteamID>(); | ||
|
||
UnturnedEvents.OnPlayerDamaged += OnPlayerDamaged; | ||
|
||
Logger.Log($"Loaded {name} version {Assembly.GetName().Version} by Spinkles"); | ||
} | ||
|
||
protected override void Unload() | ||
{ | ||
Tased = null; | ||
|
||
UnturnedEvents.OnPlayerDamaged -= OnPlayerDamaged; | ||
|
||
Logger.Log($"Loaded {name} version {Assembly.GetName().Version} by Spinkles"); | ||
} | ||
|
||
|
||
|
||
private void OnPlayerDamaged(UnturnedPlayer player, ref EDeathCause cause, ref ELimb limb, ref UnturnedPlayer killer, ref Vector3 direction, ref float damage, ref float times, ref bool canDamage) | ||
{ | ||
if (killer.HasPermission(Configuration.Instance.TaserPerm)) | ||
{ | ||
if (Configuration.Instance.Debug) Logger.Log($"{killer.CharacterName} has taser permission."); | ||
|
||
if (killer.Player.equipment.itemID == Configuration.Instance.Taser && killer.Player.equipment.isEquipped) | ||
{ | ||
if (Configuration.Instance.Debug) Logger.Log($"{killer.CharacterName} is using a taser."); | ||
|
||
if (!Tased.Contains(player.CSteamID)) | ||
{ | ||
UnturnedChat.Say(player, "You have been tased!", Color.yellow); | ||
UnturnedChat.Say(killer, $"You have tased {player.CharacterName}.", Color.yellow); | ||
} | ||
|
||
Tased.Add(player.CSteamID); | ||
player.Player.equipment.dequip(); | ||
player.Player.stance.stance = EPlayerStance.PRONE; | ||
player.Player.stance.checkStance(EPlayerStance.PRONE); | ||
player.Player.movement.sendPluginSpeedMultiplier(0f); | ||
player.Player.movement.sendPluginJumpMultiplier(0f); | ||
StartCoroutine(nameof(TaseEnd), player); | ||
StartCoroutine(TaseCheck(player)); | ||
|
||
canDamage = false; | ||
damage = 0; | ||
|
||
return; | ||
|
||
} | ||
|
||
|
||
} | ||
} | ||
|
||
private IEnumerator TaseEnd(UnturnedPlayer player) | ||
{ | ||
yield return new WaitForSeconds(Configuration.Instance.TaseDuration); | ||
|
||
player.Player.movement.sendPluginSpeedMultiplier(1f); | ||
player.Player.movement.sendPluginJumpMultiplier(1f); | ||
|
||
Tased.Remove(player.CSteamID); | ||
} | ||
|
||
private IEnumerator TaseCheck(UnturnedPlayer player) | ||
{ | ||
while (Tased.Contains(player.CSteamID)) | ||
{ | ||
player.Player.equipment.dequip(); | ||
player.Player.stance.stance = EPlayerStance.PRONE; | ||
player.Player.stance.checkStance(EPlayerStance.PRONE); | ||
|
||
yield return new WaitForSeconds(0.3f); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{91687C7C-8EE8-41CE-88A7-D89E7ECC4D70}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>TaserPlugin</RootNamespace> | ||
<AssemblyName>TaserPlugin</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="com.rlabrecque.steamworks.net"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\com.rlabrecque.steamworks.net.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Rocket.API"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\Rocket.API.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Rocket.Core"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\Rocket.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Rocket.Unturned"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\Rocket.Unturned.dll</HintPath> | ||
</Reference> | ||
<Reference Include="SDG.NetTransport"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\SDG.NetTransport.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\UnityEngine.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.CoreModule"> | ||
<HintPath>..\..\..\..\..\Documents\Libraries\UnityEngine.CoreModule.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="TaserPluginConfig.cs" /> | ||
<Compile Include="TaserPlugin.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Rocket.API; | ||
|
||
namespace TaserPlugin | ||
{ | ||
public class TaserPluginConfig : IRocketPluginConfiguration | ||
{ | ||
public string TaserPerm; | ||
public uint Taser; | ||
public float TaseDuration; | ||
public bool Debug; | ||
|
||
|
||
public void LoadDefaults() | ||
{ | ||
TaserPerm = "TaserPlugin.Tase"; | ||
Taser = 51200; | ||
TaseDuration = 5; | ||
Debug = true; | ||
|
||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions
1
TaserPlugin/obj/Debug/TaserPlugin.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5f0ef3270bbef927940e71a1d64bb8a3ac38695a |
15 changes: 15 additions & 0 deletions
15
TaserPlugin/obj/Debug/TaserPlugin.csproj.FileListAbsolute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\TaserPlugin.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\TaserPlugin.pdb | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\Assembly-CSharp.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\com.rlabrecque.steamworks.net.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\Rocket.API.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\Rocket.Core.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\Rocket.Unturned.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\SDG.NetTransport.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\UnityEngine.CoreModule.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\bin\Debug\UnityEngine.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\obj\Debug\TaserPlugin.csproj.AssemblyReference.cache | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\obj\Debug\TaserPlugin.csproj.CoreCompileInputs.cache | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\obj\Debug\TaserPlugin.csproj.CopyComplete | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\obj\Debug\TaserPlugin.dll | ||
C:\Users\pavol\source\repos\Unturned Plugins\TaserPlugin\TaserPlugin\obj\Debug\TaserPlugin.pdb |
Binary file not shown.
Binary file not shown.