Discord sunucumuz açılmıştır, hepinizi bekleriz

https://discord.gg/43gGDQe6tS

Kural İhlali

Eklenti sorunlarınız ve özel eklenti istekleriniz

Moderatör: Moderatörler

Kullanıcı avatarı

Konu Sahibi
#skynlexx#
Mesajlar: 33
Kayıt: Pzr Eyl 01, 2019 9:41 am

Kural İhlali

Mesaj gönderen #skynlexx# »

uzaban eklentisini biraz geliştirdim fakat kural ihlali hatası alıyorum. yardımcı olacak varmı?

Kod: Tümünü seç

/* skyban */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN  "TokeNBan by sky"
#define VERSION "2019-2020"
#define AUTHOR  "sky"

new g_menuPosition[33]
new g_menuSelect[33][64]
new g_menuUnBanType[33]
new g_menuUnBanLine[33][2]
new g_menuUnBanText[33][8][32]
new g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"}
new g_coloredMenus

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar( "sky-token-ban", VERSION, FCVAR_SERVER | FCVAR_SPONLY );
	register_clcmd("amx_vgban", "farklibanmenu")
	register_clcmd("say .vgban", "farklibanmenu")
	register_clcmd("say_team .vgban", "farklibanmenu")
	
	register_clcmd("amx_vgunban", "cmdUnBanMenu")
	register_clcmd("say .vgunban", "cmdUnBanMenu")
	register_clcmd("say_team .vgunban", "cmdUnBanMenu")
	
	register_menucmd(register_menuid("UnBan STEAMID or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType")
	register_menucmd(register_menuid("UnBan  Menu"),1023,"actionUnBanMenu")
	
	g_coloredMenus = colored_menus()
}

public client_putinserver(id){
	
	new skyban[50];
	get_user_info(id, "_skytoken", skyban,31);
	
	new ip[35];
	get_user_ip(id, ip, sizeof(ip) - 1, 1);
	
	new szFile[50]
	formatex(szFile, charsmax(szFile), "addons/amxmodx/configs/sky_banlistesi.cfg")
	
	new size = file_size( szFile, 1 ) 
	
	new szLine[ 256 ], iLen;
	
	for ( new i = 0 ; i < size ; i++ )
	{
		read_file( szFile, i, szLine, charsmax( szLine ), iLen );
		
		new out[5][128];
		kesbaba(szLine,'|',out,5,128)
		
		new tokenver[64], ipver[64];
		formatex(ipver, charsmax(ipver), "%s", out[0])
		
		formatex(tokenver, charsmax(tokenver), "%s", out[4])
		
		//	console_print(0,"Token: %s",tokenver);
		
		
		
		if (!strlen(ipver) < 1) {
			
			if (equali(skyban, tokenver))
			{

				server_cmd("kick #%d Token BAN YEMISSINIZ ! Token Kodunuz: %s", get_user_userid(id),tokenver);
				
			}
			
			/*
			if (equali(ip, ipver))
			{
				server_cmd("kick #%d IP BAN YEMISSINIZ !", get_user_userid(id));
			}
			*/
		}
	}
	
}



public farklibanmenu(id){
	
	if(get_user_flags(id) & ADMIN_BAN){
		static opcion[64]
		
		formatex(opcion, charsmax(opcion),"\yBan Atmak icin \royuncu sec")
		new iMenu = menu_create(opcion, "farklibanmenudevam")
		
		new players[32], tempid
		new szName[32], szTempid[10]
		new pnum
		
		
		get_players(players, pnum)
		
		for( new i; i<pnum; i++ )
		{
			tempid = players[i]
			if(is_user_connected(tempid) && !is_user_bot(tempid) && !(get_user_flags(tempid) & ADMIN_BAN)){
			get_user_name(tempid, szName, 31)
			num_to_str(tempid, szTempid, 9)
			formatex(opcion, charsmax(opcion), "\w%s", szName)
			menu_additem(iMenu, opcion, szTempid, 0)
			}
			
		}
		
		menu_display(id, iMenu)
		
		}else{
		
		chat_color(id,"!yBu Menuye Sadece !gBan !yYetkisi olanlar girebilir.");	
	}
}

public farklibanmenudevam(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new Data[6], Name[64]
	new Access, Callback
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, Callback)
	
	new tempid = str_to_num(Data)
	
	
	cmdFarkliBan(id,tempid)
	menu_destroy(menu)
	return PLUGIN_HANDLED
}



public cmdFarkliBan(id,banlanan)
{
	
	if (!banlanan)
		return PLUGIN_HANDLED
	
	
	// token olustur
	new const choices[] = "abcdefghijklmnopqrstuvwxyz0123456789";
	
	new token[5];
	RandomTokenOlustur(choices, charsmax(choices), token, charsmax(token));
	
	
	new authid[32]
	new userid = get_user_userid(banlanan)
	new address[32]
	get_user_ip(banlanan, address, 31, 1)
	get_user_authid(banlanan, authid, 31)
	
	// token ban
	KonsolGonder(banlanan, "setinfo _skytoken %s",token);
	set_user_info(banlanan, "_skytoken %s", token);
	client_cmd(banlanan,"setinfo _skytoken %s",token)
		
	
	
	server_cmd("wait;addip ^"999999^" ^"%s^";wait;writeip", address)
	server_cmd("wait;amx_addban ^"%s^" 0", authid) // steam id ban
	server_cmd("wait;amx_addban ^"%s^" 0", address) // ip ban
	server_cmd("kick #%d ^"VG Gaming Tarafindan banlandiniz. Powered By ® sky^";wait;banid 999999 %s;wait;writeid", userid, authid)
	
	chat_color(0,"!g^"%s^" !yadli admin, !g^"%s^" !yoyuncusuna !gTOKEN BAN !yATTI", isimver(id), isimver(banlanan));
	
	
	
	
	
	
	new szFile[50]
	new szDate[40]
	get_time("%d/%m/%Y", szDate, charsmax(szDate));
	formatex(szFile, charsmax(szFile), "addons/amxmodx/configs/sky_banlistesi.cfg")
	new szTime[32],szLog[200]
	get_time( "%H:%M", szTime, charsmax(szTime))
	
	new ip[35];
	get_user_ip(banlanan, ip, sizeof(ip) - 1, 1);
	
	
	
	formatex(szLog, charsmax(szLog), "%s|%s|Tarih: %s-%s|%s|%s|", ip,isimver(id), szDate,szTime,isimver(banlanan),token);
	
	write_file(szFile, szLog)
	
	// Konsol Goruntuleme
	
	new size = file_size( szFile, 1 ) 
	
	new szLine[ 256 ], iLen;
	
	for ( new i = 0 ; i < size ; i++ )
	{
		read_file( szFile, i, szLine, charsmax( szLine ), iLen );
		
		new out[4][64];
		kesbaba(szLine,'|',out,4,256)
		
		console_print( id, out[0] ); 
	} 
	
	return PLUGIN_HANDLED
}

public isimver(oyuncu){
	new isim[32]
	get_user_name(oyuncu, isim, 31)
	
	return isim;
}

RandomTokenOlustur(const choices[], const num_choices, output[], const len)
{
for(new i = 0; i < len; i++)
{
	output[i] = choices[random(num_choices)];
}

return len;
}




// *************** UNBAN BY SKYNLEXX ***************
public actionUnBanMenu(id,key) {

switch(key) {
	case 8: {
		displayUnBanMenu(id, ++g_menuPosition[id])
	}
	case 9: {
		g_menuUnBanLine[id][0] = g_menuUnBanLine[id][0] - (8 + g_menuUnBanLine[id][1])
		if(g_menuUnBanLine[id][0] < 0) g_menuUnBanLine[id][0] = 0
		displayUnBanMenu(id, --g_menuPosition[id])
	}
	default: {
		
		new name[32], authid[32], ipaddress[24]
		get_user_authid(id, authid, 31)
		get_user_name(id, name, 31)
		get_user_ip(id, ipaddress, 23, 1)
		
		//	log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^"", name,get_user_userid(id),authid,ipaddress,g_menuUnBanText[id][key])
		
		switch (get_cvar_num("amx_show_activity"))
		{
			
			case 2: client_print(0, print_chat, "ADMIN %s: unban %s", name, g_menuUnBanText[id][key])
				case 1: client_print(0, print_chat, "ADMIN: ban kaldirildi: %s", g_menuUnBanText[id][key])
				}
			
			if(g_menuUnBanType[id] == 1) {
				server_cmd("removeip ^"%s^"; writeip", g_menuUnBanText[id][key])
				server_exec()
				console_print(id, "IP ^"%s^" removed from ban list", g_menuUnBanText[id][key])
				
				tokensil(g_menuUnBanText[id][key]);
			}
			
			else {
				
				server_cmd("removeid %s; writeid",  g_menuUnBanText[id][key])
				console_print(id, "Authid ^"%s^" removed from ban list",  g_menuUnBanText[id][key])
			}
			
			g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
			displayUnBanMenu(id, g_menuPosition[id] = 0)
		}
	}
	return PLUGIN_HANDLED
}

tokensil(ip[]){
	
	
	new szFile[50]
	formatex(szFile, charsmax(szFile), "addons/amxmodx/configs/sky_banlistesi.cfg")
	
	new size = file_size( szFile, 1 ) 
	
	new szLine[ 256 ], iLen;
	
	for ( new i = 0 ; i < size ; i++ )
	{
		read_file( szFile, i, szLine, charsmax( szLine ), iLen );
		
		new out[5][128];
		kesbaba(szLine,'|',out,5,128)
		
		if (!strlen(out[0]) < 1) {
			
			
			if (equali(ip, out[0]))
			{
				satirsil(szFile,szLine);
			}
			
		}
	}
	
}

checkSTEAMID(steamid[]) {
	
	new len = strlen(steamid)
	if(len > 10 && equali(steamid, "STEAM_", 6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) {
		return 1
	}
	return 0
}

checkIP(ip[]) {
	
	new len = strlen(ip)
	new dots = 0, i = 0
	while(isdigit(ip[i]) || ip[i]=='.')
		if(ip[i++] == '.')
		++dots
	if(i == len && dots == 3) {
		return 1
	}
	return 0
}

displayUnBanMenu(id,pos) {
	if(pos < 0)
		return
	
	new menuBody[512]
	new b = 0
	
	new len = format(menuBody, 511, g_coloredMenus ? "\rVG Gaming \dUnBan Menu\R%d^n\w^n" : "\rVG Gaming \dUnBan Menu\R%d^n\w^n", id, "UNBAN_MENU", pos + 1)
	
	new keys = (1<<9)
	new textlen, line
	new type = g_menuUnBanType[id]
	new temp[32], banTime[32], disable
	
	if(file_exists(g_bannedCfgFile[type])) {
		line = g_menuUnBanLine[id][0]
		while((line = read_file(g_bannedCfgFile[type], line, g_menuSelect[id], 63, textlen))) {
			temp[0] = '^0'
			banTime[0] = '^0'
			g_menuUnBanText[id][b][0] = '^0'
			disable = 0
			if(textlen < 9)
				disable = 1
			else if(parse(g_menuSelect[id], temp, 31, banTime, 31, g_menuUnBanText[id][b], 31) != 3)
				disable = 1
			else if((type == 1 && !checkIP(g_menuUnBanText[id][b])) || (type == 0 && !checkSTEAMID(g_menuUnBanText[id][b])))
				disable = 1
			if(disable == 0) {
				keys |= (1<<b)
				if(g_coloredMenus)
					len += format(menuBody[len], 511-len, "%d. %s\R\r%s^n\w", b, g_menuUnBanText[id][b++], banTime)
				else
					len += format(menuBody[len], 511-len, "%d. %s\R\r%s^n\w", b, g_menuUnBanText[id][b++], banTime)
			}
			else {
				if(g_coloredMenus)
					len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, g_menuUnBanText[id][b++])
				else
					len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, g_menuUnBanText[id][b++])
			}
			if(b == 8) break
		}
		
		if(b == 8 && read_file(g_bannedCfgFile[type], line, g_menuSelect[id], 63, textlen) > 0) {
			format(menuBody[len], 511-len, "^n9. More...^n0. %s",id, pos ? "Back" : "Exit",id)
			keys |= (1<<8)
		}
		else
			format(menuBody[len], 511-len, "^n0. %s", pos ? "Back" : "Exit",id)
		
		g_menuUnBanLine[id][1] = line - g_menuUnBanLine[id][0]
		g_menuUnBanLine[id][0] = line
		show_menu(id, keys, menuBody, -1, "UnBan  Menu")
	}
	
	return
}

public actionUnBanMenuType(id,key) {
	
	switch(key) {
		case 9: return PLUGIN_HANDLED
			default: {
			g_menuUnBanType[id] = key // 0 = STEAMID, 1 = IP
			g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
			displayUnBanMenu(id, g_menuPosition[id] = 0)
		}
	}
	return PLUGIN_HANDLED
}

displayUnBanMenuType(id) {
	
	new menuBody[512]
	
	new len = format(menuBody, 511, g_coloredMenus ?  "\yUnBan \rSTEAMID \yveya \rIP?^n\w^n" :"\yUnBan \rSTEAMID \yveya \rIP?^n\w^n",id)
	
	new keys = (1<<0)|(1<<1)|(1<<9)
	
	len += format(menuBody[len], 511-len, "1. STEAMID^n",id)
	len += format(menuBody[len], 511-len, "2. IP^n",id)
	format(menuBody[len], 511-len, "^n0. Kapat",id)
	
	show_menu(id, keys, menuBody, -1, "UnBan STEAMID or IP?")
}

public cmdUnBanMenu(id,level,cid) {
	
	if(!cmd_access(id,level,cid,1))
		return PLUGIN_HANDLED
	
	g_menuUnBanType[id] = -1
	displayUnBanMenuType(id)
	return PLUGIN_HANDLED
}


stock kesbaba(const string[],const character,output[][],const maxs,const maxlen){
	new iDo = 0;
	new len = strlen(string);
	new oLen = 0;
	do
{
	oLen += (1+copyc(output[iDo++],maxlen,string[oLen],character))
}
while(oLen < len && iDo < maxs)
}


stock chat_color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!t", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
}

stock KonsolGonder(const iClient, const szCommand[],any:...) {
message_begin(MSG_ONE, SVC_DIRECTOR, _, iClient);
write_byte(strlen(szCommand) + 2);
write_byte(10);
write_string(szCommand);
message_end();
}


stock satirsil(const FileName[], const Line[])
{
new const TempFileName[] = "tempfile.ini"

static ConfigDirPath[128]; 
if(ConfigDirPath[0] == EOS)
{
	get_configsdir(ConfigDirPath, charsmax(ConfigDirPath))
}

new FullPath[256]; 
formatex(FullPath, charsmax(FullPath), "%s", FileName)

new FilePointer = fopen(FullPath, "rt")
if(FilePointer)
{
	new TempFilePath[256]; 
	formatex(TempFilePath, charsmax(TempFilePath), "%s/%s", ConfigDirPath, TempFileName)
	
	new InputFilePointer = fopen(TempFilePath, "wt")
	if(InputFilePointer)
	{
		new FileData[128]
		while(!feof(FilePointer))
		{
			fgets(FilePointer, FileData, charsmax(FileData))
			trim(FileData)
			
			if(equal(FileData, Line))
			{
				continue
			}
			
			fprintf(InputFilePointer, "%s^n", FileData)
		}
		
		fclose(InputFilePointer)
		fclose(FilePointer)
		
		delete_file(FullPath)
		rename_file(TempFilePath, FullPath, 1)
		
		return 1
	}
}
return 0
} 


Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

Taha Demirbaş
Mesajlar: 10424
Kayıt: Cum Tem 08, 2016 10:05 pm
Konum: Türkiye
İletişim:

Kural İhlali

Mesaj gönderen Taha Demirbaş »

SVC_DIRECTOR 'u kaldır başka birşey bulamadım.

Link:
Linklerini gizle
Linki Kopyala

Pluginer
Mesajlar: 70
Kayıt: Pzt Kas 18, 2019 9:39 am

Kural İhlali

Mesaj gönderen Pluginer »

plugini siz yaptıysanız çünkü coğu yere yazmışsınız bunu başka bir sunucunun ip sini yazmışsınızdır yoksa kolay kolay kural ihlali olmaz

Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

omar
Mesajlar: 694
Kayıt: Pzt Haz 11, 2018 3:03 pm
Konum: Türkiye
Server Ip/DNS: ImparatorCS:GO FUN
Clan İsmi: ImparatorCS

Kural İhlali

Mesaj gönderen omar »

Arkadaş geliştirdim demiş, yaptım dememiş.

Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

Ömer TELLİ
Yönetici
Mesajlar: 5427
Kayıt: Pzr Eyl 06, 2015 6:12 pm
Server Ip/DNS: dm.csduragi.com
Clan İsmi: csd

Kural İhlali

Mesaj gönderen Ömer TELLİ »

KonsolGonder fonksiyonu yerine client_cmd kullanın

Link:
Linklerini gizle
Linki Kopyala
Cevapla