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


#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

#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


#4
As stated it's untested

here u go.


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


[Image: b_560_95_1.png]


#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


#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]


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



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 43,040 09-28-2013, 02:08
Last Post: Monkey Arms
  IW5 .EXE and .DLL needed jotape99 7 9,161 06-13-2013, 11:27
Last Post: surtek
  Server console needed joey 1 3,394 06-12-2013, 21:19
Last Post: joey
  headphones <help needed> Arteq 11 9,471 06-08-2013, 16:44
Last Post: xfxtroll
  ping warn 1.1, I passed from the server kpoviv 1 3,285 12-13-2012, 09:47
Last Post: XxBRxX
  Black Ops II IWI block decompression/decryption function kokole 7 7,535 12-07-2012, 22:53
Last Post: master131
  Help cOd IV help needed House 5 5,558 10-27-2012, 19:42
Last Post: House
  [Request] Anti block Plugin | Infected Kasperle 2 4,045 10-06-2012, 18:41
Last Post: DidUknowiPwn
  High I/O EC2 Server crAyon 13 11,955 09-14-2012, 23:39
Last Post: JariZ
  mw3 1.9.441 Ded.Serva - "...insufficient cpu performance" FIX needed itsmods.com76 7 7,517 09-07-2012, 01:26
Last Post: haider

Forum Jump:


Users browsing this thread:
1 Guest(s)

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