Tylko komenda nie działa i nie wiem co jest źle
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "IPLog"
#define VERSION "1.0"
#define AUTHOR "Mochi"
#define ADMIN_IP ADMIN_BAN
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_listaip", "show", ADMIN_IP ,"<Nazwa pliku np. 11.08.2009>")
}
public client_authorized(id)
{
if(is_user_bot(id)) return PLUGIN_CONTINUE
new flags = get_user_flags(id)
if(!(flags == ADMIN_BAN))
{
static datestr[11],LogFile[65] ,timestr[11]
new Name[33],ip[16],tekst[65]
get_user_name(id, Name, 32)
get_user_ip(id, ip, 15, 1)
get_time("%d.%m.%Y", datestr, 10)
get_time("%X",timestr,10)
formatex(LogFile, 64, "addons/amxmodx/logs/%s.txt",datestr)
formatex(tekst,64,"(%s)Nick: %s | IP: %s",timestr,Name,ip)
write_file ( LogFile, tekst, -1)
}
return PLUGIN_CONTINUE
}
public show(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED;
new filename[65],file[84]
read_argv(1, filename, sizeof filename - 1);
format(file,83,"addons/amxmodx/logs/%s.txt",filename)
if(file_exists(file))
{
client_print(id,print_console,"========Lista IP z %s========",filename)
new line=0, text[128],chars
do{
line = read_file(file,line,text,127,chars)
client_print(id,print_console,"%s",text)
client_print(id,print_console,"=======================================")
}
while(line!=0)
}
else
{
client_print(id,print_console,"Nie znaleziono pliku!")
}
return PLUGIN_CONTINUE
}


Dodatki SourceMod



Temat jest zamknięty








