Raised This Month: $ Target: $400
 0% 

[HELP] Hud MSG Color ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-12-2016 , 08:45   [HELP] Hud MSG Color ?
Reply With Quote #1

Hi!
i want make Hud message display between two colors how i can do that ?

Such as lights
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-12-2016 , 15:12   Re: [HELP] Hud MSG Color ?
Reply With Quote #2

You want the color to change color every X seconds or have two colors at the same time?
OciXCrom is offline
Send a message via Skype™ to OciXCrom
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-13-2016 , 00:55   Re: [HELP] Hud MSG Color ?
Reply With Quote #3

i want the color balance in 1s between red and blue, for example, when the Red disappears it appears blue and vice versa
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-13-2016 , 07:08   Re: [HELP] Hud MSG Color ?
Reply With Quote #4

So, change color every X seconds then?
OciXCrom is offline
Send a message via Skype™ to OciXCrom
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-13-2016 , 23:58   Re: [HELP] Hud MSG Color ?
Reply With Quote #5

Can you give an example?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-14-2016 , 05:55   Re: [HELP] Hud MSG Color ?
Reply With Quote #6

Quote:
Originally Posted by abdobiskra View Post
Can you give an example?
Spoiler
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-14-2016 , 08:24   Re: [HELP] Hud MSG Color ?
Reply With Quote #7

addons_zz

Thanks but how to make them among the only two colors?

ex: Blue & yellow
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


new g_current_color_red 255
new g_current_color_green 255
new g_current_color_blue 255

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say g""show_last_round_HUD")
    
    
// Add your code here...
}
public 
show_last_round_HUD(id)
{
    
g_current_color_red = ( g_current_color_red 50 ) % 256
    g_current_color_green 
= ( g_current_color_green 40 ) % 256
    g_current_color_blue 
= ( g_current_color_blue 30 ) % 256

    set_hudmessage
g_current_color_redg_current_color_greeng_current_color_blue,0.150.1500.01.00.10.1)
    
show_hudmessage(id"BLALALALLALLALALLLLALLALALAL ?")
    
   
// client_print(0, print_chat, " Hellow World ")

__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-14-2016 , 08:57   Re: [HELP] Hud MSG Color ?
Reply With Quote #8

Quote:
Originally Posted by abdobiskra View Post
Thanks but how to make them among the only two colors?
Create an array for r, g, and b, where each one, contain the color tone. Them use this to access its color:
Code:
new g_current_color_tone_index = 1 new g_red_color_tone[] = { 255, 120 } new g_green_color_tone[] = { 255, 120 } new g_blue_color_tone[]= { 255, 120 } ... some_function() {     ...     g_current_color_tone_index = ( g_current_color_tone_index + 1 ) % 2     set_hudmessage( g_red_color_tone[g_current_color_tone_index ], g_green_color_tone[g_current_color_tone_index ],             g_blue_color_tone[g_current_color_tone_index ], 0.15, 0.15, 0, 0.0, 1.0, 0.1, 0.1, 1 )     ... }
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 01-14-2016 at 09:04. Reason: spelling fix
addons_zz is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-14-2016 , 09:54   Re: [HELP] Hud MSG Color ?
Reply With Quote #9

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_hudmessageg_current_color_redg_current_color_greeng_current_color_blue,0.150.1500.01.00.10.1
to:

PHP Code:
public show_hud_msg(){
if(
g_red){
set_hudmessage00255,0.150.1500.01.00.10.1)
g_red false;
}else{
set_hudmessage25500,0.150.1500.01.00.10.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

Last edited by siriusmd99; 01-14-2016 at 10:01.
siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-16-2016 , 11:19   Re: [HELP] Hud MSG Color ?
Reply With Quote #10

I want to make the red color appears for 3 seconds before change to red and then the blue color shows for 3 seconds before change to red also ? how can i do that ?
__________________

Last edited by abdobiskra; 01-16-2016 at 11:53.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode