Jump to content

Ping script


Guest Mondragon

Recommended Posts

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
   }
 }
}

Link to comment
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 ?

Link to comment

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
 }
}

Link to comment
  • 2 weeks later...

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

Link to comment
  • Recently Browsing   0 members

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