File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,12 @@ public static void DropAllWeapons(CCSPlayerController player)
9494
9595 foreach ( var weapon in player . PlayerPawn . Value . WeaponServices . MyWeapons )
9696 {
97- if ( weapon is { IsValid : true , Value . IsValid : true } && ! weapon . Value . DesignerName . Contains ( "weapon_knife" ) )
98- {
99- player . DropActiveWeapon ( ) ;
100-
101- weapon . Value . Remove ( ) ;
102- }
97+ if ( weapon == null || ! weapon . IsValid ) continue ;
98+ var weaponValue = weapon . Value ;
99+ if ( weaponValue == null || ! weaponValue . IsValid ) continue ;
100+ if ( weaponValue . DesignerName != null && weaponValue . DesignerName . Contains ( "weapon_knife" ) || weaponValue . DesignerName != null && weaponValue . DesignerName . Contains ( "weapon_c4" ) ) continue ;
101+ if ( weaponValue . DesignerName == null ) continue ;
102+ Utilities . RemoveItemByDesignerName ( player , weaponValue . DesignerName ) ;
103103 }
104104
105105 }
Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ namespace Spawn_Loadout_GoldKingZ;
1313public 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.2 " ;
16+ public override string ModuleVersion => "1.0.3 " ;
1717 public override string ModuleAuthor => "Gold KingZ" ;
1818 public override string ModuleDescription => "https://github.com/oqyh" ;
1919
20-
2120 public override void Load ( bool hotReload )
2221 {
2322 Configs . Shared . CookiesModule = ModuleDirectory ;
You can’t perform that action at this time.
0 commit comments