Raised This Month: $ Target: $400
 0% 

Run time error 5: memory access


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-13-2009 , 19:51   Re: Run time error 5: memory access
Reply With Quote #2

Try this without arrays
PHP Code:
/* AMX Mod script. 

* (c) 2002-2003, OLO 
* modified by shadow
* This file is provided as is (no warranties). 

* Players with immunity won't be checked 
*/ 

#include <amxmodx> 
#include <amxmisc>

new g_Ping[33]
new 
g_Samples[33]

public 
plugin_init()
{
  
register_plugin("High Ping Kicker (Steam)","0.16.2","OLO/shadow")
  
register_concmd("amx_hpk","cmdHpk",ADMIN_KICK,"- configures high_ping_kicker plugin")
  
register_cvar("amx_hpk_ping","99")
  
register_cvar("amx_hpk_check","10")
  
register_cvar("amx_hpk_tests","5")
  
register_cvar("amx_hpk_delay","60")

  
  if ( 
get_cvar_num"amx_hpk_check" ) < set_cvar_num"amx_hpk_check" )
  if ( 
get_cvar_num"amx_hpk_tests" ) < set_cvar_num"amx_hpk_tests" )
}

public 
client_disconnect(id
  
remove_taskid )

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

  
if ( !is_user_bot(id) ) 
  {
    
set_task10.0 "showWarn" id )
    
    if (
get_cvar_num("amx_hpk_tests") != 0) {
        
set_taskfloat(get_cvar_num("amx_hpk_delay")), "taskSetting"id)
    }
    else {        
        
set_taskfloat(get_cvar_num"amx_hpk_tests" )) , "checkPing" id __"b" )
    }
    
  }


public 
showWarn(id)
  
client_printid ,print_chat,"* Igroki s pingom bolwe %d budut udoleni s servera!"get_cvar_num"amx_hpk_ping" ) )

public 
taskSetting(id) {
    new 
name[32]
    
get_user_name(id,name,31)
    
set_taskfloat(get_cvar_num"amx_hpk_tests" )) , "checkPing" id ,__"b" )
}

kickPlayerid 

  new 
name[32],authid[32]
  
get_user_name(id,name,31)
  
get_user_authid(id,authid,31)
  
client_print(0,print_chat,"** %s bil udoljen s servera po pri4ine bolwogo pinga!",name)
  
server_cmd("kick #%d ^"Sorry but you have too high ping, try later...^"",get_user_userid(id))
  
log_amx("Highpingkick: ^"%s<%d><%s>^" kiknut za bolwoy ping! (sredniy Ping ^"%d^")"name,get_user_userid(id),authid,(g_Ping[id] / g_Samples[id]))
}

public 
checkPing(id


  if ( 
get_user_flags(id) & ADMIN_BAN ) return

  new 
p

  get_user_ping
id 

  
g_Pingid ] += p
  
++g_Samplesid ]

  if ( (
g_Samplesid ] > get_cvar_num"amx_hpk_tests" )) && (g_Ping[id] / g_Samples[id] > get_cvar_num"amx_hpk_ping" ))  )    
    
kickPlayer(id
}

  
public 
cmdHpk(id,level,cid){
  if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED
    
  
new ping[5]
  new 
check_arr[5]
  new 
tests_arr[5]
  new 
delay_arr[5]
  
read_argv(1,ping,4)
  
read_argv(2,check_arr,4)
  
read_argv(3,tests_arr,4)
  
read_argv(4,delay_arr,4)
  
  new 
check str_to_num(check_arr)
  new 
tests str_to_num(tests_arr)
  new 
delay str_to_num(delay_arr)
  
  
  if ( 
check check 5
  
if ( tests tests 3
  

  
if (read_argc() > 1){
    
set_cvar_string("amx_hpk_ping",ping)
  }
  if (
read_argc() > 2) {
    
set_cvar_num("amx_hpk_check",check)
  }
  if (
read_argc() > 3) {
    
set_cvar_num("amx_hpk_tests",tests)
  }
  if (
read_argc() > 4) {
      
set_cvar_num("amx_hpk_delay",delay)
 }

  
console_print(id,"Syntax: amx_hpk <ping to get kicked> <checks before kicks> <time between checks> <delay before first check in sec.>")
  
console_print(id,"Current High_Ping_Kicker Settings:")
  
console_print(id,"Maxping: %d  Time between checks: %d Checkcount: %d Delay: %d",get_cvar_num("amx_hpk_ping"),get_cvar_num("amx_hpk_check"),get_cvar_num("amx_hpk_tests"),get_cvar_num("amx_hpk_delay"))
  return 
PLUGIN_HANDLED    

__________________

anakin_cstrike is offline
 



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 17:05.


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