Raised This Month: $ Target: $400
 0% 

Plug-in doesn't ban.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-16-2007 , 14:10   Plug-in doesn't ban.
Reply With Quote #1

Why that plug-in doesn't ban on ip ?

PHP Code:
#include <amxmodx>
#define PLUGIN "Punish Hammmering"
#define VERSION "1.0"
#define AUTHOR "Alka"
#define MAX_ATTEMPTS 4 //ile razy mozna polaczyc sie w ciagu 1 rundy z serverem
#define MAX_IPS 100
new g_ips[MAX_IPS][32];
new 
g_attempts[33];
new 
g_last_ip;
new 
g_ban_time 5//na ile ban za prube nadmiernych polaczen [minuty]
public plugin_init() {
 
 
register_plugin(PLUGINVERSIONAUTHOR);
 
register_logevent("round_start"2"1=Round_Start");
}
public 
client_connect(id)
{
 new 
PlayersLimit get_maxplayers();
 new 
PlayersNum get_playersnum(1);
 
 if(
PlayersNum >= PlayersLimit)
 {
  new 
UserIp[32];
  
get_user_ip(idUserIp311);
  
  for(new 
<= g_last_ip i++)
  {
   if(
equali(g_ips[i], UserIp))
   {
    
g_attempts[i] += 1;
    
    if(
g_attempts[i] >= MAX_ATTEMPTS)
    {
     
server_cmd("amx_banip %d %i;kick #%d Polaczyles sie wiecej niz %i razy [Hammmering]! Ban na %i minut."g_ban_timeget_user_userid(id), get_user_userid(id), MAX_ATTEMPTSg_ban_time);
     
     
g_attempts[i] = 0;
    }
   }
  }
  if(
g_last_ip >= MAX_IPS)
   return 
0;
  
  
g_last_ip += 1;
  
copy(g_ips[g_last_ip], 31UserIp);
  
g_attempts[g_last_ip] = 1;
 }
 return 
0;
}
public 
round_start()
 
g_last_ip 0
__________________

80.52.244.150:27016
sQn is offline
 


Thread Tools
Display Modes

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 01:15.


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