Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jithatsonei committed Mar 25, 2024
1 parent 5edbe75 commit b22791d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions WeaponsGiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit b22791d

Please sign in to comment.