Page 1 of 1

[TUT] User Icon Status

Posted: Fri Sep 25, 2026 5:06 pm
by Archive-Poster
On this tutorial, I will examplain / show examples about user status icon.
Status icon is a hud icon placed in the screen of player, and is used in some cases for indicates user status.
Can use this for example if an player have on him equip and rocket laucher, to show an icon to indicate that ; it's for aspect ;)

To make to show at a player an hud icon, the icon must be created in a message constant.
Now, let's start:
• First of all, we will declare a variabile for get user msgid. Variable will be called iconstatus.
So,

Code: Select all

new iconstatus 
• In plugin_init, we use variable:

Code: Select all

iconstatus = get_user_msgid("StatusIcon") 
• Like how i alearly said, we will make to show the status icon with a message constant.
We start with:

Code: Select all

message_begin(MSG_ONE,iconstatus,{0,0,0},id)
• After, we will write a byte with the type of show:
Are available 3 types of show:
0 = Hide
1 = Show
2 = Flash
So we wil use:

Code: Select all

write_byte(1)
That means will show the icon status.

• After, will write string the name of sprite icon
Are available 88 icon status.

1. dmg_rad:
2. dmg_heat:
3. dmg_gas:
4. dmg_drown:
5. dmg_cold:
6. dmg_bio:
7. dmg_shock:
8. item_longjump:
9. item_battery:
10. item_healthkit:
11. flash_beam:
12. d_knife:
Also are available all weapons with prefix d_* .Ex: d_ak47, d_awp, d_mp5navy.
13. cross:
14. stopwatch:
15. suit_full:

So, we will use

Code: Select all

write_string("sprite name")
• Now we will write the color of icon, in rgb format:

Code: Select all

 write_byte(r)
 write_byte(b)
 write_byte(g) 
• And finish the message constant

Code: Select all

message_end() 
And complete example, to show an hud icon with icon when user is on air

Code: Select all

#include <amxmodx>
#include <fakemeta>


new iconstatus;

public plugin_init() {
    register_plugin("Status Icon","0.1","SAMURAI");
    
    register_forward(FM_PlayerPreThink,"fw_prethink");
    iconstatus = get_user_msgid("StatusIcon");
    
}

public fw_prethink(id)
{
    if(!(pev(id,pev_button) & FL_ONGROUND))
    {    
        message_begin(MSG_ONE,iconstatus,{0,0,0},id);
        write_byte(1); // status (0=hide, 1=show, 2=flash)
        write_string("dmg_poison"); // sprite name
        write_byte(0); // red
        write_byte(255); // green
        write_byte(0); // blue
        message_end();
    }
    
} 
Anyway, i saw some request with list of all icons;
There is..

Code: Select all

selection            
bucket1               
bucket2               
bucket3               
bucket4                
bucket5                
bucket0                
dmg_bio                
dmg_poison           
dmg_chem            
dmg_cold        
dmg_drown            
dmg_heat           
dmg_gas               
dmg_rad                
dmg_shock            
number_0            
number_1            
number_2          
number_3            
number_4            
number_5           
number_6            
number_7            
number_8           
number_9            
divider                
cross                
dollar               
minus                
plus               
c4                
defuser              
stopwatch           
smallskull              
smallc4             
smallvip               
buyzone               
rescue               
escape            
vipsafety            
suit_full            
suit_empty           
suithelmet_full            
suithelmet_empty      
flash_full           
flash_empty            
flash_beam            
train_back          
train_stop            
train_forward1            
train_forward2            
train_forward3          
autoaim_c            
title_half           
title_life            
d_knife                   
d_ak47                  
d_awp                      
d_deagle            
d_flashbang            
d_fiveseven            
d_g3sg1                
d_glock18            
d_grenade            
d_m249               
d_m3                
d_m4a1                
d_mp5navy            
d_p228               
d_p90                
d_scout               
d_sg550               
d_sg552               
d_ump45          
d_usp                
d_tmp                
d_xm1014            
d_skull               
d_tracktrain            
d_aug                    
d_mac10                
d_elite                
d_headshot               
item_battery            
item_healthkit            
item_longjump           
radar