I would like a dhudmessage plugin where it appears in the center and top ...
but I want the messages to be exchanging randomly
where I can add several messages
and I would like you to have the option of players you don't like to disable the hud
welcome to the clan
whatsaap contact
etc
random dhudmessage plugin
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
random dhudmessage plugin
Код за потвърждение: Избери целия код
#include <amxmodx>
#if AMXX_VERSION_NUM < 183 || !defined set_dhudmessage
#tryinclude <dhudmessage>
#if !defined _dhudmessage_included
#error "dhudmessage.inc" is missing in your "scripting/include" folder. Download it from: "https://amxx-bg.info/forum/inc/"
#endif
#endif
#tryinclude <cromchat>
#if !defined _cromchat_included
#error "cromchat.inc" is missing in your "scripting/include" folder. Download it from: "https://amxx-bg.info/forum/inc/"
#endif
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif
new const MESSAGES_LIST[][] =
{
"random message1",
"random message2",
"random message3"
}
#define MSG_COLOR 0, 255, 0
#define MSG_POSITION -1.0, 0.1
#define MSG_CHANGE_INTERVAL 15.0
new bool:g_bMsgEnabled[MAX_PLAYERS + 1]
public plugin_init()
{
register_plugin("Random DHUD Messages", "1.0", "OciXCrom")
register_clcmd("say /msg", "ToggleMessages")
register_clcmd("say_team /msg", "ToggleMessages")
set_task(MSG_CHANGE_INTERVAL, "DisplayMessage", .flags = "b")
}
public client_putinserver(id)
{
g_bMsgEnabled[id] = true
}
public DisplayMessage()
{
new iPlayers[MAX_PLAYERS], iPnum
get_players(iPlayers, iPnum)
set_dhudmessage(MSG_COLOR, MSG_POSITION, .holdtime = MSG_CHANGE_INTERVAL)
for(new i, iPlayer, iMsg = random(sizeof(MESSAGES_LIST)); i < iPnum; i++)
{
iPlayer = iPlayers[i]
if(g_bMsgEnabled[iPlayer])
{
show_dhudmessage(iPlayer, MESSAGES_LIST[iMsg])
}
}
}
public ToggleMessages(id)
{
g_bMsgEnabled[id] = !g_bMsgEnabled[id]
CC_SendMessage(id, "&x04* Info messages have been %s&x01.", g_bMsgEnabled[id] ? "&x06enabled" : "&x07disabled")
return PLUGIN_HANDLED
}
-
vini2001
Извън линия - Foreigner
- Мнения: 45
- Регистриран на: 09 Мар 2020, 15:50
- Се отблагодари: 4 пъти
- Обратна връзка:
random dhudmessage plugin
works perfectly friend, thank you very much.
just a doubt ... because in most plugins the #define is all aligned to the right
#
#
#
and in this code there are some
#
#
#
so take this doubt away I'm not learning.
after that thank you very much.
you can close the topic
just a doubt ... because in most plugins the #define is all aligned to the right
#
#
#
and in this code there are some
#
#
#
so take this doubt away I'm not learning.
after that thank you very much.
you can close the topic
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
random dhudmessage plugin
You mean to the left?
It doesn't matter. That's just my coding style, doesn't make any difference for the plugin. Both work the same. I use this style because it's easier to read.
It doesn't matter. That's just my coding style, doesn't make any difference for the plugin. Both work the same. I use this style because it's easier to read.
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 6 Отговори
- 2419 Преглеждания
-
Последно мнение от vini2001
-
- 5 Отговори
- 2445 Преглеждания
-
Последно мнение от OciXCrom
-
- 1 Отговори
- 1311 Преглеждания
-
Последно мнение от JackEyedJones
-
- 1 Отговори
- 178 Преглеждания
-
Последно мнение от illusion
-
- 0 Отговори
- 782 Преглеждания
-
Последно мнение от majestic_sz
-
- 6 Отговори
- 487 Преглеждания
-
Последно мнение от Siska
-
- 1 Отговори
- 1342 Преглеждания
-
Последно мнение от Just
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 10 госта