#include <amxmodx>
#define AUTHOR "aSior - amxx.pl/user/60210-asiorr/"
new const hudColors[][] =
{
{ 255, 0, 0 }, // Fully red
{ 0, 255, 0 }, // Fully green,
{ 0, 0, 255 }, // Fully blue
{ 128, 0, 0 }, // Half red
{ 0, 128, 0 }, // Half green
{ 0, 0, 128 } // Half blue
};
new currentColors;
public plugin_init()
{
register_plugin("x", "v0.1", AUTHOR);
set_task(1.0, "changeColors", .flags = "b");
}
public changeColors()
{
currentColors = currentColors + 1 >= sizeof(hudColors) ? 0 : currentColors + 1;
}
public client_putinserver(index)
{
set_task(1.0, "displayHud", index, .flags = "b");
}
public displayHud(taskIndex)
{
new index = taskIndex;
if(!is_user_connected(index))
{
return;
}
set_hudmessage(hudColors[currentColors][0], hudColors[currentColors][1], hudColors[currentColors][2], 0.0, 0.17, 0, 6.0, 12.0);
show_hudmessage(index, "Your message");
}