Raised This Month: $ Target: $400
 0% 

Show a sprite above teammate's head


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 09-03-2012 , 01:00   Show a sprite above teammate's head
Reply With Quote #1

In my CSDM server,the player models are kinda the same because of the dark vest both models are wearing.

I would appreciate if someone makes a plugin where there's a sprite above your teammate's head.

Edit: I found it,but it doesn't support CSDM....

http://forums.alliedmods.net/showthread.php?p=757275

Last edited by SyluxLockjaw100; 09-03-2012 at 02:48.
SyluxLockjaw100 is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 09-03-2012 , 05:10   Re: Show a sprite above teammate's head
Reply With Quote #2

TE_Playerattachment
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
FR0NTLINE
AlliedModders Donor
Join Date: Apr 2006
Location: Riverside Cali
Old 09-04-2012 , 01:13   Re: Show a sprite above teammate's head
Reply With Quote #3

What kind of sprite.
__________________
FR0NTLINE is offline
Send a message via AIM to FR0NTLINE Send a message via MSN to FR0NTLINE Send a message via Yahoo to FR0NTLINE
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 09-04-2012 , 02:28   Re: Show a sprite above teammate's head
Reply With Quote #4

Quote:
Originally Posted by FR0NTLINE View Post
What kind of sprite.
Any kind of sprite.
SyluxLockjaw100 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-04-2012 , 11:35   Re: Show a sprite above teammate's head
Reply With Quote #5

Try this, requires now hamsandwich module:

PHP Code:
    #include <amxmodx>
    #include <hamsandwich>

    #define PLUGIN_NAME     "Team Icon Spr"
    #define PLUGIN_VERSION  "1.0.4"
    #define PLUGIN_AUTHOR   "tuty"

    #define CT_SPRITE     "sprites/teamspr/ct_blue.spr"
    #define T_SPRITE     "sprites/teamspr/t_red.spr"

    
new g_ct_blue_spr;
    new 
g_t_red_spr;
    new 
g_sprtime;
    new 
g_plugin_mode;
    new 
g_cvarvalue;

    public 
plugin_init()
    {
        
register_pluginPLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR );
        
register_event"DeathMsg""remove_spr""a" );
        
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
        
register_clcmd"say /teamspr""CreateSprite" );
        
register_clcmd"say_team /teamspr""CreateSprite" );
        
register_clcmd"say /delspr""RemoveSprite" );
        
register_clcmd"say_team /delspr""RemoveSprite" );
        
g_sprtime register_cvar"teamspr_sprite_time""32767" );
        
g_plugin_mode register_cvar"teamspr_mode""1" );
        
register_dictionary"teamspr.txt" );
    }
    
    
    public 
plugin_precache()
    {
        
g_ct_blue_spr precache_modelCT_SPRITE );
        
g_t_red_spr precache_modelT_SPRITE );
    }
    
    
    public 
Ham_CBasePlayer_Spawn_Post(id)
    {
        if(
is_user_alive(id))
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );

        switch( 
g_cvarvalue )
        {
            case 
0: return HAM_IGNORED;
            case 
1Removeid );
            case 
2:
            {
                
message_beginMSG_ALLSVC_TEMPENTITY );
                
write_byteTE_PLAYERATTACHMENT );
                
write_byteid );
                
write_coord45 );
                
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
                
write_shortget_pcvar_numg_sprtime ) );
                
message_end();
            }
        }
        }
        
        return 
HAM_IGNORED;
    }
    
    
    public 
CreateSpriteid )
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );
        
        if( 
g_cvarvalue == )
        {
            
client_printidprint_chat"%L"id"CANNOT_CREATE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
Removeid );
            
            return 
PLUGIN_HANDLED;
        }
        
        else if( 
g_cvarvalue != )
        {
            
client_printidprint_chat"%L"id"ALLREADY_HAVE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }
        
        
message_beginMSG_ALLSVC_TEMPENTITY );
        
write_byteTE_PLAYERATTACHMENT );
        
write_byteid );
        
write_coord45 );
        
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
        
write_shortget_pcvar_numg_sprtime ) );
        
message_end();
    
        
client_printidprint_chat"%L"id"SUCCESSFULLY_CREATED" );
        
client_cmdid"speak fvox/activated.wav" );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
    public 
RemoveSpriteid )
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );
        
        if( 
g_cvarvalue == )
        {
            
client_printidprint_chat"%L"id"CANNOT_CREATE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }
        
        else if( 
g_cvarvalue != )
        {
            
client_printidprint_chat"%L"id"MUST_STAY_UP" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }    
        
        
Removeid );
        
client_printidprint_chat"%L"id"SUCCESSFULLY_DELETED" );
        
client_cmdid"speak fvox/deactivated.wav" );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
    public 
remove_spr()
    {
        
Removeread_data) );
    }
    
    
    
stock Removeindex )
    {
        
message_beginMSG_ALLSVC_TEMPENTITY );
        
write_byteTE_KILLPLAYERATTACHMENTS );
        
write_byteindex );
        
message_end();
    } 
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 09-04-2012 , 22:05   Re: Show a sprite above teammate's head
Reply With Quote #6

Quote:
Originally Posted by bibu View Post
Try this, requires now hamsandwich module:

PHP Code:
    #include <amxmodx>
    #include <hamsandwich>

    #define PLUGIN_NAME     "Team Icon Spr"
    #define PLUGIN_VERSION  "1.0.4"
    #define PLUGIN_AUTHOR   "tuty"

    #define CT_SPRITE     "sprites/teamspr/ct_blue.spr"
    #define T_SPRITE     "sprites/teamspr/t_red.spr"

    
new g_ct_blue_spr;
    new 
g_t_red_spr;
    new 
g_sprtime;
    new 
g_plugin_mode;
    new 
g_cvarvalue;

    public 
plugin_init()
    {
        
register_pluginPLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR );
        
register_event"DeathMsg""remove_spr""a" );
        
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
        
register_clcmd"say /teamspr""CreateSprite" );
        
register_clcmd"say_team /teamspr""CreateSprite" );
        
register_clcmd"say /delspr""RemoveSprite" );
        
register_clcmd"say_team /delspr""RemoveSprite" );
        
g_sprtime register_cvar"teamspr_sprite_time""32767" );
        
g_plugin_mode register_cvar"teamspr_mode""1" );
        
register_dictionary"teamspr.txt" );
    }
    
    
    public 
plugin_precache()
    {
        
g_ct_blue_spr precache_modelCT_SPRITE );
        
g_t_red_spr precache_modelT_SPRITE );
    }
    
    
    public 
Ham_CBasePlayer_Spawn_Post(id)
    {
        if(
is_user_alive(id))
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );

        switch( 
g_cvarvalue )
        {
            case 
0: return HAM_IGNORED;
            case 
1Removeid );
            case 
2:
            {
                
message_beginMSG_ALLSVC_TEMPENTITY );
                
write_byteTE_PLAYERATTACHMENT );
                
write_byteid );
                
write_coord45 );
                
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
                
write_shortget_pcvar_numg_sprtime ) );
                
message_end();
            }
        }
        }
        
        return 
HAM_IGNORED;
    }
    
    
    public 
CreateSpriteid )
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );
        
        if( 
g_cvarvalue == )
        {
            
client_printidprint_chat"%L"id"CANNOT_CREATE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
Removeid );
            
            return 
PLUGIN_HANDLED;
        }
        
        else if( 
g_cvarvalue != )
        {
            
client_printidprint_chat"%L"id"ALLREADY_HAVE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }
        
        
message_beginMSG_ALLSVC_TEMPENTITY );
        
write_byteTE_PLAYERATTACHMENT );
        
write_byteid );
        
write_coord45 );
        
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
        
write_shortget_pcvar_numg_sprtime ) );
        
message_end();
    
        
client_printidprint_chat"%L"id"SUCCESSFULLY_CREATED" );
        
client_cmdid"speak fvox/activated.wav" );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
    public 
RemoveSpriteid )
    {
        
g_cvarvalue get_pcvar_numg_plugin_mode );
        
        if( 
g_cvarvalue == )
        {
            
client_printidprint_chat"%L"id"CANNOT_CREATE" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }
        
        else if( 
g_cvarvalue != )
        {
            
client_printidprint_chat"%L"id"MUST_STAY_UP" );
            
client_cmdid"speak buttons/blip1.wav" );
            
            return 
PLUGIN_HANDLED;
        }    
        
        
Removeid );
        
client_printidprint_chat"%L"id"SUCCESSFULLY_DELETED" );
        
client_cmdid"speak fvox/deactivated.wav" );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
    public 
remove_spr()
    {
        
Removeread_data) );
    }
    
    
    
stock Removeindex )
    {
        
message_beginMSG_ALLSVC_TEMPENTITY );
        
write_byteTE_KILLPLAYERATTACHMENTS );
        
write_byteindex );
        
message_end();
    } 
Will try,thanks.

edit: It works,thanks alot!

Last edited by SyluxLockjaw100; 09-04-2012 at 22:27.
SyluxLockjaw100 is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 06-02-2021 , 16:16   Re: Show a sprite above teammate's head
Reply With Quote #7

Doesn't work in CZ with bots
The sprite does not appear above their heads, although toggling it on or off in reply in chat has no effect.
SoulWeaver16 is offline
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 00:38.


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