Logs plugin error

Въпроси и проблеми свързани с AMXModX.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Logs plugin error

Мнение от lantimilan » 23 Дек 2017, 10:46

Hi i use this plugin for logs he working good its okey but this plugin use every same nick for 5-10 times can you help me just one time to save same nick or IP same in photo : http://prntscr.com/hrbn97

Код за потвърждение: Избери целия код

#include <amxmodx>

new LogFile[128];

public plugin_init()
{
	register_plugin("Logs Connect", "1.0", "Leo_[BH]")
	
	new Date[32] 
	get_time("%Y-%m-%d",Date,31)
	
	format(LogFile, 127, "addons/amxmodx/logs/connect-%s.log", Date)
}

public client_authorized(id)
{
	new name[32], steamid[36], ip_ip[24];

	get_user_name(id, name, 31);
	get_user_authid(id, steamid, 35);
	get_user_ip(id, ip_ip, 23, 1);
	
	log_to_file(LogFile, "%s %s %s", ip_ip, steamid, name)
}

Аватар
monk
Извън линия
Потребител
Потребител
Мнения: 156
Регистриран на: 22 Окт 2016, 18:08
Местоположение: /gym
Се отблагодари: 2 пъти
Получена благодарност: 9 пъти

Logs plugin error

Мнение от monk » 23 Дек 2017, 13:08

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""

new toggle;
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR);
    toggle = register_cvar("ip_log","1");
}
public client_connect(id)
{
    if(get_pcvar_num(toggle) != 1) return;
    IP_Log(id);
}
IP_Log(id)
{
    new szFile[128];
    get_configsdir(szFile,127);
    formatex(szFile,127,"%s/ip_log.txt",szFile);
    
    if(!file_exists(szFile))
    {
        write_file(szFile,"Ips Connected",-1);
        write_file(szFile," ",-1)
    }
    new name[32],ip[32],sztime[54],szLog[256];
    get_user_name(id,name,31);
    get_user_ip(id,ip,31);
    get_time("%m.%d.%Y -- %H:%M:%S",sztime,53);
    
    formatex(szLog,255,"Player: %s. IP: %s. Date: %s",name,ip,sztime);
    write_file(szFile,szLog,-1);
It's not logging steam id,but try.
My body is like breakfast, lunch, and dinner. I don't think about it, I just have it.
- Arnold Schwarzenegger
--
45.144.155.105:27029 -Ex0t1C-pLay # > Dust 2 Only <
--

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Logs plugin error

Мнение от lantimilan » 23 Дек 2017, 15:30


Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Logs plugin error

Мнение от OciXCrom » 23 Дек 2017, 19:41

If you want to disable disconnect logs, just remove the #define LOG_DISCONNECTING line. The logs are saved in the file set in #define LOG_FILE.

Код за потвърждение: Избери целия код

#include <amxmodx>

#define LOG_CONNECTING
#define LOG_DISCONNECTING

#define LOG_FILE "addons/amxmodx/logs/ConnectInfo.log"

public plugin_init()
	register_plugin("Connect/Disconnect Logs", "1.0", "OciXCrom")

#if defined LOG_CONNECTING
public client_putinserver(id)
	log_connection(id, true)
#endif

#if defined LOG_DISCONNECTING
public client_disconnect(id)
	log_connection(id, false)
#endif

log_connection(const id, const bool:bConnect)
{
	new szName[32], szAuthId[35], szIP[22]
	get_user_name(id, szName, charsmax(szName))
	get_user_authid(id, szAuthId, charsmax(szAuthId))
	get_user_ip(id, szIP, charsmax(szIP))	
	log_to_file(LOG_FILE, "%s: %s [%s | %s]", bConnect ? "CONNECT" : "DISCONNECT", szName, szIP, szAuthId)
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Logs plugin error

Мнение от lantimilan » 23 Дек 2017, 19:53

Bro you not understand me what i ask i ask , im try to find one plugin to save just one time in day one same nick if connect do you understand me look photo : http://prntscr.com/hrgjkh i connect after 1 min he again regsiter me i want just one time to register plugin

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Logs plugin error

Мнение от OciXCrom » 23 Дек 2017, 20:00

This is the first time you mentioned you want to log it DAILY. Making that is not that simple.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Logs plugin error

Мнение от lantimilan » 23 Дек 2017, 20:05

Aha okey thanks :D

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Поддръжка / Помощ”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 12 госта