AD Manager

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
27
Реакции
-1
Помог
1 раз(а)
Ошибка
дебаг логи
L 09/17/2018 - 19:26:51: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20180917.log")
L 09/17/2018 - 19:26:51: replace() buffer not big enough (118>=114)
L 09/17/2018 - 19:26:51: [AMXX] Displaying debug trace (plugin "ad_manager.amxx", version "1.0")
L 09/17/2018 - 19:26:51: [AMXX] Run time error 10: native error (native "replace")
L 09/17/2018 - 19:26:51: [AMXX] [0] 8306d9bf8e091bfd4537072b009fdd53.sma::replace_all_tags (line 188)
L 09/17/2018 - 19:26:51: [AMXX] [1] 8306d9bf8e091bfd4537072b009fdd53.sma::Print_Color_Msg (line 172)
L 09/17/2018 - 19:26:51: [AMXX] [2] 8306d9bf8e091bfd4537072b009fdd53.sma::ShowAutoMSG (line 150)
L 09/17/2018 - 19:26:51: replace() buffer not big enough (122>=114)
L 09/17/2018 - 19:26:51: [AMXX] Displaying debug trace (plugin "ad_manager.amxx", version "1.0")
L 09/17/2018 - 19:26:51: [AMXX] Run time error 10: native error (native "replace")
L 09/17/2018 - 19:26:51: [AMXX] [0] 8306d9bf8e091bfd4537072b009fdd53.sma::replace_all_tags (line 188)
L 09/17/2018 - 19:26:51: [AMXX] [1] 8306d9bf8e091bfd4537072b009fdd53.sma::Print_Color_Msg (line 172)
L 09/17/2018 - 19:26:51: [AMXX] [2] 8306d9bf8e091bfd4537072b009fdd53.sma::ShowAutoMSG (line 150)
ОС
Linux
Amx Mod X
AMX Mod X 1.8.3-Re (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert

Authors (ReHLDS Team):
"Adidasman", "s1lent"
Compiled: Dec 24 2016 15:59:38
Build ID: 7
Core mode: JIT + ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.660-dev
Build date: 11:04:47 Sep 3 2018 (1605)
Build from: https://github.com/dreamstalker/rehlds/commit/469908f
ReGamedll
ReGameDLL version: 5.7.0.312-dev
Build date: 07:53:34 May 31 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/26db32e
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
Список загруженых плагинов:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 7] SQLite RUN - sqlite_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 8] Fun RUN - fun_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[11] GeoIP RUN - geoip_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[12] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[13] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[15] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[16] ReAPI RUN - reapi_amxx_i386.so v5.6.0.157-dev pl1 ANY Never
[17] VTC AMXX API RUN - VtcApi_amxx_i386.so v2017 RC pl1 ANY ANY
[18] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl1 ANY ANY
[19] C4 Control RUN - c4_control_amxx_i386.so v1.0.2 pl1 ANY ANY
19 plugins, 19 работает
Список плагинов
Список загруженых плагинов:
name version author file status
[ 1] Admin Loader 3.5 neygomon admin_loader_3. работает
[ 2] AMXBans: Core Gm 1.6 Larte Team amxbans_core.am работает
[ 3] AMXBans: Main Gm 1.6 Larte Team amxbans_main.am работает
[ 4] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx работает
[ 5] Admin Help 1.8.3-Re AMXX Dev Team adminhelp.amxx работает
[ 6] Slots Reservation 1.8.3-Re AMXX Dev Team adminslots.amxx работает
[ 7] Multi-Lingual System 1.8.3-Re AMXX Dev Team multilingual.am работает
[ 8] Menus Front-End 1.8.3-Re AMXX Dev Team menufront.amxx работает
[ 9] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx работает
[ 10] New Kick Menu 1.4.2 Radius newkickmenu.amx работает
[ 11] Players Menu 1.8.3-Re AMXX Dev Team plmenu.amxx работает
[ 12] Teleport Menu 1.8.3-Re AMXX Dev Team telemenu.amxx работает
[ 13] Maps Menu 1.8.3-Re AMXX Dev Team mapsmenu.amxx работает
[ 14] Lite MapChooser 2.6 neygomon lite_mapchooser работает
[ 15] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx работает
[ 16] Anti Flood 1.8.3-Re AMXX Dev Team antiflood.amxx работает
[ 17] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx работает
[ 18] Scrolling Message 1.8.3-Re AMXX Dev Team scrollmsg.amxx работает
[ 19] Info. Messages 1.8.3-Re AMXX Dev Team imessage.amxx работает
[ 20] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx работает
[ 21] Pause Plugins 1.8.3-Re AMXX Dev Team pausecfg.amxx работает
[ 22] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx работает
[ 23] CSX Easy Stats 1.5 neugomon csx_easy_stats. работает
[ 24] Parachute 15.01.06 KRoT@L/JTP10181 parachute_rbs.a работает
[ 25] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx работает
[ 26] Example AWPoff API 1.0 PAffAEJIkA :3 example_t.amxx работает
[ 27] [ReAPI] Random Weapons 2.4.6 neugomon random_weapons_ работает
[ 28] Items Restrict 1.0 s1lent items_restrict. работает
[ 29] High Ping Kicker 1.0 Shadow/Bo0m! hpk.amxx работает
[ 30] AFK Control 1.4.1 [Rnd neygomon afk_control.amx работает
[ 31] Join/Leave Message 1.2 BigBaller join_leave.amxx работает
[ 32] ReAPI Test 1.0 s1lent reapi_test.amxx работает
[ 33] Auto recording demo 2.0 IzI | Bonaqua (R amx_autodemorec работает
[ 34] Night Mode 1.2.3 Radius night_mode.amxx работает
[ 35] No Players Map 1.03 neygomon no_players_map. остановлен
[ 36] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a работает
[ 37] Damager Advanced 1.1.2 Radius (based on damager_advance работает
[ 38] Admin Spectator ESP 1.3 KoST admin_esp.amxx работает
[ 39] AD Manager 1.0 Nesquik ad_manager.amxx debug
[ 40] Weapon Restrict 1.7 s1lent weapon_rest.amx работает
[ 41] Weapon Menu 0.1 Subb98 weaponmenu_cl.a работает
[ 42] Gag Me 2.3.4 Radius gag_me.amxx работает
[ 43] C4 Control 1.3.2 Radius c4_control.amxx работает
[ 44] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc работает
[ 45] GameName Changer 1.0 neugomon gamename_change работает
[ 46] Name Users 1.0 Seroff name.amxx работает
[ 47] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx работает
[ 48] Block grande info 1.0 neygomon BlockGrenadeInf работает
[ 49] HackDetector 0.15.lite Lev @ AGHL.RU De hackdetector.am работает
[ 50] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a работает
[ 51] Lite Translit Beta 21 neygomon lite_translit_1 работает
[ 52] Mode 2x2 2.5re s1lent mode.amxx работает
[ 53] Auto Team Balance Adva 1.5.1 Radius auto_team_balan работает
[ 54] [ReAPI] VIP System 1.3.1 pUzzlik re_vip_system.a работает
[ 55] unknown unknown unknown adminfreelook.a работает
[ 56] Telegram Messages 1.0 cshost.com.ua telegramMessage работает
[ 57] Admin_Check 0.1 p1Mp / S1n[L]Ss ADMIN_CHECK_V0. работает
[ 58] Admin Player Name 1.5 Sutar admin_player_na работает
[ 59] AMXBans: Freeze Gm 1.6 Larte Team amxbans_freeze. работает
[ 60] AMXBans: Flagged Gm 1.6 Larte Team amxbans_flagged работает
60 plugins, 59 работает
Автор плагина
Nesquik
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <amxmisc>

#define TASK_ID 515123

enum _: msg_cmd_enum
{
cmd_com[32],
cmd_msg[192]
}

new Array:MessageCMD, Array:MessageAuto;
new message_cmd_load, msg_cmd[msg_cmd_enum], message_auto_load;
new cur_auto_msg_id, cur_auto_msg[192];
new pcvar_auto_type, pcvar_auto_random;

public plugin_init( )
{
register_plugin("AD Manager", "1.0", "Nesquik");

pcvar_auto_type = register_cvar("ad_manager_auto_type", "0"); // 0 - показывать всем, 1 - показывать только мертвым, 2 - показывать только живым
pcvar_auto_random = register_cvar("ad_manager_auto_random", "0"); // 0 - сообщения идут по порядку, 1 - сообщения выбираются случайным образом
}

public plugin_cfg( )
{
new filename[96];

get_configsdir(filename, charsmax(filename));
add(filename, charsmax(filename), "/ad_manager.ini");

if (!file_exists(filename)) set_fail_state("ad_manager file not found");

MessageCMD = ArrayCreate(msg_cmd_enum);
MessageAuto = ArrayCreate(192, 1);

new text[256];
new hostname[64], contact[64], maxplayers[32], mapname[32], server_ip[25];
new file = fopen(filename, "rt");

if (!file) set_fail_state("ad_manager open error!");

get_cvar_string("hostname", hostname, charsmax(hostname));
get_mapname(mapname, charsmax(mapname));
formatex(maxplayers, charsmax(maxplayers), "%d", get_maxplayers());
get_user_ip(0, server_ip, charsmax(server_ip));
if (cvar_exists("sv_contact")) get_cvar_string("sv_contact", contact, charsmax(contact));

while(!feof(file))
{
fgets(file, text, charsmax(text));
trim(text);

if (text[0] == ';' || !text[0]) continue;
if (text[0] == '@')
{
strtok(text[1], msg_cmd[cmd_com], charsmax(msg_cmd[cmd_com]), msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), ' ');

trim(msg_cmd[cmd_com]);
trim(msg_cmd[cmd_msg]);

strtolower(msg_cmd[cmd_com]);

format(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "^1%s", msg_cmd[cmd_msg]);

while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "!g", "^4")){}
while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "!t", "^3")){}
while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "!n", "^1")){}

if (containi(msg_cmd[cmd_msg], "#hostname#") != -1) while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "#hostname#", hostname)){}
if (containi(msg_cmd[cmd_msg], "#maxplayers#") != -1) while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "#maxplayers#", maxplayers)){}
if (containi(msg_cmd[cmd_msg], "#server_ip#") != -1) while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "#server_ip#", server_ip)){}
if (containi(msg_cmd[cmd_msg], "#mapname#") != -1) while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "#mapname#", mapname)){}
if (containi(msg_cmd[cmd_msg], "#contact#") != -1) while(replace(msg_cmd[cmd_msg], charsmax(msg_cmd[cmd_msg]), "#contact#", contact)){}

ArrayPushArray(MessageCMD, msg_cmd);
}
else
{
format(text, charsmax(text), "^1%s", text);

while(replace(text, charsmax(text), "!g", "^4")){}
while(replace(text, charsmax(text), "!t", "^3")){}
while(replace(text, charsmax(text), "!n", "^1")){}

if (containi(text, "#hostname#") != -1) while(replace(text, charsmax(text), "#hostname#", hostname)){}
if (containi(text, "#maxplayers#") != -1) while(replace(text, charsmax(text), "#maxplayers#", maxplayers)){}
if (containi(text, "#server_ip#") != -1) while(replace(text, charsmax(text), "#server_ip#", server_ip)){}
if (containi(text, "#mapname#") != -1) while(replace(text, charsmax(text), "#mapname#", mapname)){}
if (containi(text, "#contact#") != -1) while(replace(text, charsmax(text), "#contact#", contact)){}

if (strlen(text) > 191) text[191] = '^0';
ArrayPushString(MessageAuto, text);
}
}

if ((message_cmd_load = ArraySize(MessageCMD)) > 0)
{
register_clcmd("say", "fwd_hook_say");
register_clcmd("say_team", "fwd_hook_say");
}

if ((message_auto_load = ArraySize(MessageAuto)) > 0)
{
cur_auto_msg_id = -1;
set_task(random_float(25.0, 45.0), "ShowAutoAD", TASK_ID, .flags = "b");
}

fclose(file);
}

public ShowAutoAD( )
{
static players[32],
count, player, i;

switch(get_pcvar_num(pcvar_auto_type))
{
case 1: get_players(players, count, "bch");
case 2: get_players(players, count, "ach");
default: get_players(players, count, "ch");
}

if (!count) return;

if (get_pcvar_num(pcvar_auto_random)) cur_auto_msg_id = random_num(0, message_auto_load - 1);
else
{
cur_auto_msg_id++;
if (cur_auto_msg_id >= message_auto_load || cur_auto_msg_id < 0) cur_auto_msg_id = 0;
}

ArrayGetString(MessageAuto, cur_auto_msg_id, cur_auto_msg, charsmax(cur_auto_msg));
for( i = 0; i < count; i++ )
{
player = players[i];

switch(player)
{
case 1..8: set_task(0.1, "ShowAutoMSG", player);
case 9..16: set_task(0.2, "ShowAutoMSG", player);
case 17..24: set_task(0.3, "ShowAutoMSG", player);
case 25..32: set_task(0.4, "ShowAutoMSG", player);
}
}
}

public ShowAutoMSG(player) Print_Color_Msg(player, cur_auto_msg);

public fwd_hook_say(id)
{
new msg[192];
read_args(msg, charsmax(msg));

remove_quotes(msg);
trim(msg);

for( new i = 0; i < message_cmd_load; i++ )
{
ArrayGetArray(MessageCMD, i, msg_cmd);
if (equal(msg, msg_cmd[cmd_com])) Print_Color_Msg(id, msg_cmd[cmd_msg]);
}
}

public Print_Color_Msg(id, msg[])
{
static cur_msg[192];
format(cur_msg, charsmax(cur_msg), msg);

replace_all_tags(id, cur_msg);

message_begin(MSG_ONE_UNRELIABLE, 76, .player = id);
write_byte(id);
write_string(cur_msg);
message_end();
}

public replace_all_tags(id, msg[])
{
static len, time; len = strlen(msg);
static string[32];

if (containi(msg, "#name#") != -1)
{
get_user_name(id, string, charsmax(string));
while(replace(msg, len, "#name#", string)){}
}

if (containi(msg, "#numplayers#") != -1)
{
format(string, charsmax(string), "%d", get_playersnum());
while(replace(msg, len, "#numplayers#", string)){}
}

if (containi(msg, "#timeleft#") != -1)
{
time = get_timeleft( );
format(string, charsmax(string), "%d:%02d", time / 60, time % 60);

while(replace(msg, len, "#timeleft#", string)){}
}
}
Ошибка возникает когда плагин прокручивает сообщения
Кто может исправить?
если я правильно понимаю надо увелиичть буфер...но как?
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу