Raised This Month: $51 Target: $400
 12% 

Rainbow TEXT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-22-2022 , 12:15   Rainbow TEXT
Reply With Quote #1

Hello, someone know how can i create animated rainbow hud text without SetHudTextParamsEx or rainbow color entity?
I know how stupid it is but I need it

Last edited by Grafi_; 07-22-2022 at 14:01.
Grafi_ is offline
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-23-2022 , 11:22   Re: Rainbow TEXT
Reply With Quote #2

https://youtu.be/TCpUxAh-bdM
could someone point me to this?

Last edited by Grafi_; 07-23-2022 at 11:23.
Grafi_ is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 07-23-2022 , 12:00   Re: Rainbow TEXT
Reply With Quote #3

Quote:
Originally Posted by Grafi_ View Post
https://youtu.be/TCpUxAh-bdM
could someone point me to this?
it's fade
PHP Code:
/*
#define USERMSG_RELIABLE    (1<<2)    4    Message will be set to reliable
#define USERMSG_INITMSG        (1<<3)    8    Message will be considered to be an initmsg
#define USERMSG_BLOCKHOOKS    (1<<7)    128    Prevents the message from triggering SourceMod and Metamod hooks

#define FFADE_IN        0x0001    1    // Just here so we don't pass 0 into the function
#define FFADE_OUT        0x0002    2    // Fade out (not in)
#define FFADE_MODULATE    0x0004    4    // Modulate (don't blend)
#define FFADE_STAYOUT    0x0008    8    // ignores the duration, stays faded out until new ScreenFade message received
#define FFADE_PURGE        0x0010    16    // Purges all other fades, replacing them with this one
*/
stock void CreateFade(int clientint duration 500int holdtime 0, const int color 0x000000)
{
    
Handle msg StartMessageOne("Fade"client132);    // USERMSG_RELIABLE|USERMSG_BLOCKHOOKS
    
if(GetUserMessageType() == UM_Protobuf)
    {
        
PbSetInt(msg,    "duration",    duration);        // Fade duration
        
PbSetInt(msg,    "hold_time",holdtime);        // Fade hold time
        
PbSetInt(msg,    "flags",    0x0001|0x0010);    // What to do
        
PbSetColor(msg,    "clr",        color);            // Color RGBA
    
}
    else
    {
        
BfWriteShort(msg,    duration);                        // Fade duration
        
BfWriteShort(msg,    holdtime);                        // Fade hold time
        
BfWriteShort(msg,    0x0001|0x0010);                    // What to do
        
BfWriteByte(msg,    (color 0xFF000000) >>> 24);    // Red
        
BfWriteByte(msg,    (color 0xFF0000) >> 16);        // Green
        
BfWriteByte(msg,    (color 0xFF00) >> 8);            // Blue
        
BfWriteByte(msg,    color 0xFF);                    // Alpha
    
}
    
EndMessage();

__________________

Last edited by Grey83; 07-23-2022 at 12:01.
Grey83 is offline
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-23-2022 , 12:14   Re: Rainbow TEXT
Reply With Quote #4

Quote:
Originally Posted by Grey83 View Post
it's fade
PHP Code:
/*
#define USERMSG_RELIABLE    (1<<2)    4    Message will be set to reliable
#define USERMSG_INITMSG        (1<<3)    8    Message will be considered to be an initmsg
#define USERMSG_BLOCKHOOKS    (1<<7)    128    Prevents the message from triggering SourceMod and Metamod hooks

#define FFADE_IN        0x0001    1    // Just here so we don't pass 0 into the function
#define FFADE_OUT        0x0002    2    // Fade out (not in)
#define FFADE_MODULATE    0x0004    4    // Modulate (don't blend)
#define FFADE_STAYOUT    0x0008    8    // ignores the duration, stays faded out until new ScreenFade message received
#define FFADE_PURGE        0x0010    16    // Purges all other fades, replacing them with this one
*/
stock void CreateFade(int clientint duration 500int holdtime 0, const int color 0x000000)
{
    
Handle msg StartMessageOne("Fade"client132);    // USERMSG_RELIABLE|USERMSG_BLOCKHOOKS
    
if(GetUserMessageType() == UM_Protobuf)
    {
        
PbSetInt(msg,    "duration",    duration);        // Fade duration
        
PbSetInt(msg,    "hold_time",holdtime);        // Fade hold time
        
PbSetInt(msg,    "flags",    0x0001|0x0010);    // What to do
        
PbSetColor(msg,    "clr",        color);            // Color RGBA
    
}
    else
    {
        
BfWriteShort(msg,    duration);                        // Fade duration
        
BfWriteShort(msg,    holdtime);                        // Fade hold time
        
BfWriteShort(msg,    0x0001|0x0010);                    // What to do
        
BfWriteByte(msg,    (color 0xFF000000) >>> 24);    // Red
        
BfWriteByte(msg,    (color 0xFF0000) >> 16);        // Green
        
BfWriteByte(msg,    (color 0xFF00) >> 8);            // Blue
        
BfWriteByte(msg,    color 0xFF);                    // Alpha
    
}
    
EndMessage();

oo thank you but I have one question, it is possible to use this on entity?
https://i.imgur.com/omxXVIk.png

Last edited by Grafi_; 07-23-2022 at 12:59.
Grafi_ is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 07-23-2022 , 12:43   Re: Rainbow TEXT
Reply With Quote #5

Quote:
Originally Posted by Grafi_ View Post
oo thank you but I have one question, it is possible to use this on entity?
How?
This effect can be applied to the player and only he will see it.
__________________
Grey83 is offline
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-23-2022 , 13:22   Re: Rainbow TEXT
Reply With Quote #6

Quote:
Originally Posted by Grey83 View Post
How?
This effect can be applied to the player and only he will see it.
oh okay thanks for that, but I still need something that will work on the player model or object
example:
changing player model/object color like this https://youtu.be/TCpUxAh-bdM
Grafi_ is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 07-23-2022 , 14:25   Re: Rainbow TEXT
Reply With Quote #7

Quote:
Originally Posted by Grafi_ View Post
changing player model/object color like this
PHP Code:
stock void SetEntityColor(int entRenderMode mode RENDER_TRANSCOLORint r 255int g 255int b 255int a 255)
{
    
SetEntityRenderMode(entmode);
    
SetEntityRenderColor(entrgba);

__________________
Grey83 is offline
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-23-2022 , 14:34   Re: Rainbow TEXT
Reply With Quote #8

Quote:
Originally Posted by Grey83 View Post
PHP Code:
stock void SetEntityColor(int entRenderMode mode RENDER_TRANSCOLORint r 255int g 255int b 255int a 255)
{
    
SetEntityRenderMode(entmode);
    
SetEntityRenderColor(entrgba);

thank you for trying, but i want these colors to change smoothly, just like in the video

Last edited by Grafi_; 07-23-2022 at 14:35.
Grafi_ is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 07-23-2022 , 14:49   Re: Rainbow TEXT
Reply With Quote #9

Quote:
Originally Posted by Grafi_ View Post
i want these colors to change smoothly, just like in the video
like this for example:
PHP Code:
int iSpeed 3// 0 <= iSpeed <=8
    
iColor[3];
float fRefresh 0.1// 0.1 <= fRefresh <= 1.0

public void OnMapStart()
{
    
CreateTimer(fRefreshTimer_Refresh_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Refresh(Handle timer)
{
    static 
int ij;
    if(
20;
    if(
02;

    if(
iColor[i] < 255)
    {
        
iColor[i] += iSpeed;
        if(
iColor[i] > 254)
        {
            
iColor[i] = 255;
            
1;
        }
    }
    else
    {
        
iColor[j] -= iSpeed;
        if(
iColor[j] < 1)
        {
            
iColor[j] = 0;
            
i++;
        }
    }

    for(
int x 1<= MaxClientsx++) if(IsPlayerValid(x)) SetEntityColor(x_iColor[0], iColor[1], iColor[2]);

    return 
Plugin_Continue;
}

stock void SetEntityColor(int entRenderMode mode RENDER_TRANSCOLORint r 255int g 255int b 255int a 255)
{
    
SetEntityRenderMode(entmode);
    
SetEntityRenderColor(entrgba);
}

stock bool IsPlayerValid(int ent)
{
    return 
IsClientInGame(ent) && !IsClientSourceTV(ent) && IsPlayerAlive(ent);

__________________
Grey83 is offline
Grafi_
Junior Member
Join Date: Apr 2022
Location: Poland
Old 07-25-2022 , 15:25   Re: Rainbow TEXT
Reply With Quote #10

Quote:
Originally Posted by Grey83 View Post
like this for example:
PHP Code:
int iSpeed 3// 0 <= iSpeed <=8
    
iColor[3];
float fRefresh 0.1// 0.1 <= fRefresh <= 1.0

public void OnMapStart()
{
    
CreateTimer(fRefreshTimer_Refresh_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Refresh(Handle timer)
{
    static 
int ij;
    if(
20;
    if(
02;

    if(
iColor[i] < 255)
    {
        
iColor[i] += iSpeed;
        if(
iColor[i] > 254)
        {
            
iColor[i] = 255;
            
1;
        }
    }
    else
    {
        
iColor[j] -= iSpeed;
        if(
iColor[j] < 1)
        {
            
iColor[j] = 0;
            
i++;
        }
    }

    for(
int x 1<= MaxClientsx++) if(IsPlayerValid(x)) SetEntityColor(x_iColor[0], iColor[1], iColor[2]);

    return 
Plugin_Continue;
}

stock void SetEntityColor(int entRenderMode mode RENDER_TRANSCOLORint r 255int g 255int b 255int a 255)
{
    
SetEntityRenderMode(entmode);
    
SetEntityRenderColor(entrgba);
}

stock bool IsPlayerValid(int ent)
{
    return 
IsClientInGame(ent) && !IsClientSourceTV(ent) && IsPlayerAlive(ent);

Thanks!
Grafi_ 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:56.


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