[URL] https://amxx.pl/topic/6733-ostatnio-dostępny/
**Opis:**
Plugin poprzez wpisanie komendy wyświetla kiedy ostatnio jakiś gracz grał na
serwerze.
Czas jest pokazywany w formacie: lata, miesiące, dni, godziny, minuty, sekundy
**Instalacja:**
**Plik players_seen. amxx** wrzucamy do cstrike/addons/amxmodx/plugins
**Edytujemy plugins.ini** i dopisujemy na końcu: players_seen.amxx
**Plik players_seen.sma** wrzucamy do cstrike/addons/amxmodx/scripting
**Plik fdata.inc** wrzucamy do cstrike/addons/amxmodx/scripting/include
Restartujemy serwer lub zmienamy mapę.
**Komendy:**
say /seen x
say_team /seen x
gdzie w miejsce x wpisujemy nick gracza.
**Screen:**
![[Image: 16438747og1.png]](http://img129.imageshack.us/img129/9499/16438747og1.png)
**Plik fdata.inc :**
/*File Data Store System */
/*Type : Include*/
/* */
/* This file is provided as is (no warranties). */
/* */
stock fdata_exists(File[], Key[], Data[])
{
new Buffer[256], Currkey[128], Currvalue[64];
new Line = 0, Len, Currline = -1;
if(file_exists(File))
{
while((Line = read_file(File, Line++, Buffer, sizeof Buffer - 1, Len)))
{
if((Buffer[0] != '/' && Buffer[1] != '/') && Buffer[0] != ';')
{
strtok(Buffer, Currkey, sizeof Currkey - 1, Currvalue, sizeof Currvalue - 1, ';', 0);
if(equali(Currkey, Key))
{
copy(Data, 128, Currvalue);
Currline = Line - 1;
break;
}
else if(equal(Currkey,"") || !Currkey[0])
Currline = Line - 1;
}
}
}
else
{
static Num;
Num += 1;
server_print("Warning: Error #%d - File %s was not founded!", Num, File);
}
return Currline;
}
stock fdata_set(File[], Key[], Data[])
{
new Buffer[256], Blank[128];
new Line = fdata_exists(File, Key, Blank);
formatex(Buffer, sizeof Buffer - 1,"%s;%s", Key, Data);
write_file(File, Buffer, Line);
return Line;
}
stock fdata_get(File[], Key[], Data[])
{
new Line = fdata_exists(File, Key, Data);
return Line;
}
stock fdata_remove(File[], Key[])
{
new Data[128];
new Line = fdata_exists(File, Key, Data);
write_file(File,"", Line);
return Line;
}
Załączone pliki
* [url=https://amxx.pl/index.php?app=core&module=attach§ion=attach&attach_id=1424 "Pobierz załącznik"]
![[Image: unknown.gif]](https://amxx.pl/public/style_extra/mime_types/unknown.gif)
* [url=https://amxx.pl/index.php?app=core&module=attach§ion=attach&attach_id=1425 "Pobierz załącznik"]
![[Image: sma.gif]](https://amxx.pl/public/style_extra/mime_types/sma.gif)
[
![[Image: amxx.gif]](http://amxx.pl/public/style_extra/mime_types/amxx.gif)
"Pobierz plik AMXX")
Załączniki:
players_seen.sma