Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

> Важная информация

Перед тем как создать тему или задать вопрос, ознакомьтесь с данной темой, там собраны наиболее распространенные уязвимости и способы устранения.
Так же не поленитесь воспользоваться поиском, вполне возможно, что ваш вопрос уже поднимался на форуме.
При создании новой темы уделите внимание ее названию, оно должно кратко описывать суть вашего вопроса/проблемы. Все вновь созданные темы с названиями "Помогите", "Объясните", "Подскажите" и т.д. будут удалены, а их авторы наказаны.
413 страниц V  « 124 125 126 ... 411 412 »

Защита Counter Strike Сервера

, Методы защиты от различных уязвимостей игровых серверов
Статус пользователя TarikYuzkiv
сообщение 10.8.2014, 23:37
Сообщение #2481
Стаж: 13 лет

Сообщений: 509
Благодарностей: 196
Полезность: 635

Цитата([WPMG]PRoSToTeM@ @ 11.8.2014, 1:36) *

А нафига весь ник менять?

Вот и я об этом думаю. Лучше ведь просто replace "#" ""...)

Отредактировал: TarikYuzkiv, - 10.8.2014, 23:38
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vlad
сообщение 10.8.2014, 23:50
Сообщение #2482


Стаж: 14 лет

Сообщений: 246
Благодарностей: 102
Полезность: 505

Стоит коло чат, решеткой можуно уписаться просто, но вылетов нету, есть вылет клиента ток когда пишешь в чат выше указанное сообщение с решеткой и то как я заметил(может ошибаюсь) но только у того кто пишет.
А ники с решеткой у меня замечательно играют, разве что если решетка первый символ в нике, то тогда не отображает на севрере почему-то первый символ(решетку)
Опасное сообщение засунул в игнор лист, а в остальном меня проблема не задела кажись)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 1:02
Сообщение #2483
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

Vladddd, сделай такой ник "q #Game_radio" и глянь как будет в менюшке выглядеть.

А опасных сообщений так-то куча.

Отредактировал: [WPMG]PRoSToTeM@, - 11.8.2014, 1:00
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя vladboss
сообщение 11.8.2014, 1:08
Сообщение #2484


Стаж: 15 лет

Сообщений: 312
Благодарностей: 87
Полезность: 236

Может дополнить этот плагин(кликабельно)? Кроме +, будет так-же и # вырезать, м?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TarikYuzkiv
сообщение 11.8.2014, 1:43
Сообщение #2485
Стаж: 13 лет

Сообщений: 509
Благодарностей: 196
Полезность: 635

Цитата(vladboss @ 11.8.2014, 3:08) *
Может дополнить этот плагин(кликабельно)? Кроме +, будет так-же и # вырезать, м?

Так и сделал...)

Добавьте "replace_all(szName, charsmax(szName), "#", "")" перед "set_user_info(id, "name", szName);" и перекомпилируйте плагин.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя vladboss
сообщение 11.8.2014, 2:26
Сообщение #2486


Стаж: 15 лет

Сообщений: 312
Благодарностей: 87
Полезность: 236

Цитата(TarikYuzkiv @ 11.8.2014, 1:43) *
Так и сделал...)

Добавьте "replace_all(szName, charsmax(szName), "#", "")" перед "set_user_info(id, "name", szName);" и перекомпилируйте плагин.



Если не ошибаюсь, то еще тут нужно изменит:

Код
g_iPattern = regex_compile("\+[abcdfghijlmnprstuv]", iError, szError, charsmax(szError), "i");


а тут массив увеличить:

Код
new szNewTxtPart[3];


или все-же ошибаюсь?

Отредактировал: vladboss, - 11.8.2014, 2:26
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TarikYuzkiv
сообщение 11.8.2014, 2:43
Сообщение #2487
Стаж: 13 лет

Сообщений: 509
Благодарностей: 196
Полезность: 635

vladboss, ошибаетесь.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 5:05
Сообщение #2488
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

В amxmodx до сих пор баг с % в админ чате не пофиксили?
Короче есть идея как решить это "частично глобально", например, с client_print (сразу решение проблемы для % и #). (надо будет редачить amxmodx)

Отредактировал: [WPMG]PRoSToTeM@, - 11.8.2014, 5:09
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
XyLiGaN
сообщение 11.8.2014, 5:11
Сообщение #2489
Стаж: 13 лет
Город: Югорск

Сообщений: 11668
Благодарностей: 6450
Полезность: 1052

Меценат Меценат

[WPMG]PRoSToTeM@,
Залилишь? :-)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 5:24
Сообщение #2490
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

XyLiGaN, как проснусь.

Насчёт ников попробуйте такой вариантец, затестите его на рекурсии (тестил немного, чёт голова хреново соображает):
Код:
#include <amxmodx>
#include <fakemeta>

#pragma ctrlchar '\'

public plugin_init() {
register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged_Pre", false);
}

public ClientUserInfoChanged_Pre(const iClient, const pszInfoBuffer) {
new szNetName[32];
pev(iClient, pev_netname, szNetName, charsmax(szNetName));

new szBufferName[32];
engfunc(EngFunc_InfoKeyValue, pszInfoBuffer, "name", szBufferName, charsmax(szBufferName));

if (szNetName[0] != '\0' && equal(szNetName, szBufferName)) {
return FMRES_IGNORED;
}

new bool:fChanged;

for (new i = 0; szBufferName[i] != '\0'; i++) {
if (szBufferName[i] == '#' || szBufferName[i] == '+') {
szBufferName[i] = ' ';

fChanged = true;
}
}

if (fChanged) {
engfunc(EngFunc_SetClientKeyValue, iClient, pszInfoBuffer, "name", szBufferName);
}

return FMRES_IGNORED;
}


Отредактировал: [WPMG]PRoSToTeM@, - 11.8.2014, 5:53
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
serfreeman1337
сообщение 11.8.2014, 6:09
Сообщение #2491
Стаж: 13 лет

Сообщений: 912
Благодарности: выкл.

Цитата([WPMG]PRoSToTeM@ @ 11.8.2014, 8:05) *

В amxmodx до сих пор баг с % в админ чате не пофиксили?
Короче есть идея как решить это "частично глобально", например, с client_print (сразу решение проблемы для % и #). (надо будет редачить amxmodx)


VALVe пофиксили это на стороне клиента. Было это еще в сентябре 2013 года.
Цитата(Arkshine)
Got an answer from Alfred:

> "Yup, can do, watch for the next CS beta update."

В бета контре не падает, но в HL и других модах..
Прикрепленное изображение
sad.gif

Интересно что AMX Mod X Dev Team предлагают следующее:
Цитата(Arkshine)
- This exploit can't be used with the default AMXX plugin as it uses client_print() which sends TextMsg. If it crashes on a server, it means admin is using a modified version of adminchat plugin.
- The newly added client_print_color native uses SayText, but considering it's not used in base plugins, there is nothing to fix there. Though adding some words about this client issue in the documentation should be considered, so coder will prevent any problem by replacing "%s" to " s" before sending the message. (Adding a note on the wiki at SayText would be welcomed too)


Костыль :D
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 6:23
Сообщение #2492
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

serfreeman1337, щас затестил в контре, в админ чат написал %s0 - вылетело.

Отредактировал: [WPMG]PRoSToTeM@, - 11.8.2014, 6:24
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 6:37
Сообщение #2493
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

Цитата(serfreeman1337 @ 11.8.2014, 8:09) *
Костыль :D

Ну у меня вариант такой:
Перепилить хотя бы client_print так:
Код:
	char c = msg[190];
msg[190] = 0; // truncate without checking with strlen()

if (pEntity)
MESSAGE_BEGIN(MSG_ONE, gmsgTextMsg, NULL, pEntity);
else
MESSAGE_BEGIN(MSG_BROADCAST, gmsgTextMsg);

WRITE_BYTE(msg_dest);
WRITE_STRING(msg);
MESSAGE_END();
msg[190] = c;

-> (недопилен код для #)
Код:
	char c = msg[187];
msg[187] = 0; // truncate without checking with strlen()

if (pEntity)
MESSAGE_BEGIN(MSG_ONE, gmsgTextMsg, NULL, pEntity);
else
MESSAGE_BEGIN(MSG_BROADCAST, gmsgTextMsg);

WRITE_BYTE(msg_dest);
WRITE_STRING("%s");
WRITE_STRING(msg);
MESSAGE_END();
msg[187] = c;
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
serfreeman1337
сообщение 11.8.2014, 6:45
Сообщение #2494
Стаж: 13 лет

Сообщений: 912
Благодарности: выкл.

Цитата([WPMG]PRoSToTeM@ @ 11.8.2014, 9:23) *
serfreeman1337, щас затестил в контре, в админ чат написал %s0 - вылетело.


Прикрепленное изображение

test
L 08/11/2014 - 09:39:51: <adminchat.amxx> Chat: "serfreeman1337<1><STEAM_ID_LAN><>" chat " %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0 %s0"

> amxx version
AMX Mod X 1.8.3-dev+b2dd266 (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
Compiled: Aug 4 2014, 12:50:44
Build ID: 4156:b2dd2661d081e137f58f327e512e9dca95e4ef8c
Core mode: JIT+ASM32

> version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:14:12 Aug 29 2013 (6153)


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 11.8.2014, 6:53
Сообщение #2495
Стаж: 14 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

serfreeman1337, say_team @%s0 от такого у меня сразу вылет:
Сервер
Скрытый текст

] amxx version
AMX Mod X 1.8.3-dev+1768324 (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
Compiled: Aug 9 2014, 06:33:37
Build ID: 4251:17683249fd5f8f1951f62d136558acd2225d916b
Core mode: JIT+ASM32
] version
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 13:13:29 Aug 29 2013 (6153)

Клиент:
Скрытый текст
] version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:14:12 Aug 29 2013 (6153)


Скинь hw.dll, client.dll, vgui2.dll в ЛС
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
XyLiGaN
сообщение 11.8.2014, 7:57
Сообщение #2496
Стаж: 13 лет
Город: Югорск

Сообщений: 11668
Благодарностей: 6450
Полезность: 1052

Меценат Меценат

[WPMG]PRoSToTeM@,
А почему нельзя просто пофиксить в чате # как и с % тоже самое?! Типо добавить так replace_all(message,191,"#"," ") или не катит?
У сафатыча в плагинах есть фикшенный adminchat, его можно же допилить чтоб и с # была заглушка. Вот сам код.
Код:
/**
* Modified by crash94 & Safety1st
* 11/27/2013
*
* Changes:
* - automatically 'detransliterates' russian text
* - added fix against using parameterized message
*/

/* AMX Mod X
* Admin Chat Plugin
*
* by the AMX Mod X Development Team
* originally developed by OLO
*
* This file is part of AMX Mod X.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/

#include <amxmodx>
#include <amxmisc>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;

new message[128] // temporary holds message text between functions

public plugin_init()
{
new admin_chat_id

register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("adminchat.txt")
register_dictionary("common.txt")
register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")

amx_show_activity = get_cvar_pointer("amx_show_activity");

if (amx_show_activity == 0)
{
amx_show_activity = register_cvar("amx_show_activity", "2");
}

new str[1]
get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}

public cmdSayChat(id)
{
if (!access(id, g_AdminChatFlag))
{
return PLUGIN_CONTINUE
}

new said[6], i = 0
read_argv(1, said, 5)

while (said[i] == '@')
{
i++
}

if (!i || i > 3)
{
return PLUGIN_CONTINUE
}

new a = 0
read_args(message, 191)
remove_quotes(message)

switch (said[i])
{
case 'r': a = 1
case 'g': a = 2
case 'b': a = 3
case 'y': a = 4
case 'm': a = 5
case 'c': a = 6
case 'o': a = 7
}

new n, s = i
if (a)
{
n++
s++
}
while (said[s] && isspace(said[s]))
{
n++
s++
}

DeTranslitEnRu(i + n)

new name[32], authid[32], userid

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])

if (++g_msgChannel > 6 || g_msgChannel < 3)
{
g_msgChannel = 3
}

new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0

set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[i + n])
client_print(pl, print_notify, "%s : %s", name, message[i + n])
}
else
{
show_hudmessage(pl, "%s", message[i + n])
client_print(pl, print_notify, "%s", message[i + n])
}
}
}
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[i + n])
client_print(0, print_notify, "%s : %s", name, message[i + n])
}
default:
{
show_hudmessage(0, "%s", message[i + n])
client_print(0, print_notify, "%s", message[i + n])
}
}

return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
new said[2]
read_argv(1, said, 1)

if (said[0] != '@')
return PLUGIN_CONTINUE

new name[32], authid[32], userid
new players[32], inum

read_args(message, 191)
remove_quotes(message)
replace_all(message,191,"%"," ") // fix against using parameterized message

DeTranslitEnRu(1)

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])

if (is_user_admin(id))
format(message, 191, "(%L) %s : %s", id, "ADMIN", name, message[1])
else
format(message, 191, "(%L) %s : %s", id, "PLAYER", name, message[1])

get_players(players, inum)

for (new i = 0; i < inum; ++i)
{
// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
client_print(players[i], print_chat, "%s", message)
}

client_print(id, print_chat, "%s", message)

return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new message[192], name[32], players[32], inum, authid[32], userid

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
get_players(players, inum)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)

format(message, 191, "(ADMINS) %s : %s", name, message)
console_print(id, "%s", message)

for (new i = 0; i < inum; ++i)
{
if (access(players[i], g_AdminChatFlag))
client_print(players[i], print_chat, "%s", message)
}

return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new name[32], authid[32], userid

read_args(message, 191)
remove_quotes(message)
DeTranslitEnRu()

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
client_print(0, print_chat, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)

log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)

return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new name[32]
read_argv(1, name, 31)
new priv = cmd_target(id, name, 0)

if (!priv)
return PLUGIN_HANDLED

new length = strlen(name) + 1

get_user_name(priv, name, 31);

new name2[32], authid[32], authid2[32], userid, userid2

get_user_authid(id, authid, 31)
get_user_name(id, name2, 31)
userid = get_user_userid(id)
read_args(message, 191)

if (message[0] == '"' && message[length] == '"') // HLSW fix
{
message[0] = ' '
message[length] = ' '
length += 2
}

remove_quotes(message[length])
DeTranslitEnRu(length)
get_user_name(priv, name, 31)

if (id && id != priv)
client_print(id, print_chat, "(%s) %s : %s", name, name2, message[length])

client_print(priv, print_chat, "(%s) %s : %s", name, name2, message[length])
console_print(id, "(%s) %s : %s", name, name2, message[length])
get_user_authid(priv, authid2, 31)
userid2 = get_user_userid(priv)

log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])

return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new cmd[16], color[16], color2[16], name[32], authid[32], userid = 0

read_argv(0, cmd, 15)
new bool:tsay = (tolower(cmd[4]) == 't')

read_args(message, 191)
remove_quotes(message)
parse(message, color, 15)

new found = 0, a = 0
new lang[3], langnum = get_langsnum()

for (new i = 0; i < MAX_CLR; ++i)
{
for (new j = 0; j < langnum; j++)
{
get_lang(j, lang)
format(color2, 15, "%L", lang, g_Colors[i])

if (equali(color, color2))
{
a = i
found = 1
break
}
}
if (found == 1)
break
}

new length = found ? (strlen(color) + 1) : 0

DeTranslitEnRu(length)

if (++g_msgChannel > 6 || g_msgChannel < 3)
g_msgChannel = 3

new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[length])
client_print(pl, print_notify, "%s : %s", name, message[length])
}
else
{
show_hudmessage(pl, "%s", message[length])
client_print(pl, print_notify, "%s", message[length])
}
}
}
console_print(id, "%s : %s", name, message[length])
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[length])
client_print(0, print_notify, "%s : %s", name, message[length])
console_print(id, "%s : %s", name, message[length])
}
default:
{
show_hudmessage(0, "%s", message[length])
client_print(0, print_notify, "%s", message[length])
console_print(id, "%s", message[length])
}
}

log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

return PLUGIN_HANDLED
}

DeTranslitEnRu( pos = 0 /* pos is needed to avoid converting of color codes */ ) {
while (replace(message[pos], 127, "q", "й")) {}
while (replace(message[pos], 127, "w", "ц")) {}
while (replace(message[pos], 127, "e", "у")) {}
while (replace(message[pos], 127, "r", "к")) {}
while (replace(message[pos], 127, "t", "е")) {}
while (replace(message[pos], 127, "y", "н")) {}
while (replace(message[pos], 127, "u", "г")) {}
while (replace(message[pos], 127, "i", "ш")) {}
while (replace(message[pos], 127, "o", "щ")) {}
while (replace(message[pos], 127, "p", "з")) {}
while (replace(message[pos], 127, "[", "х")) {}
while (replace(message[pos], 127, "]", "ъ")) {}
while (replace(message[pos], 127, "a", "ф")) {}
while (replace(message[pos], 127, "s", "ы")) {}
while (replace(message[pos], 127, "d", "в")) {}
while (replace(message[pos], 127, "f", "а")) {}
while (replace(message[pos], 127, "g", "п")) {}
while (replace(message[pos], 127, "h", "р")) {}
while (replace(message[pos], 127, "j", "о")) {}
while (replace(message[pos], 127, "k", "л")) {}
while (replace(message[pos], 127, "l", "д")) {}
//while (replace(message[pos], 127, ";", "ж")) {} // it will not work after all because server receives symbol ',' in all cases
while (replace(message[pos], 127, "'", "э")) {}
while (replace(message[pos], 127, "z", "я")) {}
while (replace(message[pos], 127, "x", "ч")) {}
while (replace(message[pos], 127, "c", "с")) {}
while (replace(message[pos], 127, "v", "м")) {}
while (replace(message[pos], 127, "b", "и")) {}
while (replace(message[pos], 127, "n", "т")) {}
while (replace(message[pos], 127, "m", "ь")) {}
while (replace(message[pos], 127, ",", "б")) {}
while (replace(message[pos], 127, ".", "ю")) {}
while (replace(message[pos], 127, "Q", "Й")) {}
while (replace(message[pos], 127, "W", "Ц")) {}
while (replace(message[pos], 127, "E", "У")) {}
while (replace(message[pos], 127, "R", "К")) {}
while (replace(message[pos], 127, "T", "Е")) {}
while (replace(message[pos], 127, "Y", "Н")) {}
while (replace(message[pos], 127, "U", "Г")) {}
while (replace(message[pos], 127, "I", "Ш")) {}
while (replace(message[pos], 127, "{", "Х")) {}
while (replace(message[pos], 127, "}", "Ъ")) {}
while (replace(message[pos], 127, "A", "Ф")) {}
while (replace(message[pos], 127, "S", "Ы")) {}
while (replace(message[pos], 127, "D", "В")) {}
while (replace(message[pos], 127, "F", "А")) {}
while (replace(message[pos], 127, "G", "П")) {}
while (replace(message[pos], 127, "H", "Р")) {}
while (replace(message[pos], 127, "J", "О")) {}
while (replace(message[pos], 127, "K", "Л")) {}
while (replace(message[pos], 127, "L", "Д")) {}
while (replace(message[pos], 127, ":", "Ж")) {}
while (replace(message[pos], 127, "Z", "Я")) {}
while (replace(message[pos], 127, "X", "Ч")) {}
while (replace(message[pos], 127, "C", "С")) {}
while (replace(message[pos], 127, "V", "М")) {}
while (replace(message[pos], 127, "B", "И")) {}
while (replace(message[pos], 127, "N", "Т")) {}
while (replace(message[pos], 127, "M", "Ь")) {}
while (replace(message[pos], 127, "<", "Б")) {}
while (replace(message[pos], 127, ">", "Ю")) {}
while (replace(message[pos], 127, "~", "Ё")) {}
while (replace(message[pos], 127, "`", "ё")) {}
while (replace(message[pos], 127, "^"", "Э")) {} // comment to avoid converting " in console commands
}

А на счёт ника такой есть вариант, тоже самое что и с +, убирать # в начале ника. Вот это добавить replace(szNewTxtPart, 2, "#", ""); или тоже не катит?!
Вот код.
Код:
#include <amxmodx>
#include <regex>

new Regex:g_iPattern;

public plugin_init()
{
register_plugin("Plus in nick fix", "0.2", "Flash");

new szError[64], iError;

g_iPattern = regex_compile("\+[abcdfghijlmnprstuv]", iError, szError, charsmax(szError), "i");

if(iError < 0)
{
set_fail_state(szError);
}
}

public client_infochanged(id)
{
new szNewName[32], szOldName[32];

get_user_info(id, "name", szNewName, 31);
get_user_name(id, szOldName, 31);

if(!equal(szNewName, szOldName))
{
Check(id, szNewName);
}
}

Check(id, szNewName[] = "")
{
new szName[32];

if(szNewName[0])
{
copy(szName, 31, szNewName);
}
else
{
get_user_name(id, szName, 31);
}

new iNum;
new szSubStr[3];
new szNewTxtPart[3];

while(regex_match_c(szName, g_iPattern, iNum))
{
regex_substr(g_iPattern, 0, szSubStr, 2);
copy(szNewTxtPart, 2, szSubStr);
replace(szNewTxtPart, 2, "+", "");
replace_all(szName, 31, szSubStr, szNewTxtPart);
}

set_user_info(id, "name", szName);
}
И стоит ли заменить это
regex_compile("\+[abcdfghijlmnprstuv]"
На это ?
regex_compile("\+[abcdefghijklmnopqrstuvwxyz]"
Либо на что-то другое?! Или оставить так как есть?

ps.gif Код у плагинов стандартный, не изменённый.
ps.gif К чему я это всё... То что не нужно ставить ещё 1 плагин, а лишь пофиксить то, что имеется.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя shaid
сообщение 11.8.2014, 8:27
Сообщение #2497


Стаж: 14 лет

Сообщений: 1012
Благодарностей: 432
Полезность: 835

второй плагин прекрасно работает в таком виде:
nickfix.sma
Код:
#include <amxmodx>
#include <regex>

new Regex:g_iPattern;

public plugin_init()
{
register_plugin("Plus in nick fix", "0.2", "Flash");

new szError[64], iError;

g_iPattern = regex_compile("\+[abcdfghijlmnprstuv]", iError, szError, charsmax(szError), "i");

if(iError < 0)
{
set_fail_state(szError);
}
}

public client_infochanged(id)
{
new szNewName[32], szOldName[32];

get_user_info(id, "name", szNewName, 31);
get_user_name(id, szOldName, 31);

if(!equal(szNewName, szOldName))
{
Check(id, szNewName);
}
}

Check(id, szNewName[] = "")
{
new szName[32];

if(szNewName[0])
{
copy(szName, 31, szNewName);
}
else
{
get_user_name(id, szName, 31);
}

new iNum;
new szSubStr[3];
new szNewTxtPart[3];

while(regex_match_c(szName, g_iPattern, iNum))
{
regex_substr(g_iPattern, 0, szSubStr, 2);
copy(szNewTxtPart, 2, szSubStr);
replace(szNewTxtPart, 2, "+", "");
replace_all(szName, 31, szSubStr, szNewTxtPart);
}
replace_all(szName, charsmax(szName), "#", "")
set_user_info(id, "name", szName);
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Leks64rs
сообщение 11.8.2014, 8:43
Сообщение #2498
Стаж: 11 лет

Сообщений: 174
Благодарностей: 80
Полезность: 187

зашел с ником +z тоже забанить не могут, так что думаю нужно
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vlad
сообщение 11.8.2014, 9:02
Сообщение #2499


Стаж: 14 лет

Сообщений: 246
Благодарностей: 102
Полезность: 505

Цитата([WPMG]PRoSToTeM@ @ 11.8.2014, 4:02) *

Vladddd, сделай такой ник "q #Game_radio" и глянь как будет в менюшке выглядеть.

А опасных сообщений так-то куча.

да я наверно просто везунчик, поставил этот ник, зашел на сервер , ник полностью показывает, все нормально, зашел в меню бана и кика, там показывает q %s (РАДИО) %s
Вылетов нету, чем ник опасен так и не понял.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Andrew5277
сообщение 11.8.2014, 11:59
Сообщение #2500
Стаж: 11 лет

Сообщений: 10
Благодарностей: 1
Полезность: 0

Ребят, а как исправить это, когда отправляешь через say_team @ ??

Отредактировал: Andrew5277, - 11.8.2014, 12:02
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
413 страниц V  « 124 125 126 ... 411 412 »
 
Ответить в данную темуНачать новую тему
 
0 пользователей и 3 гостей читают эту тему: