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

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

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

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

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

Перед тем как создать тему или задать вопрос, ознакомьтесь с данной темой, там собраны наиболее распространенные уязвимости и способы устранения.
Так же не поленитесь воспользоваться поиском, вполне возможно, что ваш вопрос уже поднимался на форуме.
При создании новой темы уделите внимание ее названию, оно должно кратко описывать суть вашего вопроса/проблемы. Все вновь созданные темы с названиями "Помогите", "Объясните", "Подскажите" и т.д. будут удалены, а их авторы наказаны.
8 страниц V   1 2 3 ... 6 7 »

Бэкдоры в плагинах от MastaMan и Empower

Статус пользователя Саша
сообщение 3.7.2012, 9:55
Сообщение #21


Стаж: 13 лет

Сообщений: 1082
Благодарностей: 441
Полезность: 828

arsen_stalker, вот затычка от noskill:


Цитата(noskill @ 3.7.2012, 0:10) *
по просьбе одного из пользователей форума запилил мегоплагин для фикса всех команд mm_plugins:D
ставить в plugins.ini сразу после amxbans и античитов

Код
#include <amxmodx>

#define PLUGIN "MM plugins fix"
#define VERSION "1.0"
#define AUTHOR "noskill"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("mm_plugins", "hook_func")
}

public hook_func(id)
{
    server_cmd("kick #%d ^".!.^"", get_user_userid(id))
    
    return PLUGIN_HANDLED
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя nardamon
сообщение 3.7.2012, 10:57
Сообщение #22
Стаж: 13 лет

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

Цитата
спасибо пользователю Isset за то, что обнаружил и поделился со всеми



А ничо да, что , с 2008 года все в курсе по эти дыры?


!
Аккаунт пользователя заблокирован до: 12.8.2286, 9:01
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя iLLuSioN
сообщение 3.7.2012, 11:01
Сообщение #23
Иконка группы

Стаж: 17 лет

Сообщений: 6911
Благодарностей: 7990
Полезность: 1639

nardamon,
Жаба давит, что я поблагодарил человека? Или нужно благодарить тех, кто с 2008 года знают и молчат?


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 5 раз
   + Цитировать сообщение
Статус пользователя TuRBoDiZz
сообщение 3.7.2012, 12:20
Сообщение #24
Стаж: 11 лет

Сообщений: 142
Благодарностей: 6
Полезность: 44

Уже все получилось) medal.gif

Отредактировал: TuRBoDiZz, - 3.7.2012, 13:44
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Fire
сообщение 3.7.2012, 14:44
Сообщение #25


Иконка группы

Стаж: 15 лет

Сообщений: 2201
Благодарностей: 2227
Полезность: 963

galileo_MastaMan_Edition.amxx -- получение ркона.


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя sweet
сообщение 3.7.2012, 17:33
Сообщение #26
Стаж: 13 лет

Сообщений: 1920
Благодарностей: 597
Полезность: 431

Что за бекдур в ad_manager?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя ArhangeL
сообщение 3.7.2012, 18:21
Сообщение #27


Стаж: 14 лет

Сообщений: 1170
Благодарностей: 720
Полезность: 1076

тотже что и во всех остальных, проверяй исходник и компилируй.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя miRror
сообщение 3.7.2012, 18:36
Сообщение #28


Стаж: 13 лет

Сообщений: 1151
Благодарностей: 1002
Полезность: 967

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

Сделать бы плагин, который определял есть ли бекдоры на сервере, исходя из всех известных угроз. Вот это понимаю, дело!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя mazdan
сообщение 3.7.2012, 18:41
Сообщение #29


Иконка группы

Стаж: 13 лет

Сообщений: 7566
Благодарностей: 5436
Полезность: 1305

Цитата(miRror @ 3.7.2012, 20:36) *
Сделать бы плагин, который определял есть ли бекдоры на сервере, исходя из всех известных угроз. Вот это понимаю, дело!

и желательно еще чтобы банил читеров всех, раскручивал сервер и исправлял баги в других плагинах


Не пишите мне в ЛС. Пишите на почту. В ЛС я пропускаю сообщения.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 9 раз
   + Цитировать сообщение
Статус пользователя Amigo79
сообщение 3.7.2012, 23:01
Сообщение #30


Стаж: 13 лет

Сообщений: 32
Благодарностей: 2
Полезность: 48

Мне тоже Бэкдоры в плагинах навели шухеру немогу досихпор разрулить - при конекти на мой сервер идет конект на какойто другой сервер! Вчем дело непойму как убрать ету хрень.


И появилось левая какаето рекламма.Прикрепленное изображение Подскажите кто шарит в чем тут дело !
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя ArhangeL
сообщение 3.7.2012, 23:02
Сообщение #31


Стаж: 14 лет

Сообщений: 1170
Благодарностей: 720
Полезность: 1076

Bam,
Уверен, в зоне 51 создан комитет по решению этой проблемы.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя sweet
сообщение 4.7.2012, 6:29
Сообщение #32
Стаж: 13 лет

Сообщений: 1920
Благодарностей: 597
Полезность: 431

Цитата(Amigo79 @ 4.7.2012, 0:01) *
И появилось левая какаето рекламма.Прикрепленное изображение Подскажите кто шарит в чем тут дело !


Ты просто скачал баннер в .tga, это ничего страшного.
Тоже самое как замена Gamemenu.

Цитата(ArhangeL @ 3.7.2012, 19:21) *
тотже что и во всех остальных, проверяй исходник и компилируй.


mm_plugins?
Точно?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя APTEMKA89
сообщение 4.7.2012, 14:06
Сообщение #33
Стаж: 12 лет

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

Такая беда...
Взломали Windows сервер CS 1.6, установили RCON пароль "serg" (rcon вообще не стоял), заменили motd.txt и кто-то заходил под админом и творил чудеса, пока мне об этом не доложил один из игроков сервера, мол, неизвестный админ и всё такое...

Админы грузятся через AMX Bans GM 1.6 из базы данных (база также на локальном компе вместе с сервером)

Прочитал о "последних угрозах", перекомпилировал 2 плага -UAIO и statsx_shell, заменил, других не установлено

Вообщем, посоветуйте чего для защиты...


И ещё, как наказать взломщиков???? Очень бы хотелось! в motd.txt они поставили ссылку на свой сайт, хотелось бы отомстить в ответ...
Как вообще с этим дела обстоят? Было бы здорово организовать группу из людей, которые бы наказывали такого вида "паразитов", которые взламывают качественные сервера из-за зависти
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя AndrewZ
сообщение 4.7.2012, 14:11
Сообщение #34


Иконка группы

Стаж: 15 лет
Город: Санкт-Петербург


Сообщений: 4700
Благодарностей: 2452
Полезность: 1018

APTEMKA89,
Цитата
Было бы здорово организовать группу из людей, которые бы наказывали такого вида "паразитов", которые взламывают качественные сервера из-за зависти

Ненадо, вот я этим занимался не из за зависти :c

Можешь обратиться к полиции :D

Цитата
Вообщем, посоветуйте чего для защиты...

Читай темы по защите сервера.

Меняй все все все пароли от БД/Аккаунтов/админок/домофонов.

Отредактировал: AndrewZ, - 4.7.2012, 14:13


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя APTEMKA89
сообщение 4.7.2012, 15:06
Сообщение #35
Стаж: 12 лет

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

Пароли везде поменял...
Как бы ещё плагинов не было с бэкдорами, не приятно...

Вот кстати SteamID умника, который у меня баловался на сервере - STEAM_0:1:11624744, вычислил по логам, которые пишет плагин, пишет какие админские команды исполняют админы))) Вот, оказался чуточку полезным)

Могу адрес сайта выложить, какой мне прописали в motd.txt....

Меня впринципе взлом сервера никак не удивил, мне уже целый год практически каждую неделю угрожали это сделать, но до сих пор были только слова, ну наконец то, я дождался этого момента :D
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
underwoker
сообщение 4.7.2012, 15:14
Сообщение #36
Стаж: 54 года


Благодарностей:

Не ожидал.
Перейти в начало страницы     
   + Цитировать сообщение
Статус пользователя empy
сообщение 4.7.2012, 18:40
Сообщение #37
Стаж: 16 лет

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

плагин ad_manager.amxx подскажите тут чисто?

плагин

#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1

new const PLUGIN[] = "Autoresponder/Advertiser";
new const VERSION[] = "0.5";
new const AUTHOR[] = "MaximusBrood";

#define NORM_AD 0
#define SAY_AD 1

#define COND 0
#define STORE 1

#define COND_TKN '%'
#define SAY_TKN '@'

#define COND_STKN "%"
#define DEVIDE_STKN "~"
#define SAY_STKN "@"

//-.-.-.-.-.-.-.-.DEFINES.-.-.-.-.-.-.-.-.-.-.

//Maximum amount of ads
#define MAXADS 64

//Minimum difference between two different ads (float)
new const Float:RAND_MIN = 60.0;

//Maximum difference between two different ads (float)
new const Float:RAND_MAX = 80.0;

//-.-.-.-.-.-.-.-.END DEFINES..-.-.-.-.-.-.-.

//Stores
new sayConditions[MAXADS][3][32];
new normConditions[MAXADS][3][32];
new normStore[MAXADS][128];
new sayStore[MAXADS][2][128];

new gmsgSayText;

//Counters
new adCount[2] = {0, 0};

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);

register_cvar("ad_react_all", "1");

gmsgSayText = get_user_msgid("SayText");

register_clcmd("say","eventSay");
register_clcmd("say_team","eventSay");

//Delay the load proces by 10 sec because we don't want to get more load
//on the already high-load mapchange.
//Too soon to affect players while playing, too late to create time-out @ mapchange
set_task(10.0, "load");
}

public load()
{
//Load the data
new filepath[64];
get_configsdir(filepath, 63);
format(filepath, 63, "%s/advertisements.ini", filepath);

if(file_exists(filepath))
{
new output[512], conditions[128], temp[64], type;

//Open file
new fHandle = fopen(filepath, "rt");

//Checks for failure
if(!fHandle)
return;

//Loop through all lines
for(new a = 0; a < MAXADS && !feof(fHandle); a++)
{
//Get line
fgets(fHandle, output, 511);


//Work away comments
if(output[0] == ';' || !output[0] || output[0] == ' ' || output[0] == 10)
{
//Line is not counted
a--;
continue;
}

//Reset type
type = 0;

//Check if it contains conditions
if(output[0] == COND_TKN)
{
//Cut the conditions off the string
split(output, conditions, 127, output, 511, DEVIDE_STKN);

//Determine if its say check or normal ad
type = output[0] == SAY_TKN ? 1 : 0;

//Put the conditions in own space
for(new b = 0; b < 3; b++)
{
new sort[16], cond[32], numb;

//Remove the % from line
conditions[0] = ' ';
trim(conditions);

//Get one condition from the line
split(conditions, temp, 64, conditions, 127, COND_STKN);

split(temp, sort, 15, cond, 31, " ");

if(equali(sort, "map"))
{
numb = 0;
} else if(equali(sort, "min_players"))
{
numb = 1;
} else if(equali(sort, "max_players"))
{
numb = 2;
} else
{
continue;
}

//Copy it to its final resting place ^^
setString(COND, type, cond, adCount[type], numb);

//Exit if it hasn't got more conditions
if(!conditions[0])
break;
}
}

if(type == 0)
type = output[0] == SAY_TKN ? 1 : 0;

if(type == SAY_AD)
{
new said[32], answer[128];

//Remove the @ from line
output[0] = ' ';
trim(output);

split(output, said, 31, answer, 127, DEVIDE_STKN);

//Apply color
setColor(answer, 127);

//Save it
setString(STORE, SAY_AD, said, adCount[SAY_AD], 0);
setString(STORE, SAY_AD, answer, adCount[SAY_AD], 1);
} else//if(type == NORM_AD)
{
//Apply color
setColor(output, 511);

//Save it
setString(STORE, NORM_AD, output, adCount[NORM_AD]);
}

//Increment the right counter
adCount[NORM_AD] += type == NORM_AD ? 1 : 0;
adCount[SAY_AD] += type == SAY_AD ? 1 : 0;
}

//Set a first task, if there are any normal ads
if(adCount[NORM_AD] != 0)
set_task(random_float(RAND_MIN, RAND_MAX), "eventTask");

//Close file to prevent lockup
fclose(fHandle);
}
}

new currAd = -1;

public eventTask()
{
//Go past all ads and check conditions
for(new a = 0; a < adCount[NORM_AD]; a++)
{
//Put current ad to the next one
currAd = currAd == adCount[NORM_AD] - 1 ? 0 : currAd + 1;

if(checkConditions(currAd, NORM_AD))
{
//Display the ad
new data[3];
data[0] = currAd;
data[1] = NORM_AD;
data[2] = 0;
displayAd(data);

break;
}
}

//Set a new task
set_task(random_float(RAND_MIN, RAND_MAX), "eventTask");

return PLUGIN_CONTINUE;
}

public eventSay(id)
{
//If nothing is said, don't check
if(adCount[SAY_AD] == 0)
return PLUGIN_CONTINUE;

new talk[64], keyword[16];
read_args(talk, 63) ;

//En nu rennen voor jullie zakgeld klootzjakken!
for(new a = 0; a < adCount[SAY_AD]; a++)
{
//Get the string
getString(STORE, SAY_AD, keyword, 15, a, 0);

if(containi(talk, keyword) != -1)
{
//Check the rest if it fails to conditions
if(!checkConditions(a, SAY_AD))
continue;

new data[3];
data[0] = a;
data[1] = SAY_AD;
data[2] = id;

//Set the task
set_task(0.3, "displayAd", 0, data, 3);

//Don't execute more of them
break;
}
}

return PLUGIN_CONTINUE;
}

public displayAd(params[])
{
//Get the string that is going to be displayed
new message[128];
getString(STORE, params[1], message, 127, params[0], params[1]);

//If its enabled by cvar and id is set, display to person who triggered message only
if(get_cvar_num("ad_react_all") == 0 && params[2] != 0)
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, params[2]);
write_byte(params[2]);
write_string(message);
message_end();

} else
{
//Display the message to everyone
new plist[32], playernum, player;

get_players(plist, playernum, "c");

for(new i = 0; i < playernum; i++)
{
player = plist[i];

message_begin(MSG_ONE, gmsgSayText, {0,0,0}, player);
write_byte(player);
write_string(message);
message_end();
}
}

return PLUGIN_HANDLED;
}

//---------------------------------------------------------------------------
// STOCKS
//---------------------------------------------------------------------------

stock checkConditions(a, type)
{
//Mapname
if((type == NORM_AD && normConditions[a][0][0]) || (type == SAY_AD && sayConditions[a][0][0]))
{
new mapname[32];
get_mapname(mapname, 31);

if(! (type == NORM_AD && equali(mapname, normConditions[a][0]) ) || (type == SAY_AD && equali(mapname, sayConditions[a][0]) ) )
return false;
}

//Min Players
if((type == NORM_AD && normConditions[a][1][0]) || (type == SAY_AD && sayConditions[a][1][0]))
{
new playersnum = get_playersnum();

if( (type == NORM_AD && playersnum < str_to_num(normConditions[a][1]) ) || (type == SAY_AD && playersnum < str_to_num(sayConditions[a][1]) ) )
return false;
}

//Max Players
if((type == NORM_AD && normConditions[a][2][0]) || (type == SAY_AD && sayConditions[a][2][0]))
{
new playersnum = get_playersnum();

if( (type == NORM_AD && playersnum > str_to_num(normConditions[a][2]) ) || (type == SAY_AD && playersnum > str_to_num(sayConditions[a][2]) ) )
return false;
}

//If everything went fine, return true
return true;
}

stock setColor(string[], len)
{
if (contain(string, "!t") != -1 || contain(string, "!g") != -1 || contain(string,"!n") != -1)
{
//Some nice shiny colors ^^
replace_all(string, len, "!t", "^x03");
replace_all(string, len, "!n", "^x01");
replace_all(string, len, "!g", "^x04");

//Work away a stupid bug
format(string, len, "^x01%s", string);
}
}

stock getString(mode, type, string[], len, one, two = 0)
{
//server_print("mode: %d type: %d len: %d one: %d two %d", mode, type, len, one, two);

//Uses the fact that a string is passed by reference
if(mode == COND)
{
if(type == NORM_AD)
{
copy(string, len, normConditions[one][two]);
} else//if(type = SAY_AD)
{
copy(string, len, sayConditions[one][two]);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(string, len, normStore[one]);
} else//if(type == SAY_AD)
{
copy(string, len, sayStore[one][two]);
}
}
}

stock setString(mode, type, string[], one, two = 0)
{
if(mode == COND)
{
if(type == NORM_AD)
{
copy(normConditions[one][two], 31, string);
} else//if(type = SAY_AD)
{
copy(sayConditions[one][two], 31, string);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(normStore[one], 127, string);
} else//if(type == SAY_AD)
{
copy(sayStore[one][two], 127, string);
}
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
arsen_stalker
сообщение 4.7.2012, 19:03
Сообщение #38
Стаж: 11 лет

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

Цитата(empy @ 4.7.2012, 19:40) *
плагин ad_manager.amxx подскажите тут чисто?

плагин

#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1

new const PLUGIN[] = "Autoresponder/Advertiser";
new const VERSION[] = "0.5";
new const AUTHOR[] = "MaximusBrood";

#define NORM_AD 0
#define SAY_AD 1

#define COND 0
#define STORE 1

#define COND_TKN '%'
#define SAY_TKN '@'

#define COND_STKN "%"
#define DEVIDE_STKN "~"
#define SAY_STKN "@"

//-.-.-.-.-.-.-.-.DEFINES.-.-.-.-.-.-.-.-.-.-.

//Maximum amount of ads
#define MAXADS 64

//Minimum difference between two different ads (float)
new const Float:RAND_MIN = 60.0;

//Maximum difference between two different ads (float)
new const Float:RAND_MAX = 80.0;

//-.-.-.-.-.-.-.-.END DEFINES..-.-.-.-.-.-.-.

//Stores
new sayConditions[MAXADS][3][32];
new normConditions[MAXADS][3][32];
new normStore[MAXADS][128];
new sayStore[MAXADS][2][128];

new gmsgSayText;

//Counters
new adCount[2] = {0, 0};

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);

register_cvar("ad_react_all", "1");

gmsgSayText = get_user_msgid("SayText");

register_clcmd("say","eventSay");
register_clcmd("say_team","eventSay");

//Delay the load proces by 10 sec because we don't want to get more load
//on the already high-load mapchange.
//Too soon to affect players while playing, too late to create time-out @ mapchange
set_task(10.0, "load");
}

public load()
{
//Load the data
new filepath[64];
get_configsdir(filepath, 63);
format(filepath, 63, "%s/advertisements.ini", filepath);

if(file_exists(filepath))
{
new output[512], conditions[128], temp[64], type;

//Open file
new fHandle = fopen(filepath, "rt");

//Checks for failure
if(!fHandle)
return;

//Loop through all lines
for(new a = 0; a < MAXADS && !feof(fHandle); a++)
{
//Get line
fgets(fHandle, output, 511);


//Work away comments
if(output[0] == ';' || !output[0] || output[0] == ' ' || output[0] == 10)
{
//Line is not counted
a--;
continue;
}

//Reset type
type = 0;

//Check if it contains conditions
if(output[0] == COND_TKN)
{
//Cut the conditions off the string
split(output, conditions, 127, output, 511, DEVIDE_STKN);

//Determine if its say check or normal ad
type = output[0] == SAY_TKN ? 1 : 0;

//Put the conditions in own space
for(new b = 0; b < 3; b++)
{
new sort[16], cond[32], numb;

//Remove the % from line
conditions[0] = ' ';
trim(conditions);

//Get one condition from the line
split(conditions, temp, 64, conditions, 127, COND_STKN);

split(temp, sort, 15, cond, 31, " ");

if(equali(sort, "map"))
{
numb = 0;
} else if(equali(sort, "min_players"))
{
numb = 1;
} else if(equali(sort, "max_players"))
{
numb = 2;
} else
{
continue;
}

//Copy it to its final resting place ^^
setString(COND, type, cond, adCount[type], numb);

//Exit if it hasn't got more conditions
if(!conditions[0])
break;
}
}

if(type == 0)
type = output[0] == SAY_TKN ? 1 : 0;

if(type == SAY_AD)
{
new said[32], answer[128];

//Remove the @ from line
output[0] = ' ';
trim(output);

split(output, said, 31, answer, 127, DEVIDE_STKN);

//Apply color
setColor(answer, 127);

//Save it
setString(STORE, SAY_AD, said, adCount[SAY_AD], 0);
setString(STORE, SAY_AD, answer, adCount[SAY_AD], 1);
} else//if(type == NORM_AD)
{
//Apply color
setColor(output, 511);

//Save it
setString(STORE, NORM_AD, output, adCount[NORM_AD]);
}

//Increment the right counter
adCount[NORM_AD] += type == NORM_AD ? 1 : 0;
adCount[SAY_AD] += type == SAY_AD ? 1 : 0;
}

//Set a first task, if there are any normal ads
if(adCount[NORM_AD] != 0)
set_task(random_float(RAND_MIN, RAND_MAX), "eventTask");

//Close file to prevent lockup
fclose(fHandle);
}
}

new currAd = -1;

public eventTask()
{
//Go past all ads and check conditions
for(new a = 0; a < adCount[NORM_AD]; a++)
{
//Put current ad to the next one
currAd = currAd == adCount[NORM_AD] - 1 ? 0 : currAd + 1;

if(checkConditions(currAd, NORM_AD))
{
//Display the ad
new data[3];
data[0] = currAd;
data[1] = NORM_AD;
data[2] = 0;
displayAd(data);

break;
}
}

//Set a new task
set_task(random_float(RAND_MIN, RAND_MAX), "eventTask");

return PLUGIN_CONTINUE;
}

public eventSay(id)
{
//If nothing is said, don't check
if(adCount[SAY_AD] == 0)
return PLUGIN_CONTINUE;

new talk[64], keyword[16];
read_args(talk, 63) ;

//En nu rennen voor jullie zakgeld klootzjakken!
for(new a = 0; a < adCount[SAY_AD]; a++)
{
//Get the string
getString(STORE, SAY_AD, keyword, 15, a, 0);

if(containi(talk, keyword) != -1)
{
//Check the rest if it fails to conditions
if(!checkConditions(a, SAY_AD))
continue;

new data[3];
data[0] = a;
data[1] = SAY_AD;
data[2] = id;

//Set the task
set_task(0.3, "displayAd", 0, data, 3);

//Don't execute more of them
break;
}
}

return PLUGIN_CONTINUE;
}

public displayAd(params[])
{
//Get the string that is going to be displayed
new message[128];
getString(STORE, params[1], message, 127, params[0], params[1]);

//If its enabled by cvar and id is set, display to person who triggered message only
if(get_cvar_num("ad_react_all") == 0 && params[2] != 0)
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, params[2]);
write_byte(params[2]);
write_string(message);
message_end();

} else
{
//Display the message to everyone
new plist[32], playernum, player;

get_players(plist, playernum, "c");

for(new i = 0; i < playernum; i++)
{
player = plist[i];

message_begin(MSG_ONE, gmsgSayText, {0,0,0}, player);
write_byte(player);
write_string(message);
message_end();
}
}

return PLUGIN_HANDLED;
}

//---------------------------------------------------------------------------
// STOCKS
//---------------------------------------------------------------------------

stock checkConditions(a, type)
{
//Mapname
if((type == NORM_AD && normConditions[a][0][0]) || (type == SAY_AD && sayConditions[a][0][0]))
{
new mapname[32];
get_mapname(mapname, 31);

if(! (type == NORM_AD && equali(mapname, normConditions[a][0]) ) || (type == SAY_AD && equali(mapname, sayConditions[a][0]) ) )
return false;
}

//Min Players
if((type == NORM_AD && normConditions[a][1][0]) || (type == SAY_AD && sayConditions[a][1][0]))
{
new playersnum = get_playersnum();

if( (type == NORM_AD && playersnum < str_to_num(normConditions[a][1]) ) || (type == SAY_AD && playersnum < str_to_num(sayConditions[a][1]) ) )
return false;
}

//Max Players
if((type == NORM_AD && normConditions[a][2][0]) || (type == SAY_AD && sayConditions[a][2][0]))
{
new playersnum = get_playersnum();

if( (type == NORM_AD && playersnum > str_to_num(normConditions[a][2]) ) || (type == SAY_AD && playersnum > str_to_num(sayConditions[a][2]) ) )
return false;
}

//If everything went fine, return true
return true;
}

stock setColor(string[], len)
{
if (contain(string, "!t") != -1 || contain(string, "!g") != -1 || contain(string,"!n") != -1)
{
//Some nice shiny colors ^^
replace_all(string, len, "!t", "^x03");
replace_all(string, len, "!n", "^x01");
replace_all(string, len, "!g", "^x04");

//Work away a stupid bug
format(string, len, "^x01%s", string);
}
}

stock getString(mode, type, string[], len, one, two = 0)
{
//server_print("mode: %d type: %d len: %d one: %d two %d", mode, type, len, one, two);

//Uses the fact that a string is passed by reference
if(mode == COND)
{
if(type == NORM_AD)
{
copy(string, len, normConditions[one][two]);
} else//if(type = SAY_AD)
{
copy(string, len, sayConditions[one][two]);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(string, len, normStore[one]);
} else//if(type == SAY_AD)
{
copy(string, len, sayStore[one][two]);
}
}
}

stock setString(mode, type, string[], one, two = 0)
{
if(mode == COND)
{
if(type == NORM_AD)
{
copy(normConditions[one][two], 31, string);
} else//if(type = SAY_AD)
{
copy(sayConditions[one][two], 31, string);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(normStore[one], 127, string);
} else//if(type == SAY_AD)
{
copy(sayStore[one][two], 127, string);
}
}
}

Откомпилируй этот исходник, да и всё.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Elem3nT
сообщение 4.7.2012, 20:58
Сообщение #39
Стаж: 12 лет

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

а как можно поставить ркон, если он убран с серва? через какую команду?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя JIokoMoTuB
сообщение 4.7.2012, 21:19
Сообщение #40


Стаж: 14 лет

Сообщений: 2174
Благодарностей: 566
Полезность: 425

ты не поверишь.
amx_rcon rcon password


Empower isn't phoenix
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
8 страниц V   1 2 3 ... 6 7 »
 
Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: