Skip to content

Commit

Permalink
Added permission for prevent drop by admins
Browse files Browse the repository at this point in the history
  • Loading branch information
doozzik committed Nov 21, 2015
1 parent 90008d0 commit 32b639f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions DropManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SDG.Unturned;
using System;
using System.Collections.Generic;
using Rocket.API;

namespace DropManager
{
Expand All @@ -31,7 +32,7 @@ private void Drop(UnturnedPlayer player, EDeathCause cause, ELimb limb, Steamwor
{
this.showWarnings = Configuration.Instance.ShowWarnings;

if (!Configuration.Instance.LeftOtherDrop) // if we want to clear players inventory before death
if (!Configuration.Instance.LeftOtherDrop || player.IsAdmin || player.HasPermission("dropmanager.alwaysclear")) // if we want to clear players inventory before death
{
ClearAllItems(player);
ClearAllClothes(player);
Expand All @@ -46,7 +47,11 @@ private void Drop(UnturnedPlayer player, EDeathCause cause, ELimb limb, Steamwor
DropAllItems(player); // we will drop all items for get a free space to add new items
}

AddItems(player); // add new items
if (!player.IsAdmin && !player.HasPermission("dropmanager.alwaysclear"))
{
AddItems(player); // add to drop new items, if player is not an admin or dont have special permission
}

}

private void BlackListController(string configBlackList)
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DropManager")]
[assembly: AssemblyDescription("Lets you configure, which new items player will drop after death")]
[assembly: AssemblyDescription("Lets you configure, which items player will drop after death")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DropManager")]
Expand All @@ -32,5 +32,5 @@
// 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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

0 comments on commit 32b639f

Please sign in to comment.