Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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

PTB przerobienie

Modyfikacja

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

#1 mitol007

    Pomocny

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:64
Offline

Napisano 24.10.2009 22:10

Witam, mam prośbę. Czy mógłby mi ktoś przerobić ten plugin i zmienić flagę z immunitetem na "C" ?
Tylko zmienić, skompiluje se juz sam
Z góry wielkie dzięki

/*
							 _____  _____  __   _    _                       _          
							|_   _||_   _|[  | / |_ (_)                     / |_        
							  | |    | |   | |`| |-'__   _ .--..--.   ,--. `| |-'.---.  
							  | '    ' |   | | | | [  | [ `.-. .-. | `'_ : | | / /__ 
							    __/ /    | | | |, | |  | | | | | | // | |,| |,| __., 
							    `.__.'    [___]__/[___][___||__||__]'-;__/__/ '.__.' 

				 ____  ____   _         __          _______   _                        ______                                __  
				|_   ||   _| (_)       [  |        |_   __  (_)                     .' ___  |                              |  ] 
				  | |__| |   __   .--./)| |--.       | |__) |__   _ .--.   .--./)   / .'   _| __   _   ,--.   _ .--.   .--.| |  
				  |  __  |  [  | / /'`;| .-. |      |  ___/[  | [ `.-. | / /'`;   | |   ____[  | | | `'_ : [ `/'`]/ /'`' |  
				 _| |  | |_  | |  ._//| | | |     _| |_    | |  | | | |  ._//    `.___]  || _/ |,// | |, | |    | __/  |  
				|____||____|[___].',__`[___]|__]   |_____|  [___][___||__].',__`     `._____.' '.__.'_/'-;__/[___]    '.__.;__] 
	                			( ( __))                                 ( ( __))                                                



									        __        _____   
									       /  |      / ___ `. 
									 _   __`| |     |_/___) | 
									[  [  ]| |      .'____.' 
									  / /_| |_  _ / /_____  
									  __/|_____|(_)|_______| 

							 ______               ___  ____    _                 _   
							|_   _              |_  ||_  _|  (_)               (_)  
							  | |_) |  _   __      | |_/ /    __   _ .--..--.   __   
							  |  __'. [  [  ]     |  __'.   [  | [ `.-. .-. | [  |  
							 _| |__) |  '/ /     _| |   _  | |  | | | | | |  | |  
							|_______/[_:  /     |____||____|[___][___||__||__][___] 
					        		  __.'                                          


				Author: Kimi
		Version: 1.2




====  #	*Cvars* #  ======================================================================================================================================

- amx_hpk_sound 1/0 - Sound when a player is kicked/banned (1 - default)
- amx_hpk_ban 0/1/2 - If it's 0 it will only kick the player, if it's will banIP (default) and if it's 2 will ban the SteamID.
- amx_hpk_bantime <minutes> - Ban duration.

- amx_max_ping 100 - Max ping.
- amx_time_ping 15 - Frequency in seconds of ping checking.
- amx_check_ping 5 - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #	*Commands* #  ===================================================================================================================================

- amx_hpk_sound 1/0 - Activated or Not.
- amx_hpk_ban 0/1/2 - Kick method.
- amx_hpk_bantime <minutes> - Ban duration.
- amx_max_ping <ping> - Max ping.
- amx_time_ping <seconds> - Frequency in seconds of ping checking.
- amx_check_ping <checks> - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #	*Credits* #  ====================================================================================================================================

- hack and more
- SAMURAI
- alliedmodders' users for critics

=========================================================================================================================================================															   			/|
																			 |
																			/|
.																  		       //|
.																 		      ///|
.																		     ////|
..........................................................................................................................................................
*/

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_RCON

stock const PLUGIN_NAME[] = "Ultimate High Ping Guard";
stock const PLUGIN_VERSION[] = "1.1";
stock const PLUGIN_AUTHOR[] = "Kimi";

new MAX_HIGHPING;
new TIME_HIGHPING;
new CHECK_HIGHPING;

new hpksound, hpkban, btime;
new iNumTests[33]
new gsound[] = {^"vox/buzwarn^"};


public plugin_init() 
{
	register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);

	// Cvars:
	register_cvar("amx_show_activity","2")
	hpksound = register_cvar("amx_hpk_sound","1");
	hpkban = register_cvar("amx_hpk_ban","1");
	btime = register_cvar("amx_hpk_bantime","10");
	MAX_HIGHPING = register_cvar("amx_max_ping","100");
	TIME_HIGHPING = register_cvar("amx_time_ping","15");
	CHECK_HIGHPING = register_cvar("amx_check_ping","5");

	// Multi-langual dictionary:
	register_dictionary("Ultimate_High_Ping_Guard.txt");

	// Commands:
	register_concmd("amx_hpk_sound","sound_command",ACCESS);
	register_concmd("amx_hpk_ban","ban_command",ACCESS);
	register_concmd("amx_hpk_bantime","bantime_command",ACCESS);
	register_concmd("amx_max_ping","max_ping",ACCESS);
	register_concmd("amx_time_ping","time_ping",ACCESS);
	register_concmd("amx_check_ping","check_ping",ACCESS);

	// Others:
	if (TIME_HIGHPING < 15) TIME_HIGHPING = 15
	if (CHECK_HIGHPING < 5) CHECK_HIGHPING = 5
	return PLUGIN_CONTINUE
}
	

public client_putinserver(id) 
{
	iNumTests[id] = 0
	if (!is_user_bot(id)) {
		new param[1]
		param[0] = id
		set_task(25.0, "Warning", id, param, 1)
	}
	return PLUGIN_CONTINUE
}


public Warning(param[]) 
{
	if(get_pcvar_num(hpkban) == 1.2)
	{
		client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_ban", MAX_HIGHPING);
		set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
	}
	else
	{
		client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_kick", MAX_HIGHPING);
		set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
	}
}


public client_disconnect(id) 
{
	remove_task(id)
	return PLUGIN_CONTINUE
}


public checkPing(param[]) 
{
	new id = param[0]
	if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
		remove_task(id)
		client_print(id, print_chat, "%L",LANG_PLAYER,"imun_msg")
		return PLUGIN_CONTINUE
	}
	new ping, loss
	get_user_ping(id, ping, loss)
	if (ping > MAX_HIGHPING)
		++iNumTests[id]
	else
		if (iNumTests[id] > 0) --iNumTests[id]
	if (iNumTests[id] > CHECK_HIGHPING)
		BanLag(id)
	return PLUGIN_CONTINUE
}


BanLag(id) 
{
	new ping, loss
	get_user_ping(id, ping, loss)

	switch(hpksound)
	{
		case 0:
		{
			switch(hpkban)
			{
				case 0:
				{
					new name[32]
					get_user_name(id, name, 31);
					new uID = get_user_userid(id);
					server_cmd("kick #%d ^"High Ping Detected !^"", uID);
					client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
				}

				case 1:
				{
					new name[32]
					get_user_name(id, name, 31);
					//new uID = get_user_userid(id);
					//new ip = get_user_ip(id, ip,31);
					server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
					client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);


				}

				case 2:
				{
					new name[32]
					get_user_name(id, name, 31);
					new uID = get_user_userid(id);
					server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
					client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
				}
			}
		}

		case 1:
		{
			switch(hpkban)
			{
				case 0:
				{
					new name[32]
					get_user_name(id, name, 31);
					new uID = get_user_userid(id);
					server_cmd("kick #%d ^"High Ping Detected !^"", uID);
					client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
					client_cmd(0, "spk %d", gsound);
				}

				case 1:
				{
					new name[32]
					get_user_name(id, name, 31);
					//new uID = get_user_userid(id);
					//new ip = get_user_ip(name,ip,31);
					server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
					client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
					client_cmd(0, "spk %d", gsound)
				}

				case 2:
				{
					new name[32]
					get_user_name(id, name, 31);
					new uID = get_user_userid(id);
					server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
					client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
					client_cmd(0, "spk %d", gsound);
				}
	
			}
		}
	}

	return PLUGIN_CONTINUE
} 


public sound_command(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_hpk_ban")
	return PLUGIN_CONTINUE
}

public ban_command(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_hpk_ban")
	return PLUGIN_CONTINUE
}

public bantime_command(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_hpk_ban")
	return PLUGIN_CONTINUE
}

public max_ping(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_max_ping")
	return PLUGIN_CONTINUE
}

public time_ping(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_time_ping")
	return PLUGIN_CONTINUE
}

public check_ping(id) 
{
	if(!(get_user_flags(id) & ACCESS))
		return PLUGIN_HANDLED

	client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
	server_cmd("amx_cvar amx_check_ping")
	return PLUGIN_CONTINUE
}


/* Visit www.cs-utilz.net for other AMXX Plugins ! */

  • +
  • -
  • 0

#2 c1rca

    Wszechwidzący

  • Użytkownik

Reputacja: 13
Początkujący

  • Postów:227
  • GG:
  • Steam:steam
  • Lokalizacja:Częstochowa
Offline

Napisano 24.10.2009 22:24

/*
                            _____  _____  __   _    _                       _         
                            |_   _||_   _|[  | / |_ (_)                     / |_       
                              | |    | |   | |`| |-'__   _ .--..--.   ,--. `| |-'.---. 
                              | '    ' |   | | | | [  | [ `.-. .-. | `'_ : | | / /__
                                __/ /    | | | |, | |  | | | | | | // | |,| |,| __.,
                                `.__.'    [___]__/[___][___||__||__]'-;__/__/ '.__.'

                ____  ____   _         __          _______   _                        ______                                __ 
                |_   ||   _| (_)       [  |        |_   __  (_)                     .' ___  |                              |  ]
                  | |__| |   __   .--./)| |--.       | |__) |__   _ .--.   .--./)   / .'   _| __   _   ,--.   _ .--.   .--.| | 
                  |  __  |  [  | / /'`;| .-. |      |  ___/[  | [ `.-. | / /'`;   | |   ____[  | | | `'_ : [ `/'`]/ /'`' | 
                _| |  | |_  | |  ._//| | | |     _| |_    | |  | | | |  ._//    `.___]  || _/ |,// | |, | |    | __/  | 
                |____||____|[___].',__`[___]|__]   |_____|  [___][___||__].',__`     `._____.' '.__.'_/'-;__/[___]    '.__.;__]
                                ( ( __))                                 ( ( __))                                               



                                            __        _____   
                                           /  |      / ___ `.
                                    _   __`| |     |_/___) |
                                    [  [  ]| |      .'____.'
                                     / /_| |_  _ / /_____ 
                                      __/|_____|(_)|_______|

                            ______               ___  ____    _                 _   
                            |_   _              |_  ||_  _|  (_)               (_) 
                              | |_) |  _   __      | |_/ /    __   _ .--..--.   __   
                              |  __'. [  [  ]     |  __'.   [  | [ `.-. .-. | [  | 
                            _| |__) |  '/ /     _| |   _  | |  | | | | | |  | | 
                            |_______/[_:  /     |____||____|[___][___||__||__][___]
                                      __.'                                         


                Author: Kimi
        Version: 1.2




====  #    *Cvars* #  ======================================================================================================================================

- amx_hpk_sound 1/0 - Sound when a player is kicked/banned (1 - default)
- amx_hpk_ban 0/1/2 - If it's 0 it will only kick the player, if it's will banIP (default) and if it's 2 will ban the SteamID.
- amx_hpk_bantime <minutes> - Ban duration.

- amx_max_ping 100 - Max ping.
- amx_time_ping 15 - Frequency in seconds of ping checking.
- amx_check_ping 5 - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #    *Commands* #  ===================================================================================================================================

- amx_hpk_sound 1/0 - Activated or Not.
- amx_hpk_ban 0/1/2 - Kick method.
- amx_hpk_bantime <minutes> - Ban duration.
- amx_max_ping <ping> - Max ping.
- amx_time_ping <seconds> - Frequency in seconds of ping checking.
- amx_check_ping <checks> - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #    *Credits* #  ====================================================================================================================================

- hack and more
- SAMURAI
- alliedmodders' users for critics

=========================================================================================================================================================                                                                           /|
                                                                            |
                                                                            /|
.                                                                                 //|
.                                                                              ///|
.                                                                             ////|
..........................................................................................................................................................
*/

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_RCON

stock const PLUGIN_NAME[] = "Ultimate High Ping Guard";
stock const PLUGIN_VERSION[] = "1.1";
stock const PLUGIN_AUTHOR[] = "Kimi";

new MAX_HIGHPING;
new TIME_HIGHPING;
new CHECK_HIGHPING;

new hpksound, hpkban, btime;
new iNumTests[33]
new gsound[] = {^"vox/buzwarn^"};


public plugin_init()
{
    register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);

    // Cvars:
    register_cvar("amx_show_activity","2")
    hpksound = register_cvar("amx_hpk_sound","1");
    hpkban = register_cvar("amx_hpk_ban","1");
    btime = register_cvar("amx_hpk_bantime","10");
    MAX_HIGHPING = register_cvar("amx_max_ping","100");
    TIME_HIGHPING = register_cvar("amx_time_ping","15");
    CHECK_HIGHPING = register_cvar("amx_check_ping","5");

    // Multi-langual dictionary:
    register_dictionary("Ultimate_High_Ping_Guard.txt");

    // Commands:
    register_concmd("amx_hpk_sound","sound_command",ACCESS);
    register_concmd("amx_hpk_ban","ban_command",ACCESS);
    register_concmd("amx_hpk_bantime","bantime_command",ACCESS);
    register_concmd("amx_max_ping","max_ping",ACCESS);
    register_concmd("amx_time_ping","time_ping",ACCESS);
    register_concmd("amx_check_ping","check_ping",ACCESS);

    // Others:
    if (TIME_HIGHPING < 15) TIME_HIGHPING = 15
    if (CHECK_HIGHPING < 5) CHECK_HIGHPING = 5
    return PLUGIN_CONTINUE
}
   

public client_putinserver(id)
{
    iNumTests[id] = 0
    if (!is_user_bot(id)) {
        new param[1]
        param[0] = id
        set_task(25.0, "Warning", id, param, 1)
    }
    return PLUGIN_CONTINUE
}


public Warning(param[])
{
    if(get_pcvar_num(hpkban) == 1.2)
    {
        client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_ban", MAX_HIGHPING);
        set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
    }
    else
    {
        client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_kick", MAX_HIGHPING);
        set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
    }
}


public client_disconnect(id)
{
    remove_task(id)
    return PLUGIN_CONTINUE
}


public checkPing(param[])
{
    new id = param[0]
    if ((get_user_flags(id) & ADMIN_KICK) || (get_user_flags(id) & ADMIN_RESERVATION)) {
        remove_task(id)
        client_print(id, print_chat, "%L",LANG_PLAYER,"imun_msg")
        return PLUGIN_CONTINUE
    }
    new ping, loss
    get_user_ping(id, ping, loss)
    if (ping > MAX_HIGHPING)
        ++iNumTests[id]
    else
        if (iNumTests[id] > 0) --iNumTests[id]
    if (iNumTests[id] > CHECK_HIGHPING)
        BanLag(id)
    return PLUGIN_CONTINUE
}


BanLag(id)
{
    new ping, loss
    get_user_ping(id, ping, loss)

    switch(hpksound)
    {
        case 0:
        {
            switch(hpkban)
            {
                case 0:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("kick #%d ^"High Ping Detected !^"", uID);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
                }

                case 1:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    //new uID = get_user_userid(id);
                    //new ip = get_user_ip(id, ip,31);
                    server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);


                }

                case 2:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                }
            }
        }

        case 1:
        {
            switch(hpkban)
            {
                case 0:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("kick #%d ^"High Ping Detected !^"", uID);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound);
                }

                case 1:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    //new uID = get_user_userid(id);
                    //new ip = get_user_ip(name,ip,31);
                    server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound)
                }

                case 2:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound);
                }
   
            }
        }
    }

    return PLUGIN_CONTINUE
}


public sound_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public ban_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public bantime_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public max_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_max_ping")
    return PLUGIN_CONTINUE
}

public time_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_time_ping")
    return PLUGIN_CONTINUE
}

public check_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_check_ping")
    return PLUGIN_CONTINUE
}


/* Visit www.cs-utilz.net for other AMXX Plugins ! */

Zmienione, sprawdź czy się skompiluje ;) i daj znać..
  • +
  • -
  • 0

#3 Change

    Super Hero

  • Użytkownik

Reputacja: 129
Zaawansowany

  • Postów:1161
  • Lokalizacja:Konin
Offline

Napisano 25.10.2009 07:47

W ptb to jest w ptb.cfg, nie ma po co kodu ruszać :)
  • +
  • -
  • 0

#4 mitol007

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:64
Offline

Napisano 25.10.2009 15:28

Niestety, ale przeróbka nie działa. (oryginał tak)

Change, ale właśnie w tym moim pluginie nie ma pliku hpk.cfg ;/
Szukam, ale nie mogę znaleźć.
  • +
  • -
  • 0

#5 Grycuk

    Zaawansowany

  • Użytkownik

Reputacja: 16
Początkujący

  • Postów:113
  • GG:
  • Steam:steam
  • Imię:Kamil
  • Lokalizacja:Minsk Mazowiecki
Offline

Napisano 25.10.2009 15:38

Sprawdz to...

Załączone pliki


  • +
  • -
  • 0

#6 DaddyKuba

    Godlike

  • Użytkownik

Reputacja: 253
Wszechwidzący

  • Postów:1227
  • GG:
  • Steam:steam
  • Imię:Kamil
  • Lokalizacja:Pszczyna
Offline

Napisano 25.10.2009 15:53

Masz:
/*
                            _____  _____  __   _    _                       _         
                            |_   _||_   _|[  | / |_ (_)                     / |_       
                              | |    | |   | |`| |-'__   _ .--..--.   ,--. `| |-'.---. 
                              | '    ' |   | | | | [  | [ `.-. .-. | `'_ : | | / /__
                                __/ /    | | | |, | |  | | | | | | // | |,| |,| __.,
                                `.__.'    [___]__/[___][___||__||__]'-;__/__/ '.__.'

                ____  ____   _         __          _______   _                        ______                                __ 
                |_   ||   _| (_)       [  |        |_   __  (_)                     .' ___  |                              |  ]
                  | |__| |   __   .--./)| |--.       | |__) |__   _ .--.   .--./)   / .'   _| __   _   ,--.   _ .--.   .--.| | 
                  |  __  |  [  | / /'`;| .-. |      |  ___/[  | [ `.-. | / /'`;   | |   ____[  | | | `'_ : [ `/'`]/ /'`' | 
                _| |  | |_  | |  ._//| | | |     _| |_    | |  | | | |  ._//    `.___]  || _/ |,// | |, | |    | __/  | 
                |____||____|[___].',__`[___]|__]   |_____|  [___][___||__].',__`     `._____.' '.__.'_/'-;__/[___]    '.__.;__]
                                ( ( __))                                 ( ( __))                                               



                                            __        _____   
                                           /  |      / ___ `.
                                    _   __`| |     |_/___) |
                                    [  [  ]| |      .'____.'
                                     / /_| |_  _ / /_____ 
                                      __/|_____|(_)|_______|

                            ______               ___  ____    _                 _   
                            |_   _              |_  ||_  _|  (_)               (_) 
                              | |_) |  _   __      | |_/ /    __   _ .--..--.   __   
                              |  __'. [  [  ]     |  __'.   [  | [ `.-. .-. | [  | 
                            _| |__) |  '/ /     _| |   _  | |  | | | | | |  | | 
                            |_______/[_:  /     |____||____|[___][___||__||__][___]
                                      __.'                                         


                Author: Kimi
        Version: 1.2




====  #    *Cvars* #  ======================================================================================================================================

- amx_hpk_sound 1/0 - Sound when a player is kicked/banned (1 - default)
- amx_hpk_ban 0/1/2 - If it's 0 it will only kick the player, if it's will banIP (default) and if it's 2 will ban the SteamID.
- amx_hpk_bantime <minutes> - Ban duration.

- amx_max_ping 100 - Max ping.
- amx_time_ping 15 - Frequency in seconds of ping checking.
- amx_check_ping 5 - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #    *Commands* #  ===================================================================================================================================

- amx_hpk_sound 1/0 - Activated or Not.
- amx_hpk_ban 0/1/2 - Kick method.
- amx_hpk_bantime <minutes> - Ban duration.
- amx_max_ping <ping> - Max ping.
- amx_time_ping <seconds> - Frequency in seconds of ping checking.
- amx_check_ping <checks> - Minimal number of checks before doing anything.

=========================================================================================================================================================





====  #    *Credits* #  ====================================================================================================================================

- hack and more
- SAMURAI
- alliedmodders' users for critics

=========================================================================================================================================================                                                                           /|
                                                                            |
                                                                            /|
.                                                                                 //|
.                                                                              ///|
.                                                                             ////|
..........................................................................................................................................................
*/

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_KICK

stock const PLUGIN_NAME[] = "Ultimate High Ping Guard";
stock const PLUGIN_VERSION[] = "1.1";
stock const PLUGIN_AUTHOR[] = "Kimi";

new MAX_HIGHPING;
new TIME_HIGHPING;
new CHECK_HIGHPING;

new hpksound, hpkban, btime;
new iNumTests[33]
new gsound[] = {^"vox/buzwarn^"};


public plugin_init()
{
    register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);

    // Cvars:
    register_cvar("amx_show_activity","2")
    hpksound = register_cvar("amx_hpk_sound","1");
    hpkban = register_cvar("amx_hpk_ban","1");
    btime = register_cvar("amx_hpk_bantime","10");
    MAX_HIGHPING = register_cvar("amx_max_ping","100");
    TIME_HIGHPING = register_cvar("amx_time_ping","15");
    CHECK_HIGHPING = register_cvar("amx_check_ping","5");

    // Multi-langual dictionary:
    register_dictionary("Ultimate_High_Ping_Guard.txt");

    // Commands:
    register_concmd("amx_hpk_sound","sound_command",ACCESS);
    register_concmd("amx_hpk_ban","ban_command",ACCESS);
    register_concmd("amx_hpk_bantime","bantime_command",ACCESS);
    register_concmd("amx_max_ping","max_ping",ACCESS);
    register_concmd("amx_time_ping","time_ping",ACCESS);
    register_concmd("amx_check_ping","check_ping",ACCESS);

    // Others:
    if (TIME_HIGHPING < 15) TIME_HIGHPING = 15
    if (CHECK_HIGHPING < 5) CHECK_HIGHPING = 5
    return PLUGIN_CONTINUE
}
   

public client_putinserver(id)
{
    iNumTests[id] = 0
    if (!is_user_bot(id)) {
        new param[1]
        param[0] = id
        set_task(25.0, "Warning", id, param, 1)
    }
    return PLUGIN_CONTINUE
}


public Warning(param[])
{
    if(get_pcvar_num(hpkban) == 1.2)
    {
        client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_ban", MAX_HIGHPING);
        set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
    }
    else
    {
        client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_kick", MAX_HIGHPING);
        set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b")
    }
}


public client_disconnect(id)
{
    remove_task(id)
    return PLUGIN_CONTINUE
}


public checkPing(param[])
{
    new id = param[0]
    if ((get_user_flags(id) & ADMIN_KICK) || (get_user_flags(id) & ADMIN_KICK)) {
        remove_task(id)
        client_print(id, print_chat, "%L",LANG_PLAYER,"imun_msg")
        return PLUGIN_CONTINUE
    }
    new ping, loss
    get_user_ping(id, ping, loss)
    if (ping > MAX_HIGHPING)
        ++iNumTests[id]
    else
        if (iNumTests[id] > 0) --iNumTests[id]
    if (iNumTests[id] > CHECK_HIGHPING)
        BanLag(id)
    return PLUGIN_CONTINUE
}


BanLag(id)
{
    new ping, loss
    get_user_ping(id, ping, loss)

    switch(hpksound)
    {
        case 0:
        {
            switch(hpkban)
            {
                case 0:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("kick #%d ^"High Ping Detected !^"", uID);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
                }

                case 1:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    //new uID = get_user_userid(id);
                    //new ip = get_user_ip(id, ip,31);
                    server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);


                }

                case 2:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                }
            }
        }

        case 1:
        {
            switch(hpkban)
            {
                case 0:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("kick #%d ^"High Ping Detected !^"", uID);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound);
                }

                case 1:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    //new uID = get_user_userid(id);
                    //new ip = get_user_ip(name,ip,31);
                    server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound)
                }

                case 2:
                {
                    new name[32]
                    get_user_name(id, name, 31);
                    new uID = get_user_userid(id);
                    server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime);
                    client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping);
                    client_cmd(0, "spk %d", gsound);
                }
   
            }
        }
    }

    return PLUGIN_CONTINUE
}


public sound_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public ban_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public bantime_command(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_hpk_ban")
    return PLUGIN_CONTINUE
}

public max_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_max_ping")
    return PLUGIN_CONTINUE
}

public time_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_time_ping")
    return PLUGIN_CONTINUE
}

public check_ping(id)
{
    if(!(get_user_flags(id) & ACCESS))
        return PLUGIN_HANDLED

    client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd")
    server_cmd("amx_cvar amx_check_ping")
    return PLUGIN_CONTINUE
}


/* Visit www.cs-utilz.net for other AMXX Plugins ! */

  • +
  • -
  • 0

#7 mitol007

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:64
Offline

Napisano 26.10.2009 21:05

Dzięki chłopaki :)
po plusiku dla Was
  • +
  • -
  • 0

#8 Change

    Super Hero

  • Użytkownik

Reputacja: 129
Zaawansowany

  • Postów:1161
  • Lokalizacja:Konin
Offline

Napisano 27.10.2009 13:38

PTB przerobienie


No to już nie rozumiem czy chodzi o hpk czy o ptb..
  • +
  • -
  • 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