Raised This Month: $ Target: $400
 0% 

Colored icon for c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 04-14-2011 , 11:55   Colored icon for c4
Reply With Quote #1

With cs_set_user_defuse, you can select the color of the icon. With c4 not. Is there any other easy way without using StatusIcon and checking for the icon name?
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-14-2011 , 13:49   Re: Colored icon for c4
Reply With Quote #2

You mean with cs_set_user_plant you can't ?
No, there is no easier way.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-14-2011 , 14:54   Re: Colored icon for c4
Reply With Quote #3

PHP Code:
  cs_set_user_defuse index, [ defusekit 101600icon[] = "defuser"flash ] ) 
PHP Code:
cs_set_user_plant index, [ plant 1showbombicon ] ) 
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-14-2011 , 21:05   Re: Colored icon for c4
Reply With Quote #4

PHP Code:
    RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn_Post"true)
}

public 
CBasePlayer_Spawn_Post(id)
{
    if( 
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T )
    {
        
give_item(id"weapon_c4")
        
cs_set_user_plant_ext(id112552550)
        
cs_set_user_submodel(id1)
    }
}

cs_set_user_plant_ext(indexplant 1showbombicon 1r=0g=160b=0)
{
    if( !
plant || !showbombicon || (!&& !&& g==160) )
    {
        return 
cs_set_user_plant(indexplantshowbombicon)
    }

    if( 
cs_set_user_plant(indexplant0) )
    {
        static 
iStatusIcon 0
        
if( !iStatusIcon )
        {
            
iStatusIcon get_user_msgid("StatusIcon")
        }

        
message_begin(MSG_ONEiStatusIcon, .player=index)
        
write_byte(1// show
        
write_string("c4")
        
write_byte(r)
        
write_byte(g)
        
write_byte(b)
        
message_end()
        return 
1
    
}
    return 
0

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-15-2011 , 18:11   Re: Colored icon for c4
Reply With Quote #5

Thanks, works perfectly. Is "cs_set_user_submodel" needed?
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-15-2011 , 18:27   Re: Colored icon for c4
Reply With Quote #6

Yes, to show the bomb on the player.
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-15-2011 , 18:28   Re: Colored icon for c4
Reply With Quote #7

Can't we see it if we just use give_item?
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-15-2011 , 18:29   Re: Colored icon for c4
Reply With Quote #8

I'm not sure if you only see it if nobody else has c4 or if you don't see it at all.
Just set it each time so you are sure it is shown, or set it to 0 if you want to hide bomber ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 04-15-2011, 18:29
Arkshine
This message has been deleted by Arkshine. Reason: *sigh*
bibu
Veteran Member
Join Date: Sep 2010
Old 04-15-2011 , 19:00   Re: Colored icon for c4
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
I'm not sure if you only see it if nobody else has c4 or if you don't see it at all.
Just set it each time so you are sure it is shown, or set it to 0 if you want to hide bomber ;)
Ok, thanks again.
bibu is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-15-2011 , 23:43   Re: Colored icon for c4
Reply With Quote #10

Just a curiosity, wouldn't hooking of StatusIcon message be more reliable ? It'll work for cs_set_user_plant() too I belive.
__________________

Last edited by Hunter-Digital; 04-15-2011 at 23:45.
Hunter-Digital is offline
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 20:12.


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