#include <amxmodx>
#include <amxmisc>
new cvar_poruka
public plugin_init()
{
register_plugin("Status", "1.0", "SINTAX")
register_menucmd(register_menuid("osnovni_meni"),1023,"Meni");
register_clcmd("say /status","menu");
register_clcmd("say /status1","status1");
register_clcmd("say /status2","status2");
register_clcmd("say /status3","status3");
register_clcmd("say /serverconfig","server_config");
cvar_poruka = register_cvar("Poruka","150")
set_task(get_pcvar_float(cvar_poruka),"Poruka" , _ , _ , _ , "b")
}
public menu(id)
{
static szMenuBody[256];
if(!szMenuBody[0])
{
new len = format(szMenuBody,255,"Statusz^n");
len += format(szMenuBody[len],255-len,"^n\w1. \d[\y SteamID,Nev,IP \d]");
len += format(szMenuBody[len],255-len,"^n\w2. \d[\y Csapat,Ping,Ingadozas \d]");
len += format(szMenuBody[len],255-len,"^n\w3. \d[\y Map,NextMap,Jatekosok,Ido \d]");
len += format(szMenuBody[len],255-len,"^n\w4. \d[\y Szerver-konfiguracio \d]");
len += format(szMenuBody[len],255-len,"^n^n\w9. \rKilepes");
}
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_9
show_menu(id,keys,szMenuBody,-1,"osnovni_meni");
}
public Meni(id, key)
{
switch(key)
{
case 0:
client_cmd(id, "say /status1");
case 1:
client_cmd(id, "say /status2");
case 2:
client_cmd(id, "say /status3");
case 3:
client_cmd(id, "say /serverconfig");
case 4:
client_cmd(id, "/");
case 9:
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public client_putinserver(id)
{
set_task(2.0, "connect", id, _, _, "a", 1)
}
public connect(id)
{
new authid [36]
new name [18]
new ip [42]
new hostname[64]
get_cvar_string("hostname",hostname,63);
get_user_authid(id, authid, 35);
get_user_name(id, name, 17);
get_user_ip(id,ip, 41,1);
ColorChat(id,"^4[%s]^1 Nev^3 %s^1 SteamID^3 %s^1 IP^3 %s ^4 udvozlunk a szerveren!",hostname,name,authid,ip);
log_to_file("Status.txt", "Nev: %s | SteamID: %s | IP: %s | kapcsolodott", name, authid, ip)
return PLUGIN_HANDLED
}
public status1(id, level, cid)
{
new authid [36]
new name [18]
new ip [42]
new hostname[64]
get_cvar_string("hostname",hostname,63);
get_user_authid(id, authid, 35);
get_user_name(id, name, 17);
get_user_ip(id,ip, 41,1);
ColorChat(id,"^4[%s]^1 Neved:^3 %s",hostname,name);
ColorChat(id,"^4[%s]^1 SteamID-d:^3 %s",hostname,authid);
ColorChat(id,"^4[%s]^1 IP-d:^3 %s",hostname,ip);
client_print(id,print_center, "Statusz...")
return PLUGIN_HANDLED
}
public status2(id, level, cid)
{
new hostname[64]
new team [32]
new ping, loss
new authid [36]
new name [18]
new ip [42]
get_user_ping(id,ping,loss)
get_cvar_string("hostname",hostname,63);
get_user_team (id,team,41);
get_user_authid(id, authid, 35);
get_user_name(id, name, 17);
get_user_ip(id,ip, 41,1);
ColorChat(id,"^4[%s]^1 Jelenleg a^3 %s^1 csapatban jatszol.",hostname,team);
ColorChat(id,"^4[%s]^1 Jelenlegi pinged:^3 %d",hostname,ping);
ColorChat(id,"^4[%s]^1 Jelenlegi ping ingadozasod:^3 %d",hostname,loss);
client_print(id,print_center, "Statusz...")
return PLUGIN_HANDLED
}
public status3(id, level, cid)
{
new mapname [32]
new hostname [64]
new players[32],num;
new playerss[32],numm;
new nextmap [32]
new times [9]
new g_MaxPlayers = get_maxplayers()
new authid [36]
new name [18]
new ip [42]
get_time("%H:%M:%S",times,8)
get_cvar_string("amx_nextmap", nextmap, 31)
get_cvar_string("hostname",hostname,63);
get_mapname(mapname,31);
get_players(players,num,"a");
get_players(playerss,numm,"b");
get_user_authid(id, authid, 35);
get_user_name(id, name, 17);
get_user_ip(id,ip, 41,1);
ColorChat(id,"^4[%s]^1 Jelenlegi map:^3 %s",hostname,mapname);
ColorChat(id,"^4[%s]^1 Kovetkezo map^3 %s",hostname,nextmap)
ColorChat(id,"^4[%s]^1 Jelenleg^3 %d^1 jatekos el es^3 %d^1 jatekos halott a szerveren",hostname,num,numm);
ColorChat(id,"^4[%s]^1 Jelenleg^3 %d^1 /^3 %d^1 jatekos jatszik a szerveren",hostname,get_playersnum(0),g_MaxPlayers)
ColorChat(id,"^4[%s]^1 Ido:^3 %s",hostname,times)
client_print(id,print_center, "Statusz...")
return PLUGIN_HANDLED
}
public server_config(id, level, cid)
{
new hostname[64]
new ff [32]
new ft [32]
new bt [32]
new sm [32]
get_cvar_string("hostname", hostname, 63)
get_cvar_string("mp_friendlyfire", ff, 31)
get_cvar_string("mp_freezetime", ft, 31)
get_cvar_string("mp_buytime", bt, 31)
get_cvar_string("mp_startmoney", sm, 31)
ColorChat(id,"^4[Szerver-Konfiguracio]^1 Szerver Nev:^3 %s",hostname)
ColorChat(id,"^4[Szerver-Konfiguracio]^1 Fagyasi Ido:^3 %s",ft)
ColorChat(id,"^4[Szerver-Konfiguracio]^1 Csapattars Sebzes:^3 %s",ff)
ColorChat(id,"^4[Szerver-Konfiguracio]^1 Vasarlasi Ido:^3 %s",bt)
ColorChat(id,"^4[Szerver-Konfiguracio]^1 Kezdo Penz:^3 %s",sm)
return PLUGIN_HANDLED
}
public Poruka()
{
ColorChat(0,"^4Szerver adatok lekerdezesehez ird be chatbe^3 /status");
}
stock ColorChat(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}