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

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

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

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

2 страниц V   1 2

Director Hud Message

, Показ до 8 hud-сообщений за раз
Статус пользователя LaFA
сообщение 1.3.2011, 13:57
Сообщение #1


Стаж: 16 лет

Сообщений: 4505
Благодарностей: 3256
Полезность: 793

Director Hud Message

Когда-нибудь хотели, чтоб ваши сообщения отображались как подсказки в CS или HLTV? - Теперь это возможно :)
Видеопример https://www.youtube.com/watch?v=9czU0nbPSOY


Этот метод вывода сообщений использует в основном такие же параметры как и set_hudmessage. (за исключением канала)


│ Авторы идеи

MPNumB
xPaw
Exolent[jNr]


│ Ограничения

Максимальная длина сообщения : 128 символов.
Вы можете показать только 8 сообщений за раз. (8 каналов)


│ Функционал

Применение этих сообщений очень схоже с set_hudmessage() и show_hudmessage().



Код
set_dhudmessage( красный = 160, зеленый = 160, синий = 160, по оси x = -1.0, по оси y = 0.65, эффекты = 2(1-4), скорость появления = 6.0, время задержки на экране = 3.0, время задержки при затухании символов = 0.1, время задержки при появлении символов  = 1.5 )
show_dhudmessage( index, const message[], any:... )



Прикрепленный файл  dhudmessage.zip ( 6,31 килобайт ) Кол-во скачиваний: 1685
say /privet (для теста)

ссылка на первоисточник + картинка оттуда же
http://forums.alliedmods.net/showthread.php?t=149210

ps.gif Хоть что-то новенькое в кс )))

Отредактировал: LaFA, - 1.3.2011, 14:00
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 11 раз
   Цитировать сообщение
Статус пользователя Raimond-1992
сообщение 11.6.2011, 9:45
Сообщение #2


Стаж: 15 лет

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

LaFA,
Залей пожалуйста на фаилообменик, не могу скачать dntknw.gif
или киньте сюда исходник плиз, зарание спс.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя xSav
сообщение 11.6.2011, 10:17
Сообщение #3
Стаж: 16 лет

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

В первом сообщении ссылка на первоисточник оттуда скачивается без проблем
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Raimond-1992
сообщение 11.6.2011, 10:55
Сообщение #4


Стаж: 15 лет

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

xSav,
не могу скачать, ошибку выдает, перезалеи пожалуста
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Rejiser
сообщение 11.6.2011, 11:00
Сообщение #5


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

Цитата(Raimond-1992 @ 11.6.2011, 12:55) *
xSav,
не могу скачать, ошибку выдает, перезалеи пожалуста

http://forums.alliedmods.net/showthread.php?t=149210 только что скачал оттуда
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя kupuk96
сообщение 14.6.2011, 11:39
Сообщение #6


Стаж: 15 лет

Сообщений: 456
Благодарностей: 139
Полезность: 554

Изменил imessage.sma, при компиляции выдает предупреждение
imessage.sma
Код
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>

#define X_POS         -1.0
#define Y_POS         0.20
#define HOLD_TIME     12.0

new Array:g_Values
new Array:g_Messages
new g_MessagesNum
new g_Current

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

new amx_freq_imessage;

public plugin_init()
{
    g_Messages=ArrayCreate(384);
    g_Values=ArrayCreate(3);
    register_plugin("Info. Messages", AMXX_VERSION_STR, "AMXX Dev Team")
    register_dictionary("imessage.txt")
    register_dictionary("common.txt")
    register_srvcmd("amx_imessage", "setMessage")
    amx_freq_imessage=register_cvar("amx_freq_imessage", "10")
    
    new lastinfo[8]
    get_localinfo("lastinfomsg", lastinfo, 7)
    g_Current = str_to_num(lastinfo)
    set_localinfo("lastinfomsg", "")
}

public infoMessage()
{
    if (g_Current >= g_MessagesNum)
        g_Current = 0
        
    // No messages, just get out of here
    if (g_MessagesNum==0)
    {
        return;
    }
    
    new values[3];
    new Message[384];
    
    ArrayGetString(g_Messages, g_Current, Message, charsof(Message));
    ArrayGetArray(g_Values, g_Current, values);
    
    new hostname[64];
    
    get_cvar_string("hostname", hostname, 63);
    replace(Message, 380, "%hostname%", hostname);
    
    set_dhudmessage(values[0], values[1], values[2], X_POS, Y_POS, 0, 0.5, HOLD_TIME, 2.0, 2.0, -1);
    
    show_dhudmessage(0, "%s", Message);
    
    client_print(0, print_console, "%s", Message);
    ++g_Current;
    
    new Float:freq_im = get_pcvar_float(amx_freq_imessage);
    
    if (freq_im > 0.0)
        set_task(freq_im, "infoMessage", 12345);
}

public setMessage()
{

    new Message[384];
    
    remove_task(12345)
    read_argv(1, Message, 380)
    
    while (replace(Message, 380, "\n", "^n")) {}
    
    new mycol[12]
    new vals[3];
    
    read_argv(2, mycol, 11)        // RRRGGGBBB
    vals[2] = str_to_num(mycol[6])
    
    mycol[6] = 0
    vals[1] = str_to_num(mycol[3])
    
    mycol[3] = 0
    vals[0] = str_to_num(mycol[0])
    
    g_MessagesNum++
    
    new Float:freq_im = get_pcvar_float(amx_freq_imessage)
    
    ArrayPushString(g_Messages, Message);
    ArrayPushArray(g_Values, vals);
    
    if (freq_im > 0.0)
        set_task(freq_im, "infoMessage", 12345)
    
    return PLUGIN_HANDLED
}

public plugin_end()
{
    new lastinfo[8]

    num_to_str(g_Current, lastinfo, 7)
    set_localinfo("lastinfomsg", lastinfo)
}

Цитата
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// imessage.sma
// D:\hlds\cstrike\addons\amxmodx\scripting\imessage.sma(56) : warning 213: tag mismatch
// Header size: 920 bytes
// Code size: 5156 bytes
// Data size: 900 bytes
// Stack/heap size: 16384 bytes; estimated max. usage=778 cells (3112 bytes
)
// Total requirements: 23360 bytes
//
// 1 Warning.
// Done.
//
// Compilation Time: 0,3 sec
// ----------------------------------------

Press enter to exit ...


Отредактировал: kupuk96, - 14.6.2011, 11:40
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Rejiser
сообщение 14.6.2011, 11:41
Сообщение #7


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

Код
set_dhudmessage(values[0], values[1], values[2], X_POS, Y_POS, 0, 0.5, HOLD_TIME, 2.0, 2.0, -1);

===>
Код
set_dhudmessage(values[0], values[1], values[2], X_POS, Y_POS, 0, 0.5, HOLD_TIME, 2.0, 2.0);


Отредактировал: Rejiser, - 14.6.2011, 11:41
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Cs-StReMeR
сообщение 20.6.2011, 23:44
Сообщение #8


Стаж: 16 лет

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

Как сделать так, что бы при заходе на сервер игрок увидел приветствие?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Rejiser
сообщение 20.6.2011, 23:48
Сообщение #9


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

Цитата(Cs-StReMeR @ 21.6.2011, 1:44) *
Как сделать так, что бы при заходе на сервер игрок увидел приветствие?

client_putinserver
set_task
Ну еще плюс пару ньюансов, например такие как, удаление таска при дисконнекте и т.п

Отредактировал: Rejiser, - 20.6.2011, 23:49
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Cs-StReMeR
сообщение 20.6.2011, 23:54
Сообщение #10


Стаж: 16 лет

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

Цитата(Rejiser @ 21.6.2011, 0:48) *
client_putinserver
set_task
Ну еще плюс пару ньюансов, например такие как, удаление таска при дисконнекте и т.п

А готового нет?
Плохо разбираюсь в скриптинге, больше вопросов появиться :D
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Rejiser
сообщение 20.6.2011, 23:57
Сообщение #11


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

Цитата(Cs-StReMeR @ 21.6.2011, 1:54) *
А готового нет?
Плохо разбираюсь в скриптинге, больше вопросов появиться :D

Не знаю , не встречал.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Tr1sT
сообщение 21.6.2011, 0:04
Сообщение #12
Стаж: 16 лет
Город: localhost

Сообщений: 1299
Благодарностей: 683
Полезность: 1021

Цитата
А готового нет?
Плохо разбираюсь в скриптинге, больше вопросов появиться :D

К LaFе на колени.

Отредактировал: Tr1sT, - 21.6.2011, 0:09
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TYLER[t]
сообщение 21.6.2011, 13:12
Сообщение #13


Стаж: 14 лет

Сообщений: 43
Благодарностей: 26
Полезность: 461

*.sma
Код
/* 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>
#include <dhudmessage>

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;

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 message[192], 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++
    }
    

    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_dhudmessage(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_dhudmessage(pl, "%s :   %s", name, message[i + n])
                        client_print(pl, print_notify, "%s :   %s", name, message[i + n])
                    }
                    else
                    {
                        show_dhudmessage(pl, "%s", message[i + n])
                        client_print(pl, print_notify, "%s", message[i + n])
                    }
                }
            }
        }
        case 2:
        {
            show_dhudmessage(0, "%s :   %s", name, message[i + n])
            client_print(0, print_notify, "%s :   %s", name, message[i + n])
        }
        default:
        {
            show_dhudmessage(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 message[192], name[32], authid[32], userid
    new players[32], inum
    
    read_args(message, 191)
    remove_quotes(message)
    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 message[192], name[32], 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)
    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 message[192], 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])
    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], message[192], 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
    
    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_dhudmessage(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_dhudmessage(pl, "%s :   %s", name, message[length])
                        client_print(pl, print_notify, "%s :   %s", name, message[length])
                    }
                    else
                    {
                        show_dhudmessage(pl, "%s", message[length])
                        client_print(pl, print_notify, "%s", message[length])
                    }
                }
            }
            console_print(id, "%s :  %s", name, message[length])
        }
        case 2:
        {
            show_dhudmessage(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_dhudmessage(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
}

Что в коде не правильно?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Rejiser
сообщение 21.6.2011, 13:34
Сообщение #14


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

137 строка:
Код
set_dhudmessage(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)

===>
Код
set_dhudmessage(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)

и 357 строка:
Код
set_dhudmessage(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)

===>
Код
set_dhudmessage(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 раз
   + Цитировать сообщение
Статус пользователя dan_98_98
сообщение 21.6.2011, 22:12
Сообщение #15


Стаж: 15 лет

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

Показ до 8 hud-сообщений за раз + 640x480 = cbf1b2bfde1a.gif


!
Аккаунт пользователя заблокирован до: 11.8.4749, 8:48
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Archipelago
сообщение 23.6.2011, 7:08
Сообщение #16


Стаж: 16 лет

Сообщений: 520
Благодарностей: 67
Полезность: 21

LaFa ,ты конечно красавчик...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя H@ROS
сообщение 6.7.2011, 22:33
Сообщение #17


Стаж: 14 лет

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

Спасибо, заменил все недолговременные HUD сообщения в Zombie Plague, смотрится немного необычно :)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TYLER[t]
сообщение 23.8.2011, 8:59
Сообщение #18


Стаж: 14 лет

Сообщений: 43
Благодарностей: 26
Полезность: 461

Помогите исправить ошибки, плагины не компилируются.
*sma. (1)
/* ********************************************************************************
************************************************************************ */
// # The plugin has been prepared specifically for www.amxmodx.org
// # ********************************************************************************
***********************************************************
// # + What doing this plugin?
// # = Reset your score in real time (frags and death)
// #
// # + Is it stable?
// # = For me, at this time, Yes. But all the same must be approved.
// #
// # + How I can install it on the my server?
// # = Read the text which is below....
// #
// # copy this source file into the your scripts folder
// # compile and move plugin to the plugins folder
// # open and write into plugins.ini resetscore.amxx debug
// # remeber about save this file and close it.
// #
// # *********************************************************
// # this plugin require chatcolor.inc
// # that you must download it and install for(on) your serv
// # add constants into your server or amxx cfgs and restart the server
// #
// # ********************************************************************************
***********************************************************
// #
// # amx_admin_rsfrags 7 | | How much of frags this plugin must give to user with accesslevel 2
// # admin_rsdeath -1988 | | How much of death this plugin must give to user with accesslevel 2
// # amx_rsdeath 10 | | When users can reset their score. Death limit rule. Only if users death more than limit!
// #
// # |=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=
|=|
// #
// # Welcome to the AMX Mod X 1.8.1-300 Compiler.
// # Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
// #
// # Header size: 648 bytes
// # Code size: 2320 bytes
// # Data size: 2108 bytes
// # Stack/heap size: 16384 bytes; estimated max. usage=779 cells (3116 bytes)
// # Total requirements: 21460 bytes
// # Done.
// #
// # Copied Output File to: Z:\cstrike\addons\amxmodx\plugins\resetscore.amxx
// # Compilation Time: 0,08 sec
// #
// # |=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=
|=||=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|
// #
// # ********************************************************************************
*******************************************************************************
// # It's my firs plugin -- Don't judge strictly -- Maybe my english isn't wery well but something I can :D -- So checking this pl and tell me about bugs
/* ********************************************************************************
********************************************************************************
*
*********** */

#include <amxmodx>
#include <amxmisc>
#include <chatcolor>
#include <cstrike>
#include <fun>
#include <dhudmessages>

new rs_death, admin_rsfrags, admin_rsdeath

public plugin_init()
{
register_plugin("Reset Score", "1.0", "Alex D.")

admin_rsfrags = register_cvar("amx_admin_rsfrags", "7") // How much of frags this plugin must give to user with accesslevel 2
admin_rsdeath = register_cvar("amx_admin_rsdeath", "-200") // How much of death this plugin must give to user with accesslevel 2

rs_death = register_cvar("amx_rsdeath", "10") // Users can reset their score if amx_rsdeath more than amx_rsdeath :D. Death limit rule.

register_clcmd("say", "handle_say")
}

public fun_score(id)
{

if (access(id, 2))
{
new A = get_pcvar_num(admin_rsfrags)
new B = get_pcvar_num(admin_rsdeath)
new C = get_user_frags(id)

set_user_frags(id, A+C) // really C+A :D but mat. The queen of logic.
cs_set_user_deaths(id, B)
client_print_color(id, RED, "^1[^4Server Bot^1] ^1After using the command ^4rs ^1you have got: ^4%d ^3frags ^1and ^4%d ^3death ^1!", get_user_frags(id), cs_get_user_deaths(id))
}

else
{
client_print_color(id, RED, "^1[^4Server Bot^1] ^3You don't have premissions for using this command!")
}
return PLUGIN_HANDLED
}

public reset_score(id)
{
new D = get_pcvar_num(rs_death), name[31]

if (access(id, 2))
{
get_user_name(id, name, 31)
client_print_color(0, GREY, "^1[^4Server Bot^1] ^1Admin ^4%s ^1has reset their: ^3%d ^1death and ^3%d^1 frags.", name, cs_get_user_deaths(id), get_user_frags(id))
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
return 0
}

if (cs_get_user_deaths(id) > D)
{
get_user_name(id, name, 31)
client_print_color(0, GREY, "^1[^4Server Bot^1] ^1Player ^4%s ^1has reset their: ^3%d ^1death.", name, cs_get_user_deaths(id))
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
}

else
{
client_print_color(id, RED, "^1[^4Server Bot^1] ^3By rule of death limit this isn't possible to reset your score!")
}
return PLUGIN_HANDLED
}

public client_authorized(id)
{
set_task(240.0, "print_text", id)
}

public handle_say(id)
{
new said[32]
read_args(said, 31)

if (equali(said, "^"rs^""))
{
reset_score(id)
}

if (equali(said, "^"funrs^""))
{
fun_score(id)
}

else if (containi(said, "resetscore") != -1)
{
print_text(id)
}
return PLUGIN_CONTINUE
}

public print_text(id)
{
client_print_color(id, GREY, "^1[^4Server Bot^1] Use chat command ^4rs ^1to reset your frags and death.")
set_dhudmessage(255, 100, 0, -1.0, 0.75, 1, 6.0, 12.0, 0.05, 0.05)
show_hudmessage(0, "Reset Score plugin written by DALE^nContacts in Europe.^nIcq: 5-440-931") // My copyright - can be commented removed *
}

/* ( icq: 389-057-865 | | skype: untunable | | @mail: dac-coder@qip.ru | | http://lineage.brovary.net/ ) */
/* ( building fun & classic servers for a pay -- contact with me you can get if looked up ) */


*sma. (2)


/* Plugin generated by AMXX-Studio */


#include <amxmodx>
#include <dhudmessages>

#define PLUGIN "Auto Restart vl"
#define VERSION "1.4"
#define AUTHOR "vato loco [GE-S]"

#define TIMER_TASK 123456
#define RESTART_TASK 789123

new g_counter

new g_autorestart
new g_autoenabled
new g_autocds
new g_autocount_color
new g_autostart_color
new g_auto_xypos

new g_SyncGameStart
new g_SyncRestartTimer

new bool:g_bRoundStart

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

register_logevent("RoundStart", 2, "1=Round_Start")
register_event("TextMsg","RestartTask","a","2&#Game_C")

register_dictionary("auto_restart_vl.txt")

g_autoenabled = register_cvar("amx_autorr_enable","1")
g_autocds = register_cvar("amx_autorr_cds","1")
g_autorestart = register_cvar("amx_autorr_time","40")
g_autocount_color = register_cvar("amx_autorr_count_color","0 255 0")
g_autostart_color = register_cvar("amx_autorr_start_color","0 255 255")
g_auto_xypos = register_cvar("amx_autorr_xypos","-1.0 0.25")

g_SyncGameStart = CreateHudSyncObj()
g_SyncRestartTimer = CreateHudSyncObj()
}

public RoundStart()
{
if(!get_pcvar_num(g_autoenabled))
return PLUGIN_HANDLED

if(g_bRoundStart)
{
static r, g, b, Float:x, Float:y
HudMsgPos(x,y)
HudMsgColor(g_autostart_color, r, g, b)

set_dhudmessage( r, g, b, x, y, 1, 5.0, 8.0, 0.0, 0.0)
ShowSyncHudMsg( 0, g_SyncGameStart, "%L",LANG_PLAYER, "GAME_STARTED")
}
g_bRoundStart = false

return PLUGIN_CONTINUE
}

public RestartTask()
{
if(!get_pcvar_num(g_autoenabled))
return PLUGIN_HANDLED

set_task(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart))
set_task(get_pcvar_float(g_autorestart),"RestartRound",RESTART_TASK)

return PLUGIN_CONTINUE
}

public TimeCounter()
{
g_counter++

new Float:iRestartTime = get_pcvar_float(g_autorestart) - g_counter
new Float:fSec
fSec = iRestartTime

static r, g, b, Float:x, Float:y
HudMsgPos(x,y)
HudMsgColor(g_autocount_color, r, g, b)

set_dhudmessage( r, g, b, x, y, 0, 0.0, 1.0, 0.0, 0.0)
ShowSyncHudMsg( 0, g_SyncRestartTimer, "%L",LANG_PLAYER, "AUTO_RESTART", floatround(fSec))

if(get_pcvar_num(g_autocds) && get_pcvar_num(g_autorestart) - g_counter < 11 && get_pcvar_num(g_autorestart) - g_counter !=0)
{
static szNum[32]
num_to_word(get_pcvar_num(g_autorestart) - g_counter, szNum, 31)
client_cmd(0,"speak ^"vox/%s^"", szNum)
}
if(g_counter == get_pcvar_num(g_autorestart))
{
g_bRoundStart = true
g_counter = 0
}
}

public RestartRound()
{
server_cmd("sv_restartround 1")
}

public HudMsgColor(cvar, &r, &g, &b)
{
static color[16], piece[5]
get_pcvar_string(cvar, color, 15)

strbreak( color, piece, 4, color, 15)
r = str_to_num(piece)

strbreak( color, piece, 4, color, 15)
g = str_to_num(piece)
b = str_to_num(color)
}

public HudMsgPos(&Float:x, &Float:y)
{
static coords[16], piece[10]
get_pcvar_string(g_auto_xypos , coords, 15)

strbreak(coords, piece, 9, coords, 15)
x = str_to_float(piece)
y = str_to_float(coords)
}



Отредактировал: TYLER[t], - 23.8.2011, 9:30
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя vdnmajor1
сообщение 15.6.2012, 18:15
Сообщение #19
Стаж: 13 лет

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

Цитата(LaFA @ 1.3.2011, 13:57) *
Director Hud Message

Когда-нибудь хотели, чтоб ваши сообщения отображались как подсказки в CS или HLTV? - Теперь это возможно :)
Видеопример https://www.youtube.com/watch?v=9czU0nbPSOY


Этот метод вывода сообщений использует в основном такие же параметры как и set_hudmessage. (за исключением канала)


│ Авторы идеи

MPNumB
xPaw
Exolent[jNr]


│ Ограничения

Максимальная длина сообщения : 128 символов.
Вы можете показать только 8 сообщений за раз. (8 каналов)


│ Функционал

Применение этих сообщений очень схоже с set_hudmessage() и show_hudmessage().



Код
set_dhudmessage( красный = 160, зеленый = 160, синий = 160, по оси x = -1.0, по оси y = 0.65, эффекты = 2(1-4), скорость появления = 6.0, время задержки на экране = 3.0, время задержки при затухании символов = 0.1, время задержки при появлении символов  = 1.5 )
show_dhudmessage( index, const message[], any:... )



Прикрепленный файл  dhudmessage.zip ( 6,31 килобайт ) Кол-во скачиваний: 1685
say /privet (для теста)

ссылка на первоисточник + картинка оттуда же
http://forums.alliedmods.net/showthread.php?t=149210

ps.gif Хоть что-то новенькое в кс )))

Почему я не могу его компилировать ?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
noskill
сообщение 15.6.2012, 18:31
Сообщение #20
Стаж: 14 лет

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

Цитата(vdnmajor1 @ 15.6.2012, 19:15) *
Почему я не могу его компилировать ?

почему ты не можешь его компилировать?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
2 страниц V   1 2
 
Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: