И так, есть два плагина, которые не дают использовать рэтрай\рэконект команды.
Плюсы этих плагинов - это возможность вывести сообщение, при входе на сервер, (чет на подобии когда сервер забит и вам выдает окошко)
Как другие плагины этого рода, работают по принцыпу:
1. Зашел на сервер
2. Написал рэтрай
3. Пере зашел на сервер
4. Получил кик.
а плагины про которые я говорю работают так:
1. Зашел на сервер
2. Написал рэтрай
3. Получил окошко, мол нельзя делать рэтрай, зайдите через 30 сек.
так в чем проблема, а в том что ниже приведенный плагин работает 50 на 50 =) сам так и не понял от чего зависит работоспособность данного чуда, раз захожу со стима работает, 2й раз захожу не работает =) короче живет своей жизню.
плагин by Z@C
Код
#include <amxmodx>
#include <amxmisc>
#define MAX_PLAYERS 32
new pID[MAX_PLAYERS+1][22], ReconnectTime, Reason[255]
new Float:leave_time[MAX_PLAYERS]
new Float:bantime
new PlugTag[] = "[Akson45]"
new MinRecTimeMin[] = "^x03%s MinReconnect Time is %.1f min! Status: %s!"
new MinRecTimeSec[] = "^x03%s MinReconnect Time is %.0f sec! Status: %s!"
new Info[] = "You can't join after reconnect/retry command."
public plugin_init() {
register_plugin("No Reconnect","3.0","Z@C")
register_cvar("n_r_type","1",FCVAR_SERVER)
register_cvar("n_r_time","120")
register_cvar("n_r_bantime","5")
ReconnectTime = get_cvar_num("n_r_time")
bantime = float(get_cvar_num("n_r_bantime"))
}
public client_authorized(id) {
if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
return PLUGIN_HANDLED
} else {
new ip[21+1], uID[1]
for(new i = 1; i <= MAX_PLAYERS; i++) {
set_task(15.0,"rule",id)
get_user_ip(id,ip,21)
uID[0] = get_user_userid(id)
if (equal(ip, pID[i], 21)) {
if (get_cvar_num("n_r_type") == 2) {
reas()
server_cmd("kick #%d ^"%s^"", uID[0], Reason)
server_cmd("addip ^"%f^" ^"%s^"",bantime, ip)
server_cmd("writeip")
}
if (get_cvar_num("n_r_type") == 1) {
reas()
server_cmd("kick #%d ^"%s^"", uID[0], Reason)
}
msg(id)
}
return PLUGIN_HANDLED
}
if (get_cvar_num("n_r_type") == 0) {
set_task(10.0,"msg",id)
}
}
return PLUGIN_HANDLED
}
reas() {
new Float:gametime = get_gametime()
for (new i = 1; i < MAX_PLAYERS; i++) {
if (gametime >= leave_time[i] + ReconnectTime) {
leave_time[i] = gametime
}
new Float:rectime = leave_time[i] + ReconnectTime - gametime
if (get_cvar_num("n_r_type") == 2) {
format(Reason, 254, "%s You have been banned on %.2f min.", Info, bantime)
}
if (get_cvar_num("n_r_type") == 1) {
if (rectime >= 60) {
format(Reason, 254, "%s Connect after %0.1f min.", Info, rectime / 60.0)
} else {
format(Reason, 254, "%s Connect after %.0f sec.", Info, rectime)
}
}
}
}
public clean(i[]) {
pID[i[0]][0] = 0
}
public msg(id) {
new name[32]
get_user_name(id, name, 31)
set_hudmessage(255, 0, 255, 0.05, 0.70, 3, 5.0, 10.0, 0.5, 0.15, 1)
if (get_cvar_num("n_r_type") == 2) {
show_hudmessage(0,"Player %s try reconnect,but has been banned on %.2f min.",name,bantime)
}
if (get_cvar_num("n_r_type") == 1) {
show_hudmessage(0,"Player %s try reconnect,but has been kicked",name)
}
if (get_cvar_num("n_r_type") == 0){
show_hudmessage(0,"Player %s is reconnected",name)
}
}
public rule(id) {
new message[255], Status[5]
if (get_cvar_num("n_r_type") == 2) {
format(Status, 4, "BAN")
}
if (get_cvar_num("n_r_type") == 1) {
format(Status, 4, "KICK")
}
if (ReconnectTime >= 60) {
format(message, 254, MinRecTimeMin, PlugTag, ReconnectTime / 60.0, Status)
} else {
format(message, 254, MinRecTimeSec, PlugTag, ReconnectTime, Status)
}
client_print(id,print_chat,message)
}
public client_disconnect(id) {
if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
return PLUGIN_HANDLED
} else {
new ip[21+1], param[1]
new found = 0
get_user_ip(id, ip, 21)
for(new i = 1; i <= MAX_PLAYERS; i++) {
if (equal(ip, pID[i], 21)) {
found = 1
break
}
}
if (found == 0) {
for(new i = 1; i <= MAX_PLAYERS; i++) {
if(pID[i][0] == 0) {
//copy(pID[i], 21, ip)
get_user_ip(id, pID[i], 21)
param[0] = i
set_task(float(ReconnectTime), "clean", (id + MAX_PLAYERS), param, 1)
break
}
}
}
}
return PLUGIN_HANDLED
}
Этот плагин работает замечательно, нету претензий, но в нем не работает, вернее нету имунитета для админов. Максимум к чему я дошел, это сделал иммунитет по стим ИД, а хотелось бы по нику
Вот в принципе вся загвоздка

Так же знаю куча плагинов которые дают иммунитет по нику, но скрестить так и не получилось. Спасайте =)
плагин by JohnJ
Код
#include <amxmodx>
#include <cstrike>
#include <fun>
new PLUGIN[]="Anti reconnect"
new AUTHOR[]="JohnJ"
new VERSION[]="3.0"
new RTIME[]="amx_reconnect_time"
new RCAN[]="amx_reconnect_can"
new SCORESAVE[]="amx_reconnect_ss"
new RSTATIC[]="amx_reconnect_static"
new RSTIME[]="amx_reconnect_stime"
new t_disconnect[33] = {0, ...}
new t_scoresave[33] = {0, ...}
new ips[33][24]
new sfrags[33] = {0, ...}
new sdeaths[33] = {0, ...}
new useretry[33] = {0, ...}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar(RTIME, "7")
register_cvar(RCAN, "1")
register_cvar(SCORESAVE, "1")
register_cvar(RSTATIC, "1")
register_cvar(RSTIME, "7")
register_event("TeamInfo","outspec","a") // восстанавливает счёт игроку в соответствии с настройками как только тот зайдёт за команду
}
public client_connect(id)
{
new maxexit = get_cvar_num(RTIME)
new maxstata = get_cvar_num(RSTIME)
new canreconnect = get_cvar_num(RCAN)
new ssave = get_cvar_num(SCORESAVE)
new ip[24]
get_user_ip(id,ip,23,0)
if ((maxexit>0) && (canreconnect==0) && (equali(ip,ips[id])))
{
new Float:nexTime = get_gametime()
if (t_disconnect[id] > nexTime)
{
new stat = get_cvar_num(RSTATIC)
new timewait
if (stat==0)
{
t_disconnect[id] = floatround(nexTime) + maxexit
t_scoresave[id] = floatround(nexTime) + maxstata
timewait=maxexit
}
else
{
timewait=t_disconnect[id]-floatround(nexTime)
}
server_cmd("kick #%d ^"**** Anti Reconnect! **** }I{guTe %d ceKyHg^"", get_user_userid(id), timewait)
return PLUGIN_CONTINUE
}
}
if (ssave==1)
{
new Float:nexTime = get_gametime()
if (t_scoresave[id] <= nexTime)
{
sdeaths[id]=0
sfrags[id]=0
useretry[id]=0
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public outspec()
{
new id=read_data(1)
if ((useretry[id]==1) && (is_user_connected(id)))
{
cs_set_user_deaths(id,sdeaths[id])
set_user_frags(id,sfrags[id])
useretry[id]=0
sdeaths[id]=0
sfrags[id]=0
}
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
new maxexit = get_cvar_num(RTIME)
new maxstata = get_cvar_num(RSTIME)
new ssave = get_cvar_num(SCORESAVE)
new Float:theTime = get_gametime()
t_disconnect[id] = floatround(theTime) + maxexit
t_scoresave[id] = floatround(theTime) + maxstata
get_user_ip(id,ips[id],23,0)
if (ssave==1)
{
sdeaths[id] = get_user_deaths(id)
sfrags[id] = get_user_frags(id)
useretry[id]=1
}
return PLUGIN_CONTINUE
}
Помогите разобраться... плагин оч полезен, и мне кажется всем он больше понравится чем аналоги...
Отредактировал: Crazy*, - 6.1.2010, 14:02