ItsMods

Full Version: Gun Rotation Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys I would really like a script for my Infected server. I want that the players alive get a new weapon every 30 seconds and that there is a timer/countdown with the name of the next weapon displayed

If anyone can make it or if any script already exists please send me the .dll file o ra rar file directly

That pretty much sums it up Big Grin

Thanks in advance Smile
Sorry, TeknoGod is not supported @this forum.
(01-03-2014, 01:51)SailorMoon Wrote: [ -> ]Sorry, TeknoGod is not supported @this forum.

A Plugin Like That Would Be Nice! Big Grin Not Unfinished! Troll
(01-03-2014, 04:07)Casper Wrote: [ -> ]
(01-03-2014, 01:51)SailorMoon Wrote: [ -> ]Sorry, TeknoGod is not supported @this forum.

A Plugin Like That Would Be Nice! Big Grin Not Unfinished! Troll

When you will recognize that you have a lot of deals... you'll understand meh.
Well, I wanted to do a plugin like this, but I don't know how to do a timer. Can someone help me? Big Grin
CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5. using System.Timers;
  6.  
  7. namespace ClassLibrary1
  8. {
  9. public class Class1:CPlugin
  10. {
  11. Timer timer = new Timer();
  12.  
  13. string[] PrimaryWeapons = { "iw5_acr_mp", "iw5_fad_mp","iw5_msr_mp_msrscope","iw5_ak47_mp" };
  14.  
  15. public override void OnServerLoad()
  16. {
  17. timer.Elapsed += new ElapsedEventHandler(tmr);
  18. timer.Interval = 30000;
  19. timer.Enabled = true;
  20. }
  21. public void tmr(object s, ElapsedEventArgs e)
  22. {
  23.  
  24. foreach (ServerClient c in GetClients())
  25. {
  26.  
  27. if (c.Team == Teams.Allies)
  28. {
  29. Random rnd = new Random();
  30.  
  31. int i = rnd.Next(0, PrimaryWeapons.Length);
  32.  
  33. int weap = GetWeapon(PrimaryWeapons[i]);
  34.  
  35. c.Other.PrimaryWeapon = weap;
  36. c.Other.CurrentWeapon = weap;
  37. }
  38.  
  39. iPrintLnBold("Weapons Changed!", c);
  40. }
  41. }
  42. }
  43. }


It's just a code which I used a while ago, it doesn't contain the next weapon info, but it shouldn't be hard to add.
(01-03-2014, 01:23)Astreet Wrote: [ -> ]Hello guys I would really like a script for my Infected server. I want that the players alive get a new weapon every 30 seconds and that there is a timer/countdown with the name of the next weapon displayed

If anyone can make it or if any script already exists please send me the .dll file o ra rar file directly

That pretty much sums it up Big Grin

Thanks in advance Smile

it is forum not support InfinityScript & teknogods
(01-10-2014, 16:35)[HARD] Tony. Wrote: [ -> ]
(01-03-2014, 01:23)Astreet Wrote: [ -> ]Hello guys I would really like a script for my Infected server. I want that the players alive get a new weapon every 30 seconds and that there is a timer/countdown with the name of the next weapon displayed

If anyone can make it or if any script already exists please send me the .dll file o ra rar file directly

That pretty much sums it up Big Grin

Thanks in advance Smile

it is forum not support InfinityScript & teknogods

someone else asked for the plugin for STEAM
(01-10-2014, 16:42)Casper Wrote: [ -> ]
(01-10-2014, 16:35)[HARD] Tony. Wrote: [ -> ]
(01-03-2014, 01:23)Astreet Wrote: [ -> ]Hello guys I would really like a script for my Infected server. I want that the players alive get a new weapon every 30 seconds and that there is a timer/countdown with the name of the next weapon displayed

If anyone can make it or if any script already exists please send me the .dll file o ra rar file directly

That pretty much sums it up Big Grin

Thanks in advance Smile

it is forum not support InfinityScript & teknogods

someone else asked for the plugin for STEAM
there is a plug on pirates, aka random weapons for Infected gametype, using only Inifinyty scipt...