Skip to content

Commit e0b0396

Browse files
authored
1.0.1
1 parent 4abee8a commit e0b0396

File tree

6 files changed

+319
-50
lines changed

6 files changed

+319
-50
lines changed

Config/Configs.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,20 @@ private static void SaveConfigData(ConfigData configData)
7777

7878
public class ConfigData
7979
{
80-
public bool GiveOneTimePerRound { get; set; }
80+
public bool GiveOneTimeLoadOutPerRound { get; set; }
81+
public bool GiveOneTimeRefillNadesPerRound { get; set; }
82+
public bool Vips_GiveOneTimeLoadOutPerRound { get; set; }
83+
public bool Vips_GiveOneTimeRefillNadesPerRound { get; set; }
8184
public string Vips { get; set; }
8285
public string empty2 { get; set; }
8386
public string Information_For_You_Dont_Delete_it { get; set; }
8487

8588
public ConfigData()
8689
{
87-
GiveOneTimePerRound = false;
90+
GiveOneTimeLoadOutPerRound = false;
91+
GiveOneTimeRefillNadesPerRound = false;
92+
Vips_GiveOneTimeLoadOutPerRound = false;
93+
Vips_GiveOneTimeRefillNadesPerRound = false;
8894
Vips = "@css/root,@css/admin,@css/vip,#css/admin,#css/vip";
8995
empty2 = "-----------------------------------------------------------------------------------";
9096
Information_For_You_Dont_Delete_it = " Vist [https://github.com/oqyh/cs2-Spawn-Loadout-GoldKingZ/tree/main?tab=readme-ov-file#-configuration-] To Understand All Above";

Config/Globals.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using CounterStrikeSharp.API.Core;
2+
3+
namespace Spawn_Loadout_GoldKingZ;
4+
5+
public class Globals
6+
{
7+
public static Dictionary<ulong, bool> VipsFlag = new Dictionary<ulong, bool>();
8+
public static Dictionary<ulong, bool> Gived = new Dictionary<ulong, bool>();
9+
public static Dictionary<ulong, bool> NadeGived = new Dictionary<ulong, bool>();
10+
public static Dictionary<ulong, bool> VipGived = new Dictionary<ulong, bool>();
11+
public static Dictionary<ulong, bool> VipNadeGived = new Dictionary<ulong, bool>();
12+
public static string SMapName => NativeAPI.GetMapName();
13+
}

Config/Helper.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using CounterStrikeSharp.API.Core;
2+
using CounterStrikeSharp.API.Modules.Admin;
3+
using CounterStrikeSharp.API;
4+
5+
namespace Spawn_Loadout_GoldKingZ;
6+
7+
public class Helper
8+
{
9+
public static bool IsPlayerInGroupPermission(CCSPlayerController player, string groups)
10+
{
11+
var excludedGroups = groups.Split(',');
12+
foreach (var group in excludedGroups)
13+
{
14+
if (group.StartsWith("#"))
15+
{
16+
if (AdminManager.PlayerInGroup(player, group))
17+
return true;
18+
}
19+
else if (group.StartsWith("@"))
20+
{
21+
if (AdminManager.PlayerHasPermissions(player, group))
22+
return true;
23+
}
24+
}
25+
return false;
26+
}
27+
28+
public static void ClearVariables()
29+
{
30+
Globals.VipsFlag.Clear();
31+
Globals.Gived.Clear();
32+
Globals.NadeGived.Clear();
33+
Globals.VipGived.Clear();
34+
Globals.VipNadeGived.Clear();
35+
}
36+
public static List<CCSPlayerController> GetAllController()
37+
{
38+
var playerList = Utilities.FindAllEntitiesByDesignerName<CCSPlayerController>("cs_player_controller").Where(p => p != null && p.IsValid && !p.IsBot && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected).ToList();
39+
return playerList;
40+
}
41+
}

CounterStrikeSharp.API.dll

-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)