OMD.PlayersFeatures 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OMD.PlayersFeatures --version 1.2.0                
NuGet\Install-Package OMD.PlayersFeatures -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OMD.PlayersFeatures" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OMD.PlayersFeatures --version 1.2.0                
#r "nuget: OMD.PlayersFeatures, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OMD.PlayersFeatures as a Cake Addin
#addin nuget:?package=OMD.PlayersFeatures&version=1.2.0

// Install OMD.PlayersFeatures as a Cake Tool
#tool nuget:?package=OMD.PlayersFeatures&version=1.2.0                

OMD.PlayersFeatures | Nuget Nuget

PlayersFeatures is a plugin for Unturned / OpenMod.

It provides a more ellegant way to use God and Vanish modes without LDM to be installed.

However, it can also integrate with LDM.

Remarks

God mode makes a player immortal, he won't get damage, broke legs, get a bleeding and so on.

Vanish mode makes a player invisible. Other players won't see him. Zombies and animals won't be alerted by a player in vanish mode.

See demonstration here

How to install

Run command openmod install OMD.PlayersFeatures

If you are using RocketMod (even if you set featuresSystem to RocketMod in configuration file):

  • Make sure you disabled god command in .../Rocket/Commands.config.xml file
  • Make sure you disable vanish command in .../Rocket/Commands.config.xml file

Example:

...
<Command Name="god" Enabled="false" Priority="Normal">Rocket.Unturned.Commands.CommandGod/god</Command>
<Command Name="vanish" Enabled="false" Priority="Normal">Rocket.Unturned.Commands.CommandVanish/vanish</Command>
...

Commands

  • /god - Switches your god mode.
  • /vanish - Switches your vanish mode.

Permissions

  • OMD.PlayersFeatures:commands.god: Grants access to the /god command.
  • OMD.PlayersFeatures:commands.vanish: Grants access to the /vanish command.

Configuration

# Sets the features system to use
# Available values:
#  - OpenMod:   plugin will use custom OpenMod's features system (default)    
#  - RocketMod: plugin will use legacy RocketMod's features system
featuresSystem: OpenMod 

Translations

# Prints to player, whenever he uses /god command
god:
  enabled: <color=green>You enabled god mode!
  disabled: <color=yellow>You disabled god mode!

# Prints to player, whenever he uses /vanish command
vanish:
  enabled: <color=green>You enabled vanish mode!
  disabled: <color=yellow>You disabled vanish mode!

For developers

Developers can also access player's features through code. Here's an example of how to do so:

using OpenMod.Unturned.Players;
using OMD.PlayersFeatures.Extensions; // provides an extension method to access player's features

private void Foo(UnturnedPlayer player)
{
    PlayerFeautres features = player.Features(); // gets player's features via extensions method

    bool currentGodMode = features.GodMode; // gets player's current god mode
    bool currentVanishMode = fatures.VanishMode; // gets player's current vanish mode

    features.GodMode = true; // sets player's god mode
    features.VanishMode = false; // sets player's vanish mode
}

By doing so you can access either RocketMod or OpenMod player's features, depends on which featuresSystem type is set in configuration file.

You can find class PlayerFeatures implementation over here: link

Product Compatible and additional computed target framework versions.
.NET Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.0 145 4/6/2024
1.2.0 213 1/6/2024
1.1.0 150 12/27/2023

Made so vanish mode now prevents alerting zombies and animals. See README for demonstration.