Jump to content

Ping script


Guest Mondragon

Recommended Posts

Posted

hi guys im searching for a script where all players with a higher ping as 200-250 kick

can anyone help me please

Posted

For MTA 0.5:

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.maxplayers($1)) {
   if ($mta.ping($1,%a) >= 300) {
     mta.say $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
 }
}

For MTA:SA:

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.server($1).cmax) {
   if ($mta.ping($1,%a) >= 300) {
     mta.text $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
 }
}

Posted

Hi,

and how to use this script? sorry i´ve found nothing in the forum, plz help me...

Posted
Hi,

and how to use this script? sorry i´ve found nothing in the forum, plz help me...

Found nothing in the forum? You search bad :? There were millions of topics about that... You need mirc and mtama

Posted
For MTA 0.5:

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.maxplayers($1)) {
   if ($mta.ping($1,%a) >= 300) {
     mta.say $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
 }
}

For MTA:SA:

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.server($1).cmax) {
   if ($mta.ping($1,%a) >= 300) {
     mta.text $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
 }
}

wouldnt you need to increase %a ?

Posted

agrh, my bad :( always forget that

Thnx for noticing panther :)

MTA0.5

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.maxplayers($1)) {
   if ($mta.ping($1,%a) >= 300) {
     mta.say $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
   !inc %a
 }
}

MTA:SA

on *:SIGNAL:mta.connect:{
 .timer $+ $1 0 10 mta.pingkick $1
}
alias mta.pingkick {
 var %a = 0
 while (%a <= $mta.server($1).cmax) {
   if ($mta.ping($1,%a) >= 300) {
     mta.text $1 Kicking $mta.name($1,%a) for high ping!
     mta.kick $1 %a
   }
   !inc %a
 }
}

  • 2 weeks later...
Posted
is this 1 only for 200-250 ping or can u change it

What you mean? Max allowed ping u can change in following line:

if ($mta.ping($1,%a) >= 300) {

Just replace the '300' number with anything you want

Posted
You forgot:

on *:SIGNAL:mta.disconnect:{
 .timer $+ $1 off
} 

mta.ban 1 $mta.getid(1,Aeron)

works without it anyway, will only give errors when you disconnect, but who cares :P:roll:

Posted

Hey,

Just a script that might be usefull to others, i use it in the XE Server to display your real ping, because i host scripts on a dedicated server beside our main one.

alias xe.ping {
 var %x = $ticks,%p = $$1,%f = c:\ $+ %p $+ .txt,%r = $iif($2 isnum,$2,1),%r = %r * 1000
 if ($com(ping $+ %x)) { .comclose ping $+ %x }
 .comopen ping $+ %x WScript.Shell
 if !$comerr { .comclose ping $+ %x $com(ping $+ %x,Run,3,bstr,$iif($istok(95 98 ME,$os,32),command.com,cmd.exe) /c ping %p -n 1 -w %r > %f,uint,0,bool,true) }
 %p = $read(%f,n,4)
 if (: isin %p) { .remove %f | return $gettok($gettok(%p,2-,58),2,32) }
 else { .remove %f | return Unknown }
}

Basically, pings the IP from the computer that has mirc running. Very fun to play with and very usefull.

Cya,

Tommis

Posted

Tommis, there's one thing.. not everyone hosts scripts on the same dedi as the server :P

For other people it will show the ping between player and admin, not between player and server :wink:

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...