backedtracked
Пользователь
- Регистрация
- 26 Мар 2019
- Сообщения
- 57
- Симпатии
- 3
- OS
- Linux
- Amx Mod X
- AMXX 1.8.2
- Билд
- Build date: 18:46:47 May 18 2020 (2228)
- ReGamedll
- ReGameDL version: 5.13.0.450-dev+m
- Metamod
- Metamod-r v1.3.0.104, API (5:13)
- Meta модули
-
Код:[ 1] AMX Mod X RUN- amxmodx_mm_i386.so v1.8.2 ini Start ANY
[ 2] WHBlocker RUN- whblocker_mm_i386.so v1.5.697ini Chlvl ANY
[ 3] Reunion RUN- reunion_mm_i386.so v0.1.75 ini Start Never
[ 4] VoiceTranscoder RUN- VoiceTranscoder.so v2017RC3ini ANYANY
[ 5] SafeNameAndChat RUN- SafeNameAndChat.so v1.1 ini ANYANY
[ 6] ReSRDetector RUN- resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 7] ReSemiclip RUN- resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 8] Rechecker RUN- rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 9] AimEspFix RUN- SoftBlocker_mm_i386.sov1.1 ini ANYNever
[10] ReAuthCheckRUN- reauthcheck_mm_i386.sov0.1.6 ini Start Never
[11] ReAPIRUN- reapi_amxx_i386.so v5.12.0.192-dev pl1 ANYNever
[12] ReAimDetector RUN- reaimdetector_amxx_i386.so v0.2.2 pl1 ANYNever
[13] MySQRUN- mysql_amxx_i386.so v1.8.2 pl1 ANYANY
[14] SQLite RUN- sqlite_amxx_i386.sov1.8.2 pl1 ANYANY
[15] Fun RUN- fun_amxx_i386.sov1.8.2 pl1 ANYANY
[16] Engine RUN- engine_amxx_i386.sov1.8.2 pl1 ANYANY
[17] FakeMetaRUN- fakemeta_amxx_i386.so v1.8.2 pl1 ANYANY
[18] CStrike RUN- cstrike_amxx_i386.so v1.8.2 pl1 ANYANY
[19] CSX RUN- csx_amxx_i386.sov1.8.2 pl1 ANYANY
[20] Ham Sandwich RUN- hamsandwich_amxx_i386.so v1.8.2 pl1 ANYANY
- Плагины
-
Код:admin.amxx ; admin base (required for any admin-related)
admincmd.amxx ; basic admin console commands
;adminhelp.amxx ; help command for admin console commands
;adminslots.amxx ; slot reservation
;multilingual.amxx ; Multi-Lingual management
mapmanager.amxx ; Менеджер карт
adminmenu.amxx ; menufront amxmodmenu
cmdmenu.amxx ; command menu (speech, settings)
plmenu.amxx ; players menu (kick, ban, client cmds.)
pluginmenu.amxx ; Menus for commands/cvars organized by plugin
adminchat.amxx ; console chat commands
adminvote.amxx ; vote commands
admininfo.amxx ; это команда /admins /admin /adm
;nextmap.amxx ; displays next map in mapcycle
;mapchooser.amxx ; allows to vote for next map
timeleft.amxx ; displays time left on map
pausecfg.amxx ; allows to pause and unpause some plugins
restmenu.amxx ; restrict weapons menu
mapsmenu.amxx ; mapping menu idem
server_choose_ext.amxx
csstatsx_sql.amxx ; статистика со скиллом
aes_statsx_cstrike.amxx ; статистика со ELO скиллом
aes_statsx_rank.amxx ; вывод ранга в freezetime
statsx.amxx ; статистика смертей/убийств подряд (требуется модуль CSX)
statscfg.amxx ; статистика со скиллом
stats_logging.amxx ; статистика со скиллом
miscstats.amxx ; статистика со скиллом
dhud_advert.amxx ; Реклама
night_vip.amxx ; Донат вип привелегии с 00 до 12, ночное время
screen_player.amxx ; Скриншоты игрокам
- Amxx Модули
-
Код:ReAPI 5.12.0.192 Asmodai & s1lent running
ReAimDetector 0.2.2 ReHLDS Team running
MySQ 1.8.2 AMX Mod X Dev Teamrunning
SQLite1.8.2 AMX Mod X Dev Teamrunning
Fun1.8.2 AMX Mod X Dev Teamrunning
Engine1.8.2 AMX Mod X Dev Teamrunning
FakeMeta 1.8.2 AMX Mod X Dev Teamrunning
GeoIP 1.8.2 AMX Mod X Dev Teamrunning
Sockets_hz 1.8.2-devhackziner v. of HLS running
RegEx 1.8.2 AMX Mod X Dev Teamrunning
nVault1.8.2 AMX Mod X Dev Teamrunning
CStrike 1.8.2 AMX Mod X Dev Teamrunning
CSX1.8.2 AMX Mod X Dev Teamrunning
Ham Sandwich1.8.2 AMX Mod X Dev Teamrunning
- Ошибка
-
Код:Ошибки как таковой нет, плагин работает, но не отображает список серверов
пишет следующее "Не отвечает , нет данных
Заранее благодарю за поддержку)
- Исходник
-
Код:#include <amxmodx>
#include <sockets>
#if AMXX_VERSION_NUM < 183
#include <fakemeta>
const m_iMenu = 205;
const MENU_OFF= 0;
#include <colorchat>
enum
{
print_team_default = 0,
print_team_grey = -1,
print_team_red = -2,
print_team_blue = -3,
};
#endif
#define is_said_slash_server (said[0] == '/' && said[1] == 's' && said[2] == 'e' && said[3] == 'r' && said[4] == 'v' && said[5] == 'e' && said[6] == 'r')
#define is_said_slash_follow (said[0] == '/' && said[1] == 'f' && said[2] == 'o' && said[3] == 'l' && said[4] == 'l' && said[5] == 'o' && said[6] == 'w')
#define printf_chat client_print_color
#define PC PLUGIN_CONTINUE
#define PH PLUGIN_HANDLED
#define PH_MAIN PLUGIN_HANDLED_MAIN
const ALL = 0;
const NAME_LEN = 32;
const HOSTNAME_LEN = 64;
const MAPNAME_LEN = 64;
const ITEM_LEN = 128;
const MAX_SERVERS = 5; //больше 5 не проверялось
const Float: GENERAL_TASKID_INTERVAL = 15.0;
const GENERAL_TASKID = 753733;
const GET_RESPONSE_TASKID = 821298;
new _name[NAME_LEN], runaway_player_name[NAME_LEN], item_name[ITEM_LEN], follow_server_index = -1;
stock const CHAT_INFO_PREFIX[] = "^3[ИНФО]^1";
new const SERVER_IP[MAX_SERVERS][] = //IP, порт должен быть указан отдельно
{
"public.s13cs.ru",
"62.109.19.222",
"62.109.19.222",
"83.222.114.74",
"188.120.247.129"
};
new const SERVER_PORT[MAX_SERVERS] = //Port
{
27015,
27015,
27016,
27177,
27015
};
//раскомментировать для отображения motd окна
//#define MOTD
#if defined MOTD
new const MOTD_MESSAGE[] = "motd.txt";//также можно вставлять ссылки
#endif
#define sq_readbyte(%0,%1,%2,%3) sq_readint(%0, %1, %2, 1, %3, false)
#define sq_readshort(%0,%1,%2,%3) sq_readint(%0, %1, %2, 2, %3, false)
#define sq_readlong(%0,%1,%2,%3) sq_readint(%0, %1, %2, 4, %3, true)
#define sq_fixedunsigned8(%0) %0 = clamp (%0, -0xFF, 0xFF);\
if (%0 < 0) {\
%0 = 0xFF + %0 + 1;\
}
new const A2S_INFO[] = "^xFF^xFF^xFF^xFF^x54Source Engine Query^x00";//FF FF FF FF 54 53 6F 75 72 63 65 20 45 6E 67 69 6E 65 20 51 75 65 72 79 00
const A2S_INFO_LEN = 25;
const BUFFER_SIZE = 1600;
const MAX_RESPONSE_ATTEMPTS = 10;
new buffer[BUFFER_SIZE];
enum query_data_map
{
QD_SOCKET,
QD_RESPONSE_ATTEMPTS,
QD_HOSTNAME[HOSTNAME_LEN],
QD_MAPNAME[MAPNAME_LEN],
QD_PLAYERS_NUM,
QD_PLAYERS_MAX
};
new query_data[MAX_SERVERS][query_data_map];
new const SERVER_QUERY_ERRORS_LIST[][] =
{
"No error",
"Error while creating socket",
"Couldn't resolve hostname",
"couldn't connect to given hostnameort"
};
public plugin_init()
{
register_plugin ("Server Choose Extended", "1.0.2", "Radius");
register_clcmd("say", "clcmd_say");
register_clcmd("say_team", "clcmd_say");
general_task();
set_task(GENERAL_TASKID_INTERVAL, "general_task", GENERAL_TASKID, _, _, "b");
}
public clcmd_say(id)
{
static said[8];
read_argv (1, said, charsmax(said));
if (is_said_slash_server) {
#if defined MOTD
show_motd(id, MOTD_MESSAGE, "Наши сервера");
#endif
return server_menu(id);
}
else if (is_said_slash_follow) {
if (follow_server_index != -1) {
get_user_name(id, _name, charsmax(_name));
printf_chat(ALL, print_team_default, "%s %s последовал за %s на %s", CHAT_INFO_PREFIX, _name, runaway_player_name, query_data[follow_server_index][QD_HOSTNAME]);
client_cmd(id, "^"disconnect^";^"wait^";^"wait^";^"wait^";^"connect^" %s:%d", SERVER_IP[follow_server_index], SERVER_PORT[follow_server_index]);
}
else {
printf_chat(ALL, print_team_default, "%s Нельзя использовать^3 /follow^1, поскольку не за кем следовать", CHAT_INFO_PREFIX);
}
}
return PC;
}
server_menu(id)
{
static servers_menu_id;
if (!servers_menu_id) {
servers_menu_id = menu_create("Какой сервер хотите посетить?", "servers_menu_handler");
new server_menu_callback = menu_makecallback ("server_menu_callback");
for (new i; i < MAX_SERVERS; ++i) {
formatex(item_name, charsmax(item_name), "%s \r[\y%d / %d\r]^n Карта:\y %s", query_data[QD_HOSTNAME], query_data[QD_PLAYERS_NUM], query_data[QD_PLAYERS_MAX], query_data[QD_MAPNAME]);
menu_additem(servers_menu_id, item_name, .callback = server_menu_callback);
}
menu_setprop (servers_menu_id, MPROP_EXITNAME, "Никакой");
}
#if AMXX_VERSION_NUM < 183
set_pdata_int (id, m_iMenu, MENU_OFF);
#endif
menu_display (id, servers_menu_id);
return PH;
}
public server_menu_callback(id, menu, item)
{
static item_status;
if (query_data[item][QD_PLAYERS_MAX]) {
formatex(item_name, charsmax(item_name), "%s \r[\y%d / %d\r]^n Карта:\y %s", query_data[item][QD_HOSTNAME], query_data[item][QD_PLAYERS_NUM], query_data[item][QD_PLAYERS_MAX], query_data[item][QD_MAPNAME]);
item_status = ITEM_ENABLED;
}
else {
formatex(item_name, charsmax(item_name), "Не отвечает \r[\y0 / 0\r]^n Карта:\d нет данных");
item_status = ITEM_DISABLED;
}
menu_item_setname (menu, item, item_name);
return item_status;
}
public servers_menu_handler(id, menu, item)
{
if (item != MENU_EXIT) {
get_user_name(id, _name, charsmax(_name));
printf_chat(id, print_team_default, "%s %s перешёл на %s. Напишите /follow, чтобы последовать за ним", CHAT_INFO_PREFIX, _name, query_data[item][QD_HOSTNAME]);
client_cmd(id, "^"disconnect^";^"wait^";^"wait^";^"wait^";^"connect^" %s:%d", SERVER_IP[item], SERVER_PORT[item]);
follow_server_index = item;
runaway_player_name = _name;
}
return PH;
}
public general_task()
{
static errcode; errcode = 0;
for (new i; i < MAX_SERVERS; ++i) {
new socket_handle = query_data[QD_SOCKET] = socket_open(SERVER_IP, SERVER_PORT, SOCKET_UDP, errcode);
if (errcode) {
query_data[QD_PLAYERS_NUM] = query_data[QD_PLAYERS_MAX] = 0;
log_amx( "Error(%s:%d): %s", SERVER_IP, SERVER_PORT, SERVER_QUERY_ERRORS_LIST[errcode]);
}
else {
query_data[QD_RESPONSE_ATTEMPTS] = MAX_RESPONSE_ATTEMPTS;
socket_send2(socket_handle, A2S_INFO, A2S_INFO_LEN);
set_task(0.1, "get_response_task", i + GET_RESPONSE_TASKID, _, _, "a", MAX_RESPONSE_ATTEMPTS);
}
}
}
public get_response_task(taskid)
{
new index = taskid - GET_RESPONSE_TASKID;
new socket_handle = query_data[index][QD_SOCKET];
if (socket_change(socket_handle)) {
new len = socket_recv(socket_handle, buffer, charsmax(buffer));
if (len > 0) {
new packet_header, response_type, pos;
sq_readlong(buffer, len, pos, packet_header);
if (packet_header == 0xFFFFFFFF) { //-1
sq_readbyte(buffer, len, pos, response_type);
if (response_type == 0x49 || response_type == 0x6D) {
static tmp_IP[32], tmp_GameDir[32], tmp_GameDesc[128], version, AppID;
switch (response_type) {
case 0x49: {
sq_readbyte (buffer, len, pos, version);
sq_readstring(buffer, len, pos, query_data[index][QD_HOSTNAME], charsmax(query_data[][QD_HOSTNAME]));
sq_readstring(buffer, len, pos, query_data[index][QD_MAPNAME], charsmax(query_data[][QD_MAPNAME]));
sq_readstring(buffer, len, pos, tmp_GameDir, charsmax(tmp_GameDir));
sq_readstring(buffer, len, pos, tmp_GameDesc, charsmax(tmp_GameDesc));
sq_readshort (buffer, len, pos, AppID );
sq_readbyte (buffer, len, pos, query_data[index][QD_PLAYERS_NUM]);
sq_readbyte (buffer, len, pos, query_data[index][QD_PLAYERS_MAX]);
}
case 0x6D: {
sq_readstring(buffer, len, pos, tmp_IP, charsmax(tmp_IP));
sq_readstring(buffer, len, pos, query_data[index][QD_HOSTNAME], charsmax(query_data[][QD_HOSTNAME]));
sq_readstring(buffer, len, pos, query_data[index][QD_MAPNAME], charsmax(query_data[][QD_MAPNAME]));
sq_readstring(buffer, len, pos, tmp_GameDir, charsmax(tmp_GameDir));
sq_readstring(buffer, len, pos, tmp_GameDesc, charsmax(tmp_GameDesc));
sq_readbyte (buffer, len, pos, query_data[index][QD_PLAYERS_NUM]);
sq_readbyte (buffer, len, pos, query_data[index][QD_PLAYERS_MAX]);
}
}
goto socket_close_label;
}
}
}
else {
goto socket_close_label;
}
}
else {
query_data[index][QD_PLAYERS_NUM] = query_data[index][QD_PLAYERS_MAX] = 0;
}
if (query_data[index][QD_RESPONSE_ATTEMPTS] == MAX_RESPONSE_ATTEMPTS) {
socket_close_label:
socket_close(socket_handle);
remove_task(taskid);
}
}
stock sq_readint(buffer[BUFFER_SIZE], const buffer_len, &pos, bytes, &result, bool: check_neg = true)
{
result = 0;
if ((pos + bytes - 1) < buffer_len) {
new bool: bNegative = (check_neg && buffer[pos + bytes - 1] < 0 );
new temp_var;
for (new i; i < bytes; i++) {
result = buffer[pos++];
sq_fixedunsigned8(result)
if (bNegative) {
result = 0xFF - result;
}
temp_var += (result << (8 * i));
}
if (bNegative) {
temp_var = (temp_var + 1 ) * -1;
}
result = temp_var;
}
else {
pos += bytes;
}
}
stock sq_readstring(buffer[BUFFER_SIZE], const buffer_len, &pos, output[], const output_len)
{
new len;
while (pos < buffer_len && buffer[pos]) {
if (len < output_len) {
output[len++] = buffer[pos++];
}
}
output[len] = 0;
pos++;
}
Приветствую форумчан...