Make a global boolean for blue and red switch.
Add at the top of your plugin:
new bool:g_red
And change
PHP Code:
set_hudmessage( g_current_color_red, g_current_color_green, g_current_color_blue,0.15, 0.15, 0, 0.0, 1.0, 0.1, 0.1, 1 )
to:
PHP Code:
public show_hud_msg(){
if(g_red){
set_hudmessage( 0, 0, 255,0.15, 0.15, 0, 0.0, 1.0, 0.1, 0.1, 1 )
g_red = false;
}else{
set_hudmessage( 255, 0, 0,0.15, 0.15, 0, 0.0, 1.0, 0.1, 0.1, 1 )
g_red = true;
}
show_hudmessage(0, "Colours are switching...")
}
Now every time when you execute function it will set 1 second hud message with switched colors.
So if you want message stays 10 seconds on screen and the color switches every second from red to blue and vice versa then set task, like:
PHP Code:
set_task(1.0,"show_hud_msg",_,_,_,"a", 10)