High Ping block still badly needed here
#1
Have tried all others and nothing works properly.
Why is it that so many plugins work great but not for ping?

Help, anyone able to make one that will do the job?
[RBC] Choobie

Ratbag Clan

Reply

#2
UNTESTED
Code:
using System; using System.Collections.Generic; using Addon; using System.Diagnostics; namespace uh { public class Class1:CPlugin { Stopwatch Time = new Stopwatch(); int Seconds = 10; public override void OnServerLoad() { Time.Start(); ServerPrint("Ping plugin by Archit loaded!"); Seconds=int.Parse(GetServerCFG("Ping", "Re-Check", "10")); base.OnServerLoad(); } Dictionary<int, int> Warns = new Dictionary<int, int>(); public override void OnServerFrame() { if (GetClients() != null&&Time.Elapsed.Seconds==Seconds) { Time.Reset(); foreach (ServerClient Client in GetClients()) { if (Client.Ping > int.Parse(GetServerCFG("Ping", "MaxPing", "300"))) { if (Warns.ContainsKey(Client.ClientNum) && Warns[Client.ClientNum] < int.Parse(GetServerCFG("Ping", "MaxWarns", "5"))) { Warns[Client.ClientNum]++; TellClient(Client.ClientNum, "Reduce your ping else you will be kicked", true); } else if (!Warns.ContainsKey(Client.ClientNum)) { Warns.Add(Client.ClientNum, 1); } else if (Warns[Client.ClientNum] == int.Parse(GetServerCFG("Ping", "MaxWarns", "5"))) { ServerCommand("dropclient " + Client.ClientNum + " \"You have been kicked because of excess ping\""); Warns.Remove(Client.ClientNum); } } } } } } }
Add to sv_config.ini
Code:
[Ping] Re-Check=5 //seconds after which ping is checked again MaxPing=200 //Ping limit MaxWarns=5 //Number of warnings followed by a kick
Reply

#3
(09-30-2012, 08:22)archit Wrote: UNTESTED
Code:
using System; using System.Collections.Generic; using Addon; using System.Diagnostics; namespace uh { public class Class1:CPlugin { Stopwatch Time = new Stopwatch(); int Seconds = 10; public override void OnServerLoad() { Time.Start(); ServerPrint("Ping plugin by Archit loaded!"); Seconds=int.Parse(GetServerCFG("Ping", "Re-Check", "10")); base.OnServerLoad(); } Dictionary<int, int> Warns = new Dictionary<int, int>(); public override void OnServerFrame() { if (GetClients() != null&&Time.Elapsed.Seconds==Seconds) { Time.Reset(); foreach (ServerClient Client in GetClients()) { if (Client.Ping > int.Parse(GetServerCFG("Ping", "MaxPing", "300"))) { if (Warns.ContainsKey(Client.ClientNum) && Warns[Client.ClientNum] < int.Parse(GetServerCFG("Ping", "MaxWarns", "5"))) { Warns[Client.ClientNum]++; TellClient(Client.ClientNum, "Reduce your ping else you will be kicked", true); } else if (!Warns.ContainsKey(Client.ClientNum)) { Warns.Add(Client.ClientNum, 1); } else if (Warns[Client.ClientNum] == int.Parse(GetServerCFG("Ping", "MaxWarns", "5"))) { ServerCommand("dropclient " + Client.ClientNum + " \"You have been kicked because of excess ping\""); Warns.Remove(Client.ClientNum); } } } } } } }
Add to sv_config.ini
Code:
[Ping] Re-Check=5 //seconds after which ping is checked again MaxPing=200 //Ping limit MaxWarns=5 //Number of warnings followed by a kick

thanks but I need a plugin not just the code. don't know how to make plugins.
[RBC] Choobie

Ratbag Clan

Reply

#4
As stated it's untested

here u go.


Attached Files
.rar   ping.rar (Size: 2.42 KB / Downloads: 54)
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#5
(09-30-2012, 14:19)hillbilly Wrote: As stated it's untested

here u go.

Thanks Hillbilly
will test it now
Smile

(10-01-2012, 00:18)choobie Wrote:
(09-30-2012, 14:19)hillbilly Wrote: As stated it's untested

here u go.

Thanks Hillbilly
will test it now
Smile

Tested and not working
tried different settings still no warning.
anyone else wanna give it a test?
[RBC] Choobie

Ratbag Clan

Reply

#6
Had a quick test and it's not working, no messages no kick.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#7
http://www.itsmods.com/forum/Thread-Rele...block.html
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 42,272 09-28-2013, 02:08
Last Post: Monkey Arms
Its My Birthday! Happy birthday, higH! Party Bot 0 2,346 08-31-2013, 00:00
Last Post: Party Bot
  [Release] Ping Warn Plugin v1.1 master131 28 29,341 07-10-2013, 09:34
Last Post: spike17
  IW5 .EXE and .DLL needed jotape99 7 8,992 06-13-2013, 11:27
Last Post: surtek
  Server console needed joey 1 3,334 06-12-2013, 21:19
Last Post: joey
  headphones <help needed> Arteq 11 9,271 06-08-2013, 16:44
Last Post: xfxtroll
  ping warn 1.1, I passed from the server kpoviv 1 3,204 12-13-2012, 09:47
Last Post: XxBRxX
  Black Ops II IWI block decompression/decryption function kokole 7 7,383 12-07-2012, 22:53
Last Post: master131
  Help cOd IV help needed House 5 5,447 10-27-2012, 19:42
Last Post: House
  [Release] Ping block 1.3 archit 17 14,288 10-07-2012, 02:48
Last Post: archit

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.