Advertisement
Klapek

Untitled

Dec 26th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. namespace GrenadeEvent
  2. {
  3.     class RoundEventHandler : IEventHandlerUpdate
  4.     {
  5.         private readonly Plugin _plugin;
  6.         public RoundEventHandler(Plugin plugin)
  7.         {
  8.             this._plugin = plugin;
  9.         }
  10.        
  11.         public void OnUpdate(UpdateEvent ev)
  12.         {
  13.             _plugin.Info("update");
  14.             if (StaticVars.sw == true)
  15.             {
  16.                
  17.  
  18.                 if (StaticVars.timer == 0)
  19.                 {
  20.                     var onlinePlayers = PluginManager.Manager.Server.GetPlayers();
  21.  
  22.                     foreach (var player in onlinePlayers)
  23.                     {
  24.  
  25.                         player.ThrowGrenade(Smod2.API.ItemType.FRAG_GRENADE, false, Smod2.API.Vector.Forward, false, Smod2.API.Vector.Zero, false, 0, false);
  26.                     }
  27.  
  28.                     StaticVars.timer = 300;
  29.                 }
  30.                 else
  31.                 {
  32.                     _plugin.Info(StaticVars.timer.ToString());
  33.                     StaticVars.timer--;
  34.                 }
  35.                
  36.             }          
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement