Skip to content

Commit

Permalink
Update VIPCore.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
partiusfabaa committed Dec 30, 2023
1 parent 484af7e commit 28f0eb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions VIPCore/VIPCore/VIPCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using CounterStrikeSharp.API.Modules.Entities;
using CounterStrikeSharp.API.Modules.Menu;
using CounterStrikeSharp.API.Modules.Timers;
using CounterStrikeSharp.API.Modules.Utils;
using Dapper;
using Microsoft.Extensions.Logging;
using Modularity;
Expand All @@ -24,7 +23,7 @@ public class VipCore : BasePlugin, ICorePlugin
{
public override string ModuleAuthor => "thesamefabius";
public override string ModuleName => "[VIP] Core";
public override string ModuleVersion => "v1.1.3";
public override string ModuleVersion => "v1.1.4";

public string DbConnectionString = string.Empty;

Expand Down Expand Up @@ -207,7 +206,7 @@ public void SetClientFeature(ulong steamId, string vipGroup, uint index)
private int GetSteamIdFromCommand(string steamId, out CCSPlayerController? player)
{
player = null;

if (steamId.Contains("STEAM_1"))
{
PrintLogError("please change the first digit in your {steamid}. example: {steam1} to {steam0}",
Expand Down Expand Up @@ -908,12 +907,13 @@ public bool PlayerHasFeature(CCSPlayerController player, string feature)

if (user is null or { group: null }) return false;

if (_vipCore.Config.Groups.TryGetValue(user.group, out var vipGroup))
if (!_vipCore.Config.Groups.TryGetValue(user.group, out var vipGroup)) return false;

foreach (var vipGroupValue in vipGroup.Values.Where(vipGroupValue => vipGroupValue.Key == feature))
{
return vipGroup.Values.ContainsKey(feature);
return !string.IsNullOrEmpty(vipGroupValue.Value.ToString());
}

Console.WriteLine("Couldn't find VipGroup in Config.Groups.");
return false;
}

Expand Down

0 comments on commit 28f0eb0

Please sign in to comment.