←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Przerobienie skryptu

Zablokowany

  • +
  • -
darex11 - zdjęcie darex11 11.01.2009

Witam. Otoz potrzebuje by ktos mi przerobil skrypt do logowania ip i nicku. Chcialbym aby bylo mozna dodac wyjatek IP ktory by sie nie logowal do pliku.

Kod pluginu:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "IP LOger"
#define VERSION "1.0"
#define AUTHOR "GuTeK"
#define LOGER_TASK 1133


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("amx_iploger", "1")
}

public loger(id){
    id-=LOGER_TASK
    new logfile[64],text[128],timme[9]
    new name[33], ip[16];
    get_time("%d%m%Y",timme,8)
    get_user_name(id, name, 32)
    get_user_ip(id, ip, 15, 1)
    if(get_cvar_num("amx_iploger") == 1){
        client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip)
        format (text, 63, "Nick: %s <!!> IP: %s",name,ip)
        format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme)
        write_file( logfile, text )

    }
    if(get_cvar_num("amx_iploger") == 2){
        client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip)
    }
    if(get_cvar_num("amx_iploger") == 3){
        format (text, 63, "Nick: %s <!!> IP: %s",name,ip)
        format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme)
        write_file( logfile, text )
    }
       
}
public client_putinserver(id){
    set_task(3.0, "loger",id+LOGER_TASK)

} 

.log
Nick: waeldreegia <!!> IP: 127.0.0.1
Nick: bobjones <!!> IP: 127.0.0.1
Nick: DROP DEAD FRED <!!> IP: 127.0.0.1
Nick: pyr0` <!!> IP: 127.0.0.1
Nick: k0h0 <!!> IP: 127.0.0.1
Nick: Texas <!!> IP: 127.0.0.1

Jak widac mam pelno logow z IP lokalnego ( przez boty ). Chcialbym aby ten IP lub inny ( nawet kilka ) byly wyjatkami i sie nie dodawaly do loga... Jest ktos w stanie to przerobic ?

Pozdrawiam,
Dariusz.
Odpowiedz

  • +
  • -
wizu - zdjęcie wizu 11.01.2009

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "IP LOger"
#define VERSION "1.0"
#define AUTHOR "GuTeK"
#define LOGER_TASK 1133


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("amx_iploger", "1")
}

public loger(id)
{
	id-=LOGER_TASK
	new logfile[64],text[128],timme[9]
	new name[33], ip[16];
	get_time("%d%m%Y",timme,8)
	get_user_name(id, name, 32)
	get_user_ip(id, ip, 15, 1)
	
	if(get_cvar_num("amx_iploger") == 1)
	{
		client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip)
		if (!equal(ip, "127.0.0.1"))
		{
			format (text, 63, "Nick: %s <!!> IP: %s",name,ip)
			format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme)
			write_file( logfile, text )
		}

	}
	
	if(get_cvar_num("amx_iploger") == 2)
	{
		client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip)
	}
	
	if(get_cvar_num("amx_iploger") == 3 && !equal(ip, "127.0.0.1"))
	{
		format (text, 63, "Nick: %s <!!> IP: %s",name,ip)
		format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme)
		write_file( logfile, text )
	}
       
}

public client_putinserver(id)
{
	set_task(3.0, "loger",id+LOGER_TASK)
}

Nietestowane, ale powinno robić swoje ;)
Odpowiedz

  • +
  • -
darex11 - zdjęcie darex11 11.01.2009

dzięki wielkie, wszystko dziala jak nalezy.

Pozdrawiam,
Dariusz.
Odpowiedz
Zablokowany