Raised This Month: $32 Target: $400
 8% 

Rainbow HUD messages using the HSV color model


Post New Thread Reply   
 
Thread Tools Display Modes
ToriQQ
Member
Join Date: Mar 2010
Old 09-02-2010 , 08:23   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #11

can anyone teach how to use this in sma?
__________________

ToriQQ is offline
albert123
Veteran Member
Join Date: Mar 2009
Location: VietNam, Hai Phong
Old 09-05-2010 , 21:40   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #12

Can someone show me a screenshot about rainbow message ?
__________________
albert123 is offline
bruno_cso
Junior Member
Join Date: Jul 2010
Old 12-09-2010 , 11:17   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #13

how to add this code in a SMA clock?
__________________
[IMG]http://img18.**************/img18/8814/full20teamdu1.gif[/IMG]
bruno_cso is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-09-2010 , 17:45   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #14

Something like this:

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "HSV to RGB HUD Message Test", "0.0.1", "Exolent" );         register_clcmd( "say /msg", "CmdMessage" ); } public client_disconnect( iPlayer ) {     remove_task( iPlayer ); } public CmdMessage( iPlayer ) {     remove_task( iPlayer );         new iParams[ 1 ];     iParams[ 0 ] = _:0.0;         set_task( 0.1, "TaskShowMessage", iPlayer, iParams, 1 ); } public TaskShowMessage( iParams[ ], iPlayer ) {     new Float:flDegrees = Float:iParams[ 0 ];         new Float:flRed, Float:flGreen, Float:flBlue;     HSVtoRGB( flDegrees, 1.0, 1.0, flRed, flGreen, flBlue );         set_hudmessage( floatround( flRed ), floatround( flGreen ), floatround( flBlue ), 0.23, 0.05, .holdtime = 0.2, .channel = 1 );     show_hudmessage( iPlayer, "Rainbow Message!" );         if( ++flDegrees < 360.0 )     {         iParams[ 0 ] = _:flDegrees;         set_task( 0.1, "TaskShowMessage", iPlayer, iParams, 1 );     } } HSVtoRGB(&Float:h, Float:s, Float:v, &Float:r, &Float:g, &Float:b){  if(h > 360.0) h -= 360.0  else if(h < 0.0) h += 360.0  if (s == 0) {   r = v;  g = v;  b = v;  } else {   new Float:fHue, Float:fValue, Float:fSaturation;   new i;  new Float:f;  new Float:p,Float:q,Float:t;   if (h == 360.0) h = 0.0;   fHue = h / 60.0;   i = floatround(fHue,floatround_floor);   f = fHue - i;   fValue = v;   fSaturation = s;   p = fValue * (1.0 - fSaturation);   q = fValue * (1.0 - (fSaturation * f));   t = fValue * (1.0 - (fSaturation * (1.0 - f)));   switch (i) {    case 0: {r = fValue; g = t; b = p;}    case 1: {r = q; g = fValue; b = p; }    case 2: {r = p; g = fValue; b = t;}    case 3: {r = p; g = q; b = fValue;}    case 4: {r = t; g = p; b = fValue;}    case 5: {r = fValue; g = p; b = q; }   }  } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 12-12-2010 at 23:53.
Exolent[jNr] is offline
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 12-12-2010 , 04:04   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #15

Nice one
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
bibu
Veteran Member
Join Date: Sep 2010
Old 12-12-2010 , 06:41   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #16

Exolent:

Quote:
Warning: Tag mismatch on line 32
bibu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-12-2010 , 23:54   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #17

Quote:
Originally Posted by bibu View Post
Exolent:
Fixed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bruno_cso
Junior Member
Join Date: Jul 2010
Old 12-21-2010 , 09:22   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #18

Exolent[jNr]

How I add this code in the plugin the clock in HUD?

could you help me?
__________________
[IMG]http://img18.**************/img18/8814/full20teamdu1.gif[/IMG]
bruno_cso is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-21-2010 , 15:59   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #19

You would remove it individually for each player and do for all players (unless you wanted it for specific players).
Then just keep the task repeating.

Code:
#include < amxmodx > const Float:TIME_INTERVAL = 0.1; const Float:DEGREES_INTERVAL = 1.0; new Float:g_flDegrees = 0.0; public plugin_init( ) {     register_plugin( "Rainbow Clock", "0.0.1", "Exolent" );         set_task( TIME_INTERVAL, "TaskShowClock", .flags = "b" ); } public TaskShowClock( ) {     new Float:flRed, Float:flGreen, Float:flBlue;     HSVtoRGB( g_flDegrees, 1.0, 1.0, flRed, flGreen, flBlue );         new szTime[ 32 ];     format_time( szTime, charsmax( szTime ), "%I:%M:%S %p" );         set_hudmessage( floatround( flRed ), floatround( flGreen ), floatround( flBlue ), 0.23, 0.05, .holdtime = ( TIME_INTERVAL + 0.1 ), .channel = 1 );     show_hudmessage( 0, "%s", szTime );         g_flDegrees += DEGREES_INTERVAL;         while( g_flDegrees >= 360.0 ) g_flDegrees -= 360.0;     while( g_flDegrees <    0.0 ) g_flDegrees += 360.0; } HSVtoRGB(&Float:h, Float:s, Float:v, &Float:r, &Float:g, &Float:b){  if(h > 360.0) h -= 360.0  else if(h < 0.0) h += 360.0  if (s == 0) {   r = v;  g = v;  b = v;  } else {   new Float:fHue, Float:fValue, Float:fSaturation;   new i;  new Float:f;  new Float:p,Float:q,Float:t;   if (h == 360.0) h = 0.0;   fHue = h / 60.0;   i = floatround(fHue,floatround_floor);   f = fHue - i;   fValue = v;   fSaturation = s;   p = fValue * (1.0 - fSaturation);   q = fValue * (1.0 - (fSaturation * f));   t = fValue * (1.0 - (fSaturation * (1.0 - f)));   switch (i) {    case 0: {r = fValue; g = t; b = p;}    case 1: {r = q; g = fValue; b = p; }    case 2: {r = p; g = fValue; b = t;}    case 3: {r = p; g = q; b = fValue;}    case 4: {r = t; g = p; b = fValue;}    case 5: {r = fValue; g = p; b = q; }   }  } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bruno_cso
Junior Member
Join Date: Jul 2010
Old 12-22-2010 , 10:33   Re: Rainbow HUD messages using the HSV color model
Reply With Quote #20

Exolent[jNr]


I have wanted this SMA and adds this code most wanted green leaves with a white light through.

SMA

PHP Code:
#include <amxmodx>
#include <amxmisc>



#define PLUGIN    "Data e Hora"

#define VERSION    "1.0"

#define AUTHOR    "Edited"



#define UPDATE_RATE 1.0


public plugin_init() {

    
register_plugin(PLUGINVERSIONAUTHOR);
   
    
set_task(UPDATE_RATE,"UpdateTime",_,_,_,"b");

}



public 
UpdateTime()


    new 
iPlayers[32],iNum,i;

    
get_players(iPlayers,iNum,"c");

   

    new 
Time[54];

    
get_time("Cs Elite Br^nData:%d/%m/%Y^nHora:%H:%M:%S",Time,53);

   

    for(
0<= iNumi++)

    {

        new 
id iPlayers[i];

        if(!
is_user_connected(id)) continue;

       

        
set_hudmessage(000,255,0000.800.0801.01.03.05.02);

        
show_hudmessage(id"%s"Time);

    }

}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/ 
SMA that I want to let everyone see the clock.
__________________
[IMG]http://img18.**************/img18/8814/full20teamdu1.gif[/IMG]

Last edited by bruno_cso; 12-23-2010 at 22:04. Reason: reason for posting the SMA.
bruno_cso is offline
Reply



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 13:22.


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