Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Modyfikacja

Niewielka przeróbka / Menu unbanów

Modyfikacja

  • Zamknięty Temat jest zamknięty
6 odpowiedzi w tym temacie

#1 Pro Noob

    Zaawansowany

  • Użytkownik

Reputacja: 6
Nowy

  • Postów:148
  • Lokalizacja:Katowice
Offline

Napisano 18.04.2009 17:35

Siema,
Przerobi mi ktoś ten plugin tak żeby mogli z niego korzystać tylko admini z flagą "t"??

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>



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("UnBanmenu", "1", "AMX Team")
	
	register_clcmd("amx_unbanmenu","cmdUnBanMenu", ADMIN_BAN, "- displays unban menu")
	
	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 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: unban %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])
		}
		
		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
}

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 ? "yUnBan MenuR%d^nw^n" : "UnBan Menu %d^n^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<<<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />
				if(g_coloredMenus)
				len += format(menuBody[len], 511-len, "%d. %sRr%s^nw", b, g_menuUnBanText[id][b++], banTime)
				else
				len += format(menuBody[len], 511-len, "%d. %s   ( %s )^n", b, g_menuUnBanText[id][b++], banTime)
			}
			else {
				if(g_coloredMenus)
					len += format(menuBody[len], 511-len, "d%d. %s^nw", b, g_menuUnBanText[id][b++])
				else
					len += format(menuBody[len], 511-len, "#. %s^n", 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 STEAMID or IP?^nw^n" :"UnBan STEAMID or IP?^n^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. Exit",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
}

Dla pomocnych daje "Pomógł" :)
  • +
  • -
  • 0

#2 naven

    Hero

  • Power User

Reputacja: 204
Profesjonalista

  • Postów:1 088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 18.04.2009 17:53

/* Plugin generated by AMXX-Studio */



#include <amxmodx>

#include <amxmisc>







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("UnBanmenu", "1", "AMX Team")

   

    register_clcmd("amx_unbanmenu","cmdUnBanMenu", ADMIN_LEVEL_H, "- displays unban menu")

   

    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 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: unban %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])

        }

       

        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

}



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 ? "yUnBan MenuR%d^nw^n" : "UnBan Menu %d^n^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<<<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />

                if(g_coloredMenus)

                len += format(menuBody[len], 511-len, "%d. %sRr%s^nw", b, g_menuUnBanText[id][b++], banTime)

                else

                len += format(menuBody[len], 511-len, "%d. %s   ( %s )^n", b, g_menuUnBanText[id][b++], banTime)

            }

            else {

                if(g_coloredMenus)

                    len += format(menuBody[len], 511-len, "d%d. %s^nw", b, g_menuUnBanText[id][b++])

                else

                    len += format(menuBody[len], 511-len, "#. %s^n", 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 STEAMID or IP?^nw^n" :"UnBan STEAMID or IP?^n^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. Exit",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

}

  • +
  • -
  • 0

#3 Pro Noob

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:148
  • Lokalizacja:Katowice
Offline

Napisano 20.04.2009 16:10

Nie działa ;/
Mam kolesia co ma tylko flage "t" i nie może używać tego menu, a pozostali admini bez tej flagi moga
  • +
  • -
  • 0

#4 naven

    Hero

  • Power User

Reputacja: 204
Profesjonalista

  • Postów:1 088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 20.04.2009 16:29

Pokaż cmdaccess.ini
  • +
  • -
  • 0

#5 Pro Noob

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:148
  • Lokalizacja:Katowice
Offline

Napisano 20.04.2009 16:31

; This file will store the commands used by plugins, and their access level

; To change the access of a command, edit the flags beside it and then

;   change the server's map.

;

; Example: If I wanted to change the amx_slap access to require

;          RCON access (flag "l") I would change this:

;          "amx_slap"  "e" ; admincmd.amxx

;          To this:

;          "amx_slap"  "l" ; admincmd.amxx

;

; To disable a specific command from being used with the command manager

;   and to only use the plugin-specified access set the flag to "!"

;

; NOTE: The plugin name at the end is just for reference to what plugin

;       uses what commands.  It is ignored.



"amx_statscfgmenu" 	"h" ; statscfg.amxx

"amx_statscfg" 	"h" ; statscfg.amxx

"amx_reloadadmins" 	"h" ; admin.amxx

"amx_addadmin" 	"l" ; admin.amxx

"amx_kick" 	"c" ; admincmd.amxx

"amx_ban" 	"d" ; admincmd.amxx

"amx_banip" 	"d" ; admincmd.amxx

"amx_addban" 	"d" ; admincmd.amxx

"amx_unban" 	"t" ; admincmd.amxx

"amx_slay" 	"e" ; admincmd.amxx

"amx_slap" 	"e" ; admincmd.amxx

"amx_leave" 	"c" ; admincmd.amxx

"amx_pause" 	"g" ; admincmd.amxx

"amx_who" 	"y" ; admincmd.amxx

"amx_cvar" 	"g" ; admincmd.amxx

"amx_plugins" 	"y" ; admincmd.amxx

"amx_modules" 	"y" ; admincmd.amxx

"amx_map" 	"f" ; admincmd.amxx

"amx_cfg" 	"h" ; admincmd.amxx

"amx_nick" 	"e" ; admincmd.amxx

"amx_rcon" 	"l" ; admincmd.amxx

"amx_help" 	"" ; adminhelp.amxx

"amx_setlang" 	"h" ; multilingual.amxx

"amx_langmenu" 	"" ; multilingual.amxx

"amxmodmenu" 	"u" ; menufront.amxx

"amx_menu" 	"" ; menufront.amxx

"amx_cmdmenu" 	"u" ; cmdmenu.amxx

"amx_cfgmenu" 	"u" ; cmdmenu.amxx

"amx_speechmenu" 	"u" ; cmdmenu.amxx

"amx_cvarmenu" 	"g" ; cmdmenu.amxx

"amx_kickmenu" 	"c" ; plmenu.amxx

"amx_banmenu" 	"d" ; plmenu.amxx

"amx_slapmenu" 	"e" ; plmenu.amxx

"amx_teammenu" 	"m" ; plmenu.amxx

"amx_clcmdmenu" 	"m" ; plmenu.amxx

"amx_mapmenu" 	"f" ; mapsmenu.amxx

"amx_votemapmenu" 	"f" ; mapsmenu.amxx

"amx_say" 	"i" ; adminchat.amxx

"amx_chat" 	"i" ; adminchat.amxx

"amx_psay" 	"i" ; adminchat.amxx

"amx_tsay" 	"i" ; adminchat.amxx

"amx_csay" 	"i" ; adminchat.amxx

"amx_votemap" 	"j" ; adminvote.amxx

"amx_votekick" 	"j" ; adminvote.amxx

"amx_voteban" 	"j" ; adminvote.amxx

"amx_vote" 	"j" ; adminvote.amxx

"amx_cancelvote" 	"j" ; adminvote.amxx

"amx_pausecfg" 	"h" ; pausecfg.amxx

"amx_pausecfgmenu" 	"h" ; pausecfg.amxx

"amx_off" 	"h" ; pausecfg.amxx

"amx_on" 	"h" ; pausecfg.amxx

"amx_restmenu" 	"h" ; restmenu.amxx

"amx_restrict" 	"h" ; restmenu.amxx

"amx_unbanmenu" 	"d" ; unbanmenu.amxx

"amx_gag" 	"c" ; admin_gag.amxx

"amx_ungag" 	"c" ; admin_gag.amxx

"amx_spawn_editor" 	"l" ; Map_Spawns_Editor.amxx

"amx_editor_menu" 	"l" ; Map_Spawns_Editor.amxx

"amx_parachute" 	"m" ; amx_parachute.amxx

"Wpisz_powod_bana" 	"d" ; mini_bans.amxx

"amx_customkickreason" 	"c" ; kick_reason.amxx

"amx_idiot" 	"c" ; amx_idiot.amxx

"amx_unidiot" 	"c" ; amx_idiot.amxx

"amx_last" 	"d" ; admincmd.amxx

"amx_showrcon" 	"l" ; admincmd.amxx

"amx_rockthevote" 	"m" ; deagsmapmanager.amxx

"amx_rtv" 	"m" ; deagsmapmanager.amxx

"dmap_cancelvote" 	"m" ; deagsmapmanager.amxx

"dmap_help" 	"" ; deagsmapmanager.amxx

"dmap_status" 	"m" ; deagsmapmanager.amxx

"dmap_votemode" 	"r" ; deagsmapmanager.amxx

"dmap_cyclemode" 	"r" ; deagsmapmanager.amxx

"dmap_banlastmaps" 	"r" ; deagsmapmanager.amxx

"dmap_quietmode" 	"r" ; deagsmapmanager.amxx

"dmap_freeze" 	"r" ; deagsmapmanager.amxx

"dmap_messages" 	"r" ; deagsmapmanager.amxx

"dmap_rtvtoggle" 	"r" ; deagsmapmanager.amxx

"dmap_rockthevote" 	"m" ; deagsmapmanager.amxx

"dmap_rtvpercent" 	"r" ; deagsmapmanager.amxx

"dmap_rtvplayers" 	"r" ; deagsmapmanager.amxx

"dmap_rtvwait" 	"r" ; deagsmapmanager.amxx

"dmap_default" 	"r" ; deagsmapmanager.amxx

"dmap_mapsurl" 	"r" ; deagsmapmanager.amxx

"dmap_mapsnum" 	"r" ; deagsmapmanager.amxx

"dmap_nominations" 	"r" ; deagsmapmanager.amxx

"dmap_maxcustom" 	"r" ; deagsmapmanager.amxx

"amx_fakeping" 	"c" ; pingfaker.amxx

"amx_trail" 	"m" ; plugin_trail.amxx

"amx_trail_user" 	"m" ; plugin_trail.amxx

"amx_trail_type" 	"m" ; plugin_trail.amxx

"amx_trail_life" 	"m" ; plugin_trail.amxx

"amx_trail_size" 	"m" ; plugin_trail.amxx

"amx_trail_brightness" 	"m" ; plugin_trail.amxx

"amx_trail_reload" 	"m" ; plugin_trail.amxx

"amx_givehat" 	"l" ; Hats02.amxx

"amx_removehats" 	"l" ; Hats02.amxx

"amx_addtempadmin" 	"" ; temp_admin.amxx

  • +
  • -
  • 0

#6 naven

    Hero

  • Power User

Reputacja: 204
Profesjonalista

  • Postów:1 088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 20.04.2009 16:33

"amx_unbanmenu"     "d" ; unbanmenu.amxx
Zamiast d daj t
  • +
  • -
  • 0

#7 Pro Noob

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:148
  • Lokalizacja:Katowice
Offline

Napisano 20.04.2009 17:51

Rzeczywiście... ślepy jestem czy coś że pominąłem tą linijke...
Ale dzięki za pomoc, leci "Pomógł"
  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: Modyfikacja

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych