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

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

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

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

3 страниц V   1 2 »

amx_help

, подсказка по плагину
Статус пользователя Vad64
сообщение 20.7.2010, 20:18
Сообщение #1
Стаж: 15 лет

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

Можите на примере amx_help показать как сделать цветной чат (Я ЗНАЮ ЧТО ТЕМЫ ЕСТЬ КАК ДЕЛАТЬ ЦВЕТНЫЕ СООБЩЕНИЯ НО ВСЕ ЖЕ НА ПРИМЕРЕ ПОКАЗАТЬ МОЖНО ЖЕ)

Код
/* AMX Mod X
*   Admin Help Plugin
*
* by the AMX Mod X Development Team
*  originally developed by tcquest78
*
* 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>

#define DISPLAY_MSG        // Comment to disable message on join
#define HELPAMOUNT 10    // Number of commands per page

public plugin_init()
{
    register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
    register_dictionary("adminhelp.txt")
    register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
    if (is_user_bot(id))
        return
    
    set_task(15.0, "dispInfo", id)
}

public client_disconnect(id)
{
    remove_task(id)
}
#endif

public cmdHelp(id, level, cid)
{
    new arg1[8], flags = get_user_flags(id)
    new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
    new lHelpAmount = HELPAMOUNT
    
    // HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
    if (flags > 0 && !(flags & ADMIN_USER))
    {
        flags |= ADMIN_ADMIN;
    }
    
    if (id == 0 && read_argc() == 3)
        lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT

    if (--start < 0)
        start = 0

    new clcmdsnum = get_concmdsnum(flags, id)

    if (start >= clcmdsnum)
        start = clcmdsnum - 1

    console_print(id, "^n----- %L -----", id, "HELP_COMS")
    
    new info[128], cmd[32], eflags
    new end = start + lHelpAmount // HELPAMOUNT

    if (end > clcmdsnum)
        end = clcmdsnum

    for (new i = start; i < end; i++)
    {
        get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
        console_print(id, "%3d: %s %s", i + 1, cmd, info)
    }
    
    console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)

    if (end < clcmdsnum)
        console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
    else
        console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")

    return PLUGIN_HANDLED
}

#if defined DISPLAY_MSG
public dispInfo(id)
{
    client_print(id, print_chat, "%L", id, "TYPE_HELP")
    
    new nextmap[32]
    get_cvar_string("amx_nextmap", nextmap, 31)
    
    if (get_cvar_float("mp_timelimit"))
    {
        new timeleft = get_timeleft()
        
        if (timeleft > 0)
        {
            client_print(id, print_chat, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
        } else {
            client_print(id, print_chat, "%L", id, "TIME_INFO_2", nextmap)
        }
    }
}
#endif



Мне бы хотелось так:

[ru]
HELP_COMS = Помощь по AMX Mod X:
HELP_ENTRIES = Список доступных команд с %d по %d. Всего команд - %d
HELP_USE_MORE = Напишите "amx_help %d" для продолжения
HELP_USE_BEGIN = Напишите "amx_help 1" для просмотра с начала
TYPE_HELP = Напишите в консоле "amx_help" для просмотра новых доступных команд
TIME_INFO_1 = До смены карты осталось: %d:%02d мин. Следующая карта: %s
TIME_INFO_2 = Ограничения по времени - нет. Следующая карта: %s

Отредактировал: Vad64, - 20.7.2010, 20:18
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя STR@TEG
сообщение 20.7.2010, 23:22
Сообщение #2
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Vad64,
Почитай эту статью.
Сообщениям, отображаемым в консоли, таким как:
Цитата
HELP_COMS
HELP_ENTRIES
HELP_USE_MORE
HELP_USE_BEGIN
Цвет изменить нельзя.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 21.7.2010, 19:36
Сообщение #3
Стаж: 15 лет

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

Цитата(STR@TEG @ 20.7.2010, 23:22) *
Vad64,
Почитай эту статью.
Сообщениям, отображаемым в консоли, таким как:
[size=1][/size]Цвет изменить нельзя.

А какие еще нельзя изменить?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 21.7.2010, 19:52
Сообщение #4
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 21.7.2010, 21:36) *
А какие еще нельзя изменить?
По-моему все остальные можно, сейчас трудно сказать.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 21.7.2010, 20:04
Сообщение #5
Стаж: 15 лет

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

Цитата(STR@TEG @ 21.7.2010, 19:52) *
По-моему все остальные можно, сейчас трудно сказать.

а вот смотри hpk строка

ColorChat( param[0] ,RED,"^x01Игроки с пингом больше чем ^x03%d^x01, будут кикнуты!"

как сделать так чтобы

"Игроки с пингом больше чем %d, будут кикнуты!"

а то у меня получается только "Игроки с пингом больше чем %d, будут кикнуты!"

Отредактировал: Vad64, - 21.7.2010, 20:06
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 21.7.2010, 20:19
Сообщение #6
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Код
ColorChat(param[0], GREEN, "Игроки с пингом больше чем ^x03%d ^x04будут кикнуты!", get_cvar_num("amx_hpk_ping"))
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 21.7.2010, 20:34
Сообщение #7
Стаж: 15 лет

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

Цитата(STR@TEG @ 21.7.2010, 20:19) *
Код
ColorChat(param[0], GREEN, "Игроки с пингом больше чем ^x03%d ^x04будут кикнуты!", get_cvar_num("amx_hpk_ping"))

не cut мне зеленый мне нужен вместо зеленого синий

Отредактировал: STR@TEG, - 21.7.2010, 20:39
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 21.7.2010, 20:40
Сообщение #8
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Одновременное использование синего и красного цвета в чате невозможно.

ps.gif Не *** а зачем.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 6:22
Сообщение #9
Стаж: 15 лет

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

Цитата(STR@TEG @ 21.7.2010, 21:40) *
Одновременное использование синего и красного цвета в чате невозможно.

ps.gif Не *** а зачем.

а вот mapchooser.sma его тоже ,нельзя изменить цветовую гамму
mapchooser.sma

/* AMX Mod X
* Nextmap Chooser 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>

#define SELECTMAPS 5

#define charsof(%1) (sizeof(%1)-1)

new Array:g_mapName;
new g_mapNums;

new g_nextName[SELECTMAPS]
new g_voteCount[SELECTMAPS + 2]
new g_mapVoteNum
new g_teamScore[2]
new g_lastMap[32]

new g_coloredMenus
new bool:g_selected = false

public plugin_init()
{
register_plugin("Nextmap Chooser", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("mapchooser.txt")
register_dictionary("common.txt")

g_mapName=ArrayCreate(32);

new MenuName[64]

format(MenuName, 63, "%L", "en", "CHOOSE_NEXTM")
register_menucmd(register_menuid(MenuName), (-1^(-1<<(SELECTMAPS+2))), "countVote")
register_cvar("amx_extendmap_max", "90")
register_cvar("amx_extendmap_step", "15")

if (cstrike_running())
register_event("TeamScore", "team_score", "a")

get_localinfo("lastMap", g_lastMap, 31)
set_localinfo("lastMap", "")

new maps_ini_file[64]
get_configsdir(maps_ini_file, 63);
format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);

if (!file_exists(maps_ini_file))
get_cvar_string("mapcyclefile", maps_ini_file, 63)
if (loadSettings(maps_ini_file))
set_task(15.0, "voteNextmap", 987456, "", 0, "b")

g_coloredMenus = colored_menus()

}

public checkVotes()
{
new b = 0

for (new a = 0; a < g_mapVoteNum; ++a)
if (g_voteCount[b] < g_voteCount[a])
b = a


if (g_voteCount[SELECTMAPS] > g_voteCount[b]
&& g_voteCount[SELECTMAPS] > g_voteCount[SELECTMAPS+1])
{
new mapname[32]

get_mapname(mapname, 31)
new Float:steptime = get_cvar_float("amx_extendmap_step")
set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_EXT", steptime)
log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes", mapname, steptime)

return
}

new smap[32]
if (g_voteCount[b] && g_voteCount[SELECTMAPS + 1] <= g_voteCount[b])
{
ArrayGetString(g_mapName, g_nextName[b], smap, charsof(smap));
set_cvar_string("amx_nextmap", smap);
}


get_cvar_string("amx_nextmap", smap, 31)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_NEXT", smap)
log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
}

public countVote(id, key)
{
if (get_cvar_float("amx_vote_answers"))
{
new name[32]
get_user_name(id, name, 31)

if (key == SELECTMAPS)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHOSE_EXT", name)
else if (key < SELECTMAPS)
{
new map[32];
ArrayGetString(g_mapName, g_nextName[key], map, charsof(map));
client_print(0, print_chat, "%L", LANG_PLAYER, "X_CHOSE_X", name, map);
}
}
++g_voteCount[key]

return PLUGIN_HANDLED
}

bool:isInMenu(id)
{
for (new a = 0; a < g_mapVoteNum; ++a)
if (id == g_nextName[a])
return true
return false
}

public voteNextmap()
{
new winlimit = get_cvar_num("mp_winlimit")
new maxrounds = get_cvar_num("mp_maxrounds")

if (winlimit)
{
new c = winlimit - 2

if ((c > g_teamScore[0]) && (c > g_teamScore[1]))
{
g_selected = false
return
}
}
else if (maxrounds)
{
if ((maxrounds - 2) > (g_teamScore[0] + g_teamScore[1]))
{
g_selected = false
return
}
} else {
new timeleft = get_timeleft()

if (timeleft < 1 || timeleft > 129)
{
g_selected = false
return
}
}

if (g_selected)
return

g_selected = true

new menu[512], a, mkeys = (1<<SELECTMAPS + 1)

new pos = format(menu, 511, g_coloredMenus ? "\r%L:\w^n^n" : "%L:^n^n", LANG_SERVER, "CHOOSE_NEXTM")
new dmax = (g_mapNums > SELECTMAPS) ? SELECTMAPS : g_mapNums

for (g_mapVoteNum = 0; g_mapVoteNum < dmax; ++g_mapVoteNum)
{
a = random_num(0, g_mapNums - 1)

while (isInMenu(a))
if (++a >= g_mapNums) a = 0

g_nextName[g_mapVoteNum] = a
pos += format(menu[pos], 511, "\r%d.\w %a^n", g_mapVoteNum + 1, ArrayGetStringHandle(g_mapName, a));
mkeys |= (1<<g_mapVoteNum)
g_voteCount[g_mapVoteNum] = 0
}

menu[pos++] = '^n'
g_voteCount[SELECTMAPS] = 0
g_voteCount[SELECTMAPS + 1] = 0

new mapname[32]
get_mapname(mapname, 31)

if ((winlimit + maxrounds) == 0 && (get_cvar_float("mp_timelimit") < get_cvar_float("amx_extendmap_max")))
{
pos += format(menu[pos], 511, "\r%d.\w %L^n", SELECTMAPS + 1, LANG_SERVER, "EXTED_MAP", mapname)
mkeys |= (1<<SELECTMAPS)
}

format(menu[pos], 511, "\r%d.\w %L", SELECTMAPS+2, LANG_SERVER, "NONE")
new MenuName[64]

format(MenuName, 63, "%L", "en", "CHOOSE_NEXTM")
show_menu(0, mkeys, menu, 15, MenuName)
set_task(15.0, "checkVotes")
client_print(0, print_chat, "%L", LANG_SERVER, "TIME_CHOOSE")
client_cmd(0, "spk Gman/Gman_Choose2")
log_amx("Vote: Voting for the nextmap started")
}
stock bool:ValidMap(mapname[])
{
if ( is_map_valid(mapname) )
{
return true;
}
// If the is_map_valid check failed, check the end of the string
new len = strlen(mapname) - 4;

// The mapname was too short to possibly house the .bsp extension
if (len < 0)
{
return false;
}
if ( equali(mapname[len], ".bsp") )
{
// If the ending was .bsp, then cut it off.
// the string is byref'ed, so this copies back to the loaded text.
mapname[len] = '^0';

// recheck
if ( is_map_valid(mapname) )
{
return true;
}
}

return false;
}

loadSettings(filename[])
{
if (!file_exists(filename))
return 0

new szText[32]
new currentMap[32]

new buff[256];

get_mapname(currentMap, 31)

new fp=fopen(filename,"r");

while (!feof(fp))
{
buff[0]='^0';

fgets(fp, buff, charsof(buff));

parse(buff, szText, charsof(szText));


if (szText[0] != ';' &&
ValidMap(szText) &&
!equali(szText, g_lastMap) &&
!equali(szText, currentMap))
{
ArrayPushString(g_mapName, szText);
++g_mapNums;
}

}

fclose(fp);

return g_mapNums
}

public team_score()
{
new team[2]

read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}

public plugin_end()
{
new current_map[32]

get_mapname(current_map, 31)
set_localinfo("lastMap", current_map)
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 10:17
Сообщение #10
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 22.7.2010, 8:22) *
а вот mapchooser.sma его тоже ,нельзя изменить цветовую гамму
mapchooser.sma
/* AMX Mod X
* Nextmap Chooser 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>

#define SELECTMAPS 5

#define charsof(%1) (sizeof(%1)-1)

new Array:g_mapName;
new g_mapNums;

new g_nextName[SELECTMAPS]
new g_voteCount[SELECTMAPS + 2]
new g_mapVoteNum
new g_teamScore[2]
new g_lastMap[32]

new g_coloredMenus
new bool:g_selected = false

public plugin_init()
{
register_plugin("Nextmap Chooser", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("mapchooser.txt")
register_dictionary("common.txt")

g_mapName=ArrayCreate(32);

new MenuName[64]

format(MenuName, 63, "%L", "en", "CHOOSE_NEXTM")
register_menucmd(register_menuid(MenuName), (-1^(-1<<(SELECTMAPS+2))), "countVote")
register_cvar("amx_extendmap_max", "90")
register_cvar("amx_extendmap_step", "15")

if (cstrike_running())
register_event("TeamScore", "team_score", "a")

get_localinfo("lastMap", g_lastMap, 31)
set_localinfo("lastMap", "")

new maps_ini_file[64]
get_configsdir(maps_ini_file, 63);
format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);

if (!file_exists(maps_ini_file))
get_cvar_string("mapcyclefile", maps_ini_file, 63)
if (loadSettings(maps_ini_file))
set_task(15.0, "voteNextmap", 987456, "", 0, "b")

g_coloredMenus = colored_menus()

}

public checkVotes()
{
new b = 0

for (new a = 0; a < g_mapVoteNum; ++a)
if (g_voteCount[b] < g_voteCount[a])
b = a


if (g_voteCount[SELECTMAPS] > g_voteCount[b]
&& g_voteCount[SELECTMAPS] > g_voteCount[SELECTMAPS+1])
{
new mapname[32]

get_mapname(mapname, 31)
new Float:steptime = get_cvar_float("amx_extendmap_step")
set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_EXT", steptime)
log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes", mapname, steptime)

return
}

new smap[32]
if (g_voteCount[b] && g_voteCount[SELECTMAPS + 1] <= g_voteCount[b])
{
ArrayGetString(g_mapName, g_nextName[b], smap, charsof(smap));
set_cvar_string("amx_nextmap", smap);
}


get_cvar_string("amx_nextmap", smap, 31)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_NEXT", smap)
log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
}

public countVote(id, key)
{
if (get_cvar_float("amx_vote_answers"))
{
new name[32]
get_user_name(id, name, 31)

if (key == SELECTMAPS)
client_print(0, print_chat, "%L", LANG_PLAYER, "CHOSE_EXT", name)
else if (key < SELECTMAPS)
{
new map[32];
ArrayGetString(g_mapName, g_nextName[key], map, charsof(map));
client_print(0, print_chat, "%L", LANG_PLAYER, "X_CHOSE_X", name, map);
}
}
++g_voteCount[key]

return PLUGIN_HANDLED
}

bool:isInMenu(id)
{
for (new a = 0; a < g_mapVoteNum; ++a)
if (id == g_nextName[a])
return true
return false
}

public voteNextmap()
{
new winlimit = get_cvar_num("mp_winlimit")
new maxrounds = get_cvar_num("mp_maxrounds")

if (winlimit)
{
new c = winlimit - 2

if ((c > g_teamScore[0]) && (c > g_teamScore[1]))
{
g_selected = false
return
}
}
else if (maxrounds)
{
if ((maxrounds - 2) > (g_teamScore[0] + g_teamScore[1]))
{
g_selected = false
return
}
} else {
new timeleft = get_timeleft()

if (timeleft < 1 || timeleft > 129)
{
g_selected = false
return
}
}

if (g_selected)
return

g_selected = true

new menu[512], a, mkeys = (1<<SELECTMAPS + 1)

new pos = format(menu, 511, g_coloredMenus ? "\r%L:\w^n^n" : "%L:^n^n", LANG_SERVER, "CHOOSE_NEXTM")
new dmax = (g_mapNums > SELECTMAPS) ? SELECTMAPS : g_mapNums

for (g_mapVoteNum = 0; g_mapVoteNum < dmax; ++g_mapVoteNum)
{
a = random_num(0, g_mapNums - 1)

while (isInMenu(a))
if (++a >= g_mapNums) a = 0

g_nextName[g_mapVoteNum] = a
pos += format(menu[pos], 511, "\r%d.\w %a^n", g_mapVoteNum + 1, ArrayGetStringHandle(g_mapName, a));
mkeys |= (1<<g_mapVoteNum)
g_voteCount[g_mapVoteNum] = 0
}

menu[pos++] = '^n'
g_voteCount[SELECTMAPS] = 0
g_voteCount[SELECTMAPS + 1] = 0

new mapname[32]
get_mapname(mapname, 31)

if ((winlimit + maxrounds) == 0 && (get_cvar_float("mp_timelimit") < get_cvar_float("amx_extendmap_max")))
{
pos += format(menu[pos], 511, "\r%d.\w %L^n", SELECTMAPS + 1, LANG_SERVER, "EXTED_MAP", mapname)
mkeys |= (1<<SELECTMAPS)
}

format(menu[pos], 511, "\r%d.\w %L", SELECTMAPS+2, LANG_SERVER, "NONE")
new MenuName[64]

format(MenuName, 63, "%L", "en", "CHOOSE_NEXTM")
show_menu(0, mkeys, menu, 15, MenuName)
set_task(15.0, "checkVotes")
client_print(0, print_chat, "%L", LANG_SERVER, "TIME_CHOOSE")
client_cmd(0, "spk Gman/Gman_Choose2")
log_amx("Vote: Voting for the nextmap started")
}
stock bool:ValidMap(mapname[])
{
if ( is_map_valid(mapname) )
{
return true;
}
// If the is_map_valid check failed, check the end of the string
new len = strlen(mapname) - 4;

// The mapname was too short to possibly house the .bsp extension
if (len < 0)
{
return false;
}
if ( equali(mapname[len], ".bsp") )
{
// If the ending was .bsp, then cut it off.
// the string is byref'ed, so this copies back to the loaded text.
mapname[len] = '^0';

// recheck
if ( is_map_valid(mapname) )
{
return true;
}
}

return false;
}

loadSettings(filename[])
{
if (!file_exists(filename))
return 0

new szText[32]
new currentMap[32]

new buff[256];

get_mapname(currentMap, 31)

new fp=fopen(filename,"r");

while (!feof(fp))
{
buff[0]='^0';

fgets(fp, buff, charsof(buff));

parse(buff, szText, charsof(szText));


if (szText[0] != ';' &&
ValidMap(szText) &&
!equali(szText, g_lastMap) &&
!equali(szText, currentMap))
{
ArrayPushString(g_mapName, szText);
++g_mapNums;
}

}

fclose(fp);

return g_mapNums
}

public team_score()
{
new team[2]

read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}

public plugin_end()
{
new current_map[32]

get_mapname(current_map, 31)
set_localinfo("lastMap", current_map)
}
Что ты хочешь в нем изменить?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 12:30
Сообщение #11
Стаж: 15 лет

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

Цитата(STR@TEG @ 22.7.2010, 11:17) *
Что ты хочешь в нем изменить?

CHO_FIN_EXT =^x04Голосование завершено. Карта продлена на ^x03%.0f^x04 минут.
CHO_FIN_NEXT =^x04Голосование завершено. Следующая карта ^x03%s
CHOSE_EXT = ^x03%s^x04 выбрал продление карты
X_CHOSE_X = ^x03%s^x04 выбрал ^x03%s
CHOOSE_NEXTM = ^x03Выбор следующей карты
EXTED_MAP = ^x04Продление карты на ^x03%s
TIME_CHOOSE = ^x03Пора выбирать следующую карту...
ну я показал должен понять
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 12:44
Сообщение #12
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 22.7.2010, 14:30) *
CHO_FIN_EXT =^x04Голосование завершено. Карта продлена на ^x03%.0f^x04 минут.
CHO_FIN_NEXT =^x04Голосование завершено. Следующая карта ^x03%s
CHOSE_EXT = ^x03%s^x04 выбрал продление карты
X_CHOSE_X = ^x03%s^x04 выбрал ^x03%s
CHOOSE_NEXTM = ^x03Выбор следующей карты
EXTED_MAP = ^x04Продление карты на ^x03%s
TIME_CHOOSE = ^x03Пора выбирать следующую карту...
ну я показал должен понять
В исходнике нужно изменять функцию показа сообщений. Сейчас проверил, все работает.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 13:02
Сообщение #13
Стаж: 15 лет

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

Цитата(STR@TEG @ 22.7.2010, 13:44) *
В исходнике нужно изменять функцию показа сообщений. Сейчас проверил, все работает.

ну покажи как
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 13:04
Сообщение #14
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Код
client_print(0, print_chat, "%L", LANG_SERVER, "TIME_CHOOSE")
Заменяем на:
Код
ColorChat(0, RED, "%L", LANG_SERVER, "TIME_CHOOSE")

Ты так про каждый плагин будешь спрашивать?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 13:12
Сообщение #15
Стаж: 15 лет

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

Цитата(STR@TEG @ 22.7.2010, 13:04) *
Код
client_print(0, print_chat, "%L", LANG_SERVER, "TIME_CHOOSE")
Заменяем на:
Код
ColorChat(0, RED, "%L", LANG_SERVER, "TIME_CHOOSE")

Ты так про каждый плагин будешь спрашивать?

и че мне это даст он будет весь красный чат
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 13:13
Сообщение #16
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 22.7.2010, 15:12) *
и че мне это даст он будет весь красный чат
Ты надоел своей тугостью. Я тебе дал статью, читай и экспериментируй.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 13:19
Сообщение #17
Стаж: 15 лет

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

Цитата(STR@TEG @ 22.7.2010, 13:13) *
Ты надоел своей тугостью. Я тебе дал статью, читай и экспериментируй.

ответить трудно чтоли ты мне покажи вот этот плагин и мож delet тему
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 13:41
Сообщение #18
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 22.7.2010, 14:30) *
TIME_CHOOSE = ^x03Пора выбирать следующую карту...
Это реализовывается так:
Код
ColorChat(0, TEAM_COLOR, "%L", LANG_SERVER, "TIME_CHOOSE")
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Vad64
сообщение 22.7.2010, 14:16
Сообщение #19
Стаж: 15 лет

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

Цитата(STR@TEG @ 22.7.2010, 13:41) *
Это реализовывается так:
Код
ColorChat(0, TEAM_COLOR, "%L", LANG_SERVER, "TIME_CHOOSE")

Код
ColorChat(0, TEAM_COLOR, "%L", LANG_SERVER, "TIME_CHOOSE")
ну например заменил я и мне еще придеться в txt ставить каким цветом красить
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 22.7.2010, 14:18
Сообщение #20
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

Цитата(Vad64 @ 22.7.2010, 16:16) *
Код
ColorChat(0, TEAM_COLOR, "%L", LANG_SERVER, "TIME_CHOOSE")
ну например заменил я и мне еще придеться в txt ставить каким цветом красить
Не надо там ничего менять. Цвет будет соответствовать команде игрока.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
3 страниц V   1 2 »
 
Тема закрытаНачать новую тему
 
0 пользователей и 2 гостей читают эту тему: