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

Can i change color inside dhudmessage?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 09-28-2013 , 13:03   Can i change color inside dhudmessage?
Reply With Quote #1

Hello i wonder if i can get the %s i green color

PHP Code:
public AdminSpray(id

    if(
get_user_flags(id) & ADMIN_CFG
    { 
        new 
szName32 ]; 
     
        
get_user_nameid szName 31 ); 
             
        
set_dhudmessage25500, -1.00.2526.03.00.11.5 );  
        
show_dhudmessage 0"[ACS]: %s Has Opened The Cells !"szName

Last edited by proffs; 09-28-2013 at 13:03.
proffs is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 09-28-2013 , 13:06   Re: Can i change color inside dhudmessage?
Reply With Quote #2

Color is set by the first 3 parameters in set_dhudmessage.
It uses the RGB color format.
__________________
<VeCo> is offline
proffs
Senior Member
Join Date: Jul 2013
Old 09-28-2013 , 13:10   Re: Can i change color inside dhudmessage?
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
Color is set by the first 3 parameters in set_dhudmessage.
It uses the RGB color format.
No I mean, %s (the name) Should be in green color the rest in red.
I mean 2 different colors
proffs is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 09-28-2013 , 13:12   Re: Can i change color inside dhudmessage?
Reply With Quote #4

Then you must use multiple HUD messages, which isn't good and won't work correctly.
__________________
<VeCo> is offline
proffs
Senior Member
Join Date: Jul 2013
Old 09-28-2013 , 13:12   Re: Can i change color inside dhudmessage?
Reply With Quote #5

Quote:
Originally Posted by <VeCo> View Post
Then you must use multiple HUD messages, which isn't good and won't work correctly.
so there is no way to use 2 diff colors?
proffs is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 09-28-2013 , 13:22   Re: Can i change color inside dhudmessage?
Reply With Quote #6

Quote:
Originally Posted by proffs View Post
so there is no way to use 2 diff colors?
in hud or dhud message, no, but maybe through a fake menu.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
proffs
Senior Member
Join Date: Jul 2013
Old 09-28-2013 , 13:23   Re: Can i change color inside dhudmessage?
Reply With Quote #7

Quote:
Originally Posted by <VeCo> View Post
Then you must use multiple HUD messages, which isn't good and won't work correctly.
Quote:
Originally Posted by pokemonmaster View Post
in hud or dhud message, no, but maybe through a fake menu.
sound interesting can you show me a example?
proffs is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-28-2013 , 13:40   Re: Can i change color inside dhudmessage?
Reply With Quote #8

I have made that plugin few months ago, so feel free to edit it by yourself

Here's pics how does it look like http://**************/gal.php?id=sJStkt2j3dKn1OPKmg
Attached Files
File Type: sma Get Plugin or Get Source (MenuMessages.sma - 517 views - 1.5 KB)

Last edited by ~Ice*shOt; 09-28-2013 at 13:44.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 09-28-2013 , 13:45   Re: Can i change color inside dhudmessage?
Reply With Quote #9

There are some many disadvantages in this.
  • You only have limited amount of colors (red [\r], yellow [\y], white [\w] and grey [\d])
  • You can't change it's position
  • Player's keys (12345) are blocked when the menu is shown (unless edited in some way)
  • other things that i forgot about (if there are any )

Quote:
Originally Posted by proffs View Post
sound interesting can you show me a example?
PHP Code:
#include <amxmodx>

public client_putinserver(id)
{
    
set_task(6.0"Show"id)
}

public 
Show(id)
{
    if(
is_user_connected(id))
    {
        
FakeMenuHud(id"\wThis is a test^n\rWow this is really working^n\yThis is amazing"5)
    }
}

FakeMenuHud(iTargetszMessage[], iTime 5)
{
    static 
bool:bRegistered
    
    
if(!bRegistered)
    {
        
register_menucmd(register_menuid("fake"), (1<<5), "fake")
        
bRegistered true
    
}
    
    
show_menu(iTarget, (1<<5), szMessageiTime"fake")
}

// Just to let menu show
public fake(idkey)
{
    return 
PLUGIN_CONTINUE // Don't let menu hide if key is pressed

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-28-2013 , 13:49   Re: Can i change color inside dhudmessage?
Reply With Quote #10

Quote:
Originally Posted by pokemonmaster View Post
[*] You can't change it's position
He can, but it's very poor way.

Last edited by ~Ice*shOt; 09-28-2013 at 13:49.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
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:47.


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