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

[TUT] User Icon Status


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 03-13-2007 , 09:22   [TUT] User Icon Status
Reply With Quote #1

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,
PHP Code:
new iconstatus 
• In plugin_init, we use variable:
PHP Code:
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:
PHP Code:
 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:
PHP Code:
write_byte(1
That means will show the icon status.

• After, will write string the name of sprite icon
Are available 88 icon status.
I maked screenshots where i saw necessary one.

1. dmg_rad:
[IMG]http://img95.**************/img95/5918/dmgradmh4.jpg[/IMG]

2. dmg_heat:
[IMG]http://img178.**************/img178/4803/dmgheatnd4.jpg[/IMG]
3. dmg_gas:
[IMG]http://img72.**************/img72/3686/dmggaser1.jpg[/IMG]

4. dmg_drown:
[IMG]http://img72.**************/img72/6564/dmgdrownps5.jpg[/IMG]

5. dmg_cold:
[IMG]http://img291.**************/img291/7311/dmgcolddw9.jpg[/IMG]

6. dmg_bio:
[IMG]http://img246.**************/img246/9513/dmgbiokb4.jpg[/IMG]

7. dmg_shock:
[IMG]http://img50.**************/img50/8814/dmgshocksh9.jpg[/IMG]


8. item_longjump:
[IMG]http://img59.**************/img59/5223/itemlongjumpyr6.jpg[/IMG]


9. item_battery:
[IMG]http://img62.**************/img62/5586/itembatteryok3.jpg[/IMG]

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:

• I didn't take screenshots to all icons, because rests of them are just lines or stuff like that, and i don't saw any point to use it.
• I used name of icons but without screenshots because limit of images on a thread is 10
• I want to give some credits to Alka because helped me to make last snapshots .

So, we will use
PHP Code:
write_string("sprite name"
• Now we will write the color of icon, in rgb format:
PHP Code:
 write_byte(r)
 
write_byte(b)
 
write_byte(g
• And finnish the message constant
PHP Code:
message_end() 
And complete example, to show an hud icon with icon when user is on air

PHP Code:
#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 incons;
There is..
Code:
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


Have fun

Last edited by SAMURAI16; 03-18-2007 at 15:37. Reason: as per the rules, don't post using fonts different than what is normal. fixed.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Howdy!
Senior Member
Join Date: Feb 2007
Old 03-13-2007 , 09:31   Re: [TUT] User Icon Status
Reply With Quote #2

...
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]

Last edited by Howdy!; 04-22-2008 at 16:14.
Howdy! is offline
watch
Senior Member
Join Date: Sep 2005
Old 03-13-2007 , 09:57   Re: [TUT] User Icon Status
Reply With Quote #3

I know its just an example but it would be better to cache whether the player has been send the message rather than send it over and over. Then when they release attack, remove it. D:
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 03-14-2007 at 08:46.
watch is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-13-2007 , 10:20   Re: [TUT] User Icon Status
Reply With Quote #4

Furthermore this may lead to client's overflow.
VEN is offline
unikow
Member
Join Date: Mar 2007
Old 03-13-2007 , 11:56   Re: [TUT] User Icon Status
Reply With Quote #5

Quote:
Are available 9 icon status.
Where are the last 3???
unikow is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 03-13-2007 , 13:21   Re: [TUT] User Icon Status
Reply With Quote #6

Quote:
Originally Posted by unikow View Post
Where are the last 3???
ops, available are 6 ;)

2. Changed the example ;)

Last edited by SAMURAI16; 03-13-2007 at 13:26.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Drak
Veteran Member
Join Date: Jul 2005
Old 03-13-2007 , 15:10   Re: [TUT] User Icon Status
Reply With Quote #7

Wont this only work in CS?
Drak is offline
Send a message via MSN to Drak
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-13-2007 , 22:11   Re: [TUT] User Icon Status
Reply With Quote #8

Quote:
Originally Posted by SixTwin View Post
Wont this only work in CS?
AFAIK it should work across the board.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
sawce
The null pointer exception error and virtual machine bug
Join Date: Oct 2004
Old 03-13-2007 , 22:45   Re: [TUT] User Icon Status
Reply With Quote #9

StatusIcon is not in NS, and if memory serves it's not in DoD either. I'm not too sure aboot that one, though

It's in the standard SDK, so most mods still have it.
sawce is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-13-2007 , 23:07   Re: [TUT] User Icon Status
Reply With Quote #10

Quote:
Originally Posted by sawce View Post
StatusIcon is not in NS, and if memory serves it's not in DoD either. I'm not too sure aboot that one, though

It's in the standard SDK, so most mods still have it.
Yeah, but that's because Flayra disables like everything useful and fun.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply


Thread Tools
Display Modes

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 11:52.


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