AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Can't make colored DHUD message (noob) (https://forums.alliedmods.net/showthread.php?t=334046)

kww 08-25-2021 07:10

Can't make colored DHUD message (noob)
 
So I wanna ask some help from SUPER MEGA PRO scripters.
When i show message it appears in white color
PHP Code:

// define colors
enum _:sc {
    
sc_OLD 0,
    
sc_CT,
    
sc_T,
    
sc_WHITE,
}

new 
color_R[sc] = {251185232200}
new 
color_G[sc] = {126211211200}
new 
color_B[sc] = {20234141200}

// somewhere in the code I run a simple task
public message_send(taskid)
{
    static 
selected
    
    
switch(someStatement)
    {
        case 
1:
        {
            
selected sc_CT
        
}
        case 
2:
        {
            
selected sc_T
        
}
        case 
3:
        {
            
selected sc_WHITE
        
}
    }
    
    static 
rgb
    
    r 
color_R[selected]
    
color_G[selected]
    
color_B[selected]
    
    
// format message
    
static szText[128]
    
formatex(szTextcharsmax(szText), "Some text here")
    
    
// set color and show message
    // everything is predetermined here except color and everything works except color
    
set_dhudmessage(rgbpos_Xpos_YDH_FXDH_FX_TIMEDH_HOLD_TIMEDH_FADEINDH_FADEOUT)
    
show_dhudmessage(0szText)



Shadows Adi 08-25-2021 09:44

Re: Can't make colored DHUD message (noob)
 
Well, it's obvious that your "someStatement" is returning value 3, so check where you set it's value.

kww 08-25-2021 12:29

Re: Can't make colored DHUD message (noob)
 
oh man it worked but colors are too bright in cs 1.6
When I picked 'em in photoshop they looked nice


All times are GMT -4. The time now is 02:33.

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