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.
|
Plugin zapisujący informację o ilości graczy do pliku
#1
Napisano 22.10.2009 17:10
#2
Napisano 22.10.2009 17:21
#include <amxmodx>
public plugin_init() {
register_plugin("Plug-In", "0.1", "Knopers")
set_task(300.0, "pisz", _, _, _, "b");
}
public pisz(){
new file[32],Time[9];
new ile = get_playersnum();
get_time("%d%m%y",Time,8);
format(file,31,"Players_%s.log",Time);
log_to_file(file,"Aktualna ilosc graczy na serwerze to : %d", ile);
}@edit Poprawiłem małą literówka
#3
Napisano 22.10.2009 17:36
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Log"
#define VERSION "1.0"
#define AUTHOR "PortuS"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(300,"log")
}
public log(id) {
new gracze = get_playersnum(id);
log_to_file("gracze_log.txt","Ilosc graczy %s",gracze)
} Logi lądują w jednym pliku, u Knopersa, każdy dzień to nowy plik.

IP: ts3.cserwerek.pl
#4
Napisano 23.10.2009 12:14
EDIT W pliku jest:
Jeśli można to bardzo proszę o dopisanie kodu, który informowałby w pliku jaka mapa jest aktualnie grana. Portek, przy kompilacji twojego kodu pojawia się ostrzeżenie:L 10/23/2009 - 13:26:38: Log file started (file "cstrike/addons/amxmodx/logs/Players_231009.log") (game "cstrike") (amx "1.8.1.3746")
L 10/23/2009 - 13:26:38: Aktualna ilosc graczy na serwerze to : 23
L 10/23/2009 - 13:31:38: Aktualna ilosc graczy na serwerze to : 26
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
/groups/amxmodx/tmp3/textVibXMx.sma(11) : warning 213: tag mismatch
Header size: 188 bytes
Code size: 288 bytes
Data size: 208 bytes
Stack/heap size: 16384 bytes; estimated max. usage=779 cells (3116 bytes)
Total requirements: 17068 bytes
1 Warning.
Done.
#5
Napisano 23.10.2009 16:48
#include <amxmodx>
public plugin_init() {
register_plugin("Plug-In", "0.1", "Knopers")
set_task(300.0, "pisz", _, _, _, "b");
}
public pisz(){
new file[32],Time[9],mapa[64];
new ile = get_playersnum();
get_time("%d%m%y",Time,8);
get_mapname(mapa,63);
format(file,31,"Players_%s.log",Time);
log_to_file(file,"Aktualna ilosc graczy na serwerze to : %d | Aktualna mapa: %s", ile, mapa);
}lub
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Log"
#define VERSION "1.0"
#define AUTHOR "PortuS"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(300.0, "log");
}
public log() {
new gracze = get_playersnum();
new mapa[64];
get_mapname(mapa,63);
log_to_file("gracze_log.txt","Ilosc graczy %d | Aktualna mapa: %s",gracze, mapa);
}

IP: ts3.cserwerek.pl
#6
Napisano 23.10.2009 18:23
PS Dałem punkty.
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty









