From b22791d4c1690312ea7b7d69c0d515e33b710483 Mon Sep 17 00:00:00 2001 From: jii Date: Mon, 25 Mar 2024 00:11:39 -0500 Subject: [PATCH] fix --- WeaponsGiver.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WeaponsGiver.cs b/WeaponsGiver.cs index 6540a49..5dd88ef 100644 --- a/WeaponsGiver.cs +++ b/WeaponsGiver.cs @@ -50,15 +50,13 @@ private HookResult Event_RoundPrestart(EventRoundPrestart @event, GameEventInfo private HookResult Event_PlayerSpawn(EventPlayerSpawn @event, GameEventInfo info) { - BasePlugin.AddTimer(1, giveWeapons()); + this.AddTimer(1, ()=>GiveWeapons(@event.Userid)); return HookResult.Continue; } - private void giveWeapons() + private void GiveWeapons(CCSPlayerController player) { - var player = @event.Userid; - - if(!player.IsValid || !player.PlayerPawn.IsValid) return HookResult.Continue; + if(!player.IsValid || !player.PlayerPawn.IsValid) return; switch((CsTeam)player.TeamNum) {