Skip to content

Commit 03acc9f

Browse files
authored
1.0.4
1 parent 265cf63 commit 03acc9f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Config/Helper.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static void ClearGroundWeapons()
8484
}
8585
}
8686

87-
public static void DropAllWeapons(CCSPlayerController player)
87+
public static void DropAllWeaponsAndDelete(CCSPlayerController player)
8888
{
8989
if(player == null || !player.IsValid)return;
9090
if(player.PlayerPawn == null || !player.PlayerPawn.IsValid)return;
@@ -99,9 +99,11 @@ public static void DropAllWeapons(CCSPlayerController player)
9999
if (weaponValue == null || !weaponValue.IsValid) continue;
100100
if (weaponValue.DesignerName != null && weaponValue.DesignerName.Contains("weapon_knife") || weaponValue.DesignerName != null && weaponValue.DesignerName.Contains("weapon_c4"))continue;
101101
if(weaponValue.DesignerName == null)continue;
102-
Utilities.RemoveItemByDesignerName(player, weaponValue.DesignerName);
102+
player.DropActiveWeapon();
103+
if (weaponValue.OwnerEntity == null) continue;
104+
if(weaponValue.OwnerEntity.IsValid) continue;
105+
if(weapon.Value != null)weapon.Value.Remove();
103106
}
104-
105107
}
106108
public static void CreateDefaultWeaponsJson()
107109
{

Spawn-Loadout-GoldKingZ.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ namespace Spawn_Loadout_GoldKingZ;
1313
public class SpawnLoadoutGoldKingZ : BasePlugin
1414
{
1515
public override string ModuleName => "Give Weapons On Spawn (Depend The Map Name + Team Side)";
16-
public override string ModuleVersion => "1.0.3";
16+
public override string ModuleVersion => "1.0.4";
1717
public override string ModuleAuthor => "Gold KingZ";
1818
public override string ModuleDescription => "https://github.com/oqyh";
1919

20+
2021
public override void Load(bool hotReload)
2122
{
2223
Configs.Shared.CookiesModule = ModuleDirectory;
@@ -212,7 +213,7 @@ private HookResult OnEventPlayerSpawn(EventPlayerSpawn @event, GameEventInfo inf
212213
{
213214
AddTimer(0.1f, () =>
214215
{
215-
Helper.DropAllWeapons(player);
216+
Helper.DropAllWeaponsAndDelete(player);
216217
});
217218
}
218219

0 commit comments

Comments
 (0)