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

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

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

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

[Поиск]imessage под dhud

Статус пользователя firante
сообщение 14.5.2014, 12:14
Сообщение #1


Стаж: 12 лет

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

Приветствую всех форумчан ищу imessage под dhud ни как не могу найти кто в курсе дайте знать пожалуйста!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя seregabeliko
сообщение 14.5.2014, 12:19
Сообщение #2
Стаж: 12 лет

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

в исходе изменяешь с hud в dhud
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя firante
сообщение 14.5.2014, 12:29
Сообщение #3


Стаж: 12 лет

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

Так правильно?
Код:
#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(0, 0, 255, -1.0, 0.2, 0, 6.0, 12.0);
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)
}

Скрин компиляции

Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 14.5.2014, 12:30
Сообщение #4


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

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

Цитата(firante @ 14.5.2014, 12:29) *
Так правильно?
Код:
#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(0, 0, 255, -1.0, 0.2, 0, 6.0, 12.0);
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)
}

Скрин компиляции


это не ошибка
это предупреждение, что съехала строка
на работу плагина не влияет
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя firante
сообщение 14.5.2014, 12:31
Сообщение #5


Стаж: 12 лет

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

GOOD FELLOW,
Хорошо сейчас проверю )
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: