Raised This Month: $ Target: $400
 0% 

Plug-in doesn't ban.


Post New Thread Reply   
 
Thread Tools Display Modes
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
kim_perm
Member
Join Date: Sep 2007
Location: Perm, Russia
Old 11-17-2007 , 14:00   Re: Plug-in doesn't ban.
Reply With Quote #2

Quote:
Code:
server_cmd("amx_banip %d %i;kick #%d Polaczyles sie wiecej niz %i razy [Hammmering]! Ban na %i minut.", g_ban_time, get_user_userid(id), get_user_userid(id), MAX_ATTEMPTS, g_ban_time);
Code:
server_cmd("amx_banip #%d %i ^"Polaczyles sie wiecej niz %i razy [Hammmering]! Ban na %i minut.^"", get_user_userid(id), g_ban_time, MAX_ATTEMPTS, g_ban_time)
?

Last edited by kim_perm; 11-17-2007 at 14:03.
kim_perm is offline
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-17-2007 , 16:22   Re: Plug-in doesn't ban.
Reply With Quote #3

I must tested it and saying.
__________________

80.52.244.150:27016
sQn is offline
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-18-2007 , 12:30   Re: Plug-in doesn't ban.
Reply With Quote #4

doesn't work
__________________

80.52.244.150:27016
sQn is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 11-18-2007 , 18:01   Re: Plug-in doesn't ban.
Reply With Quote #5

In polish: hmm pierw się podaje czas ;f zobacz
Code:
server_cmd("amx_banip %d #%i ^"Polaczyles sie wiecej niz %i razy [Hammmering]! Ban na %i minut.^"", g_ban_time, get_user_userid(id), MAX_ATTEMPTS, g_ban_time)

Last edited by Sn!ff3r; 11-18-2007 at 18:06.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-19-2007 , 09:52   Re: Plug-in doesn't ban.
Reply With Quote #6

Pisze tak :
amx_banip <name or #userid> <minutes> [reason]
__________________

80.52.244.150:27016
sQn is offline
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 11-19-2007 , 10:18   Re: Plug-in doesn't ban.
Reply With Quote #7

or
PHP Code:
server_cmd("addip ^"%s^" ^"%s^";wait;writeip"g_minutesip
__________________


I hate Spammers....
vl@d 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 01:15.


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