Raised This Month: $ Target: $400
 0% 

high ping kicker help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
G-Man
New Member
Join Date: Jul 2005
Old 07-09-2005 , 13:12   high ping kicker help!
Reply With Quote #1

hi all.

im new here, i cant so mutch engelish but it works fine i think ;)

i want help to do the ping kicker on 150 ping ween kick.

i use this code on the .sma file right now:
Code:
/* AMX Mod script. 
* 
* (c) 2002-2003, OLO 
* This file is provided as is (no warranties). 
* 
* Players with immunity won't be checked 
*/ 

#include <amxmodx> 

new HIGHPING_MAX = 150 // set maximal acceptable ping 
new HIGHPING_TIME = 12  // set in seconds frequency of ping checking
new HIGHPING_TESTS = 5  // minimal number of checks before doing anything

new g_Ping[33]
new g_Samples[33] 

public plugin_init()
{
  register_plugin("High Ping Kicker","0.9.4","default") 
  
  if ( HIGHPING_TIME < 5 ) HIGHPING_TIME = 5
  if ( HIGHPING_TESTS < 3 ) HIGHPING_TESTS = 3  
}

public client_disconnect(id) 
  remove_task( id )

public client_putinserver(id) 
{    
  g_Ping[id] = 0 
  g_Samples[id] = 0

  if ( !is_user_bot(id) ) 
  {
    new param[1]
    param[0] = id 
    set_task( float(HIGHPING_TIME) , "checkPing" , id , param , 1 , "b" )
    set_task( 10.0 , "showWarn" , id , param , 1 )    

  }
} 

kickPlayer( id ) 
{ 
  new name[32]
  get_user_name( id , name , 31 ) 
  client_print(0,print_chat,"** Player %s disconnected due to high ping",name)
  client_cmd(id,"echo ^"** Sorry but you have too high ping, try later (high ping: 150) ...^";disconnect")
} 

public checkPing(param[]) 
{ 
  new id = param[ 0 ] 

  if ( get_user_flags(id) & ADMIN_IMMUNITY ) return // has immunity

  new p, l 

  get_user_ping( id , p , l ) 

  g_Ping[ id ] += p
  ++g_Samples[ id ]

  if ( (g_Samples[ id ] > HIGHPING_TESTS) &&
    (g_Ping[id] / g_Samples[id] > HIGHPING_MAX)  )    
    kickPlayer(id) 
}

public showWarn(param[])
  client_print( param[0] ,print_chat,"* Players with ping higher than %d will be kicked!", HIGHPING_MAX )
i have try do right 150 after this: new HIGHPING_MAX = 150 // set maximal acceptable ping

u will see it on the code.
but it didnt work ween i go on the server its stay 250.
i want change it to 150 how do i do?
__________________
G-Man
G-Man is offline
Send a message via MSN to G-Man Send a message via Yahoo to G-Man
Front Line
Senior Member
Join Date: Jan 2005
Old 07-09-2005 , 13:17  
Reply With Quote #2

oih kid this aint the right topic ...
__________________
My plugins...

Are all Here...Click Me
Front Line is offline
G-Man
New Member
Join Date: Jul 2005
Old 07-09-2005 , 13:19  
Reply With Quote #3

what are u mean with that Front_line ?
__________________
G-Man
G-Man is offline
Send a message via MSN to G-Man Send a message via Yahoo to G-Man
Front Line
Senior Member
Join Date: Jan 2005
Old 07-09-2005 , 13:22  
Reply With Quote #4

well u see kid...this place is for ppl to post there plugins...
post that bs u have stolen there either
a) in support
or b) errors....

u relized how pissed bailo is gonna be now...
hes gonna com afta u with an axe...
__________________
My plugins...

Are all Here...Click Me
Front Line is offline
G-Man
New Member
Join Date: Jul 2005
Old 07-09-2005 , 13:26  
Reply With Quote #5

ok i have do it now.

this topic kan be close/lock.
__________________
G-Man
G-Man is offline
Send a message via MSN to G-Man Send a message via Yahoo to G-Man
Front Line
Senior Member
Join Date: Jan 2005
Old 07-09-2005 , 13:27  
Reply With Quote #6

its gonna be trashed jnust lik your hair.
__________________
My plugins...

Are all Here...Click Me
Front Line is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode