AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plug-in doesn't ban. (https://forums.alliedmods.net/showthread.php?t=63270)

sQn 11-16-2007 14:10

Plug-in doesn't ban.
 
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


kim_perm 11-17-2007 14:00

Re: Plug-in doesn't ban.
 
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)
?

sQn 11-17-2007 16:22

Re: Plug-in doesn't ban.
 
I must tested it and saying.

sQn 11-18-2007 12:30

Re: Plug-in doesn't ban.
 
doesn't work

Sn!ff3r 11-18-2007 18:01

Re: Plug-in doesn't ban.
 
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)

sQn 11-19-2007 09:52

Re: Plug-in doesn't ban.
 
Pisze tak :P :
amx_banip <name or #userid> <minutes> [reason]

vl@d 11-19-2007 10:18

Re: Plug-in doesn't ban.
 
or
PHP Code:

server_cmd("addip ^"%s^" ^"%s^";wait;writeip"g_minutesip



All times are GMT -4. The time now is 01:15.

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