Raised This Month: $4 Target: $400
 1% 

Names of members team above head


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sanimare
Member
Join Date: Sep 2010
Old 11-23-2019 , 15:21   Names of members team above head
Reply With Quote #1

Hi,

i have this code, and it's working only when i aim my teammates.
If it can show constant teamnames above head it would be cool.


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

new gCvarEnable;
new 
gCvarAlpha;
new 
gCvarShowNames;
new 
gMaxPlayers;
new 
gHudSyncObj;
new 
gPlayerTeam[33];

new 
bool:gPlayerSolid[33];
new 
bool:gPlayerRestore[33];

public 
plugin_init() 
{
    
register_plugin("HNS_SEMICLIP""1.0""Jon");
        
    
gCvarEnable register_cvar("hns_teamsemiclip""1");
    
gCvarAlpha register_cvar("hns_teamsemiclip_alpha""200")
    
gCvarShowNames register_cvar("hns_teamsemiclip_shownames""1")
    
gMaxPlayers get_maxplayers();
    
    
register_forward(FM_AddToFullPack"fwd_AddToFullPack"1);
    
register_forward(FM_PlayerPreThink"fwd_PlayerPreThink"0);
    
register_forward(FM_PlayerPostThink"fwd_PlayerPostThink"0);
}

public 
plugin_precache()
    
gHudSyncObj CreateHudSyncObj();

public 
fwd_AddToFullPack(eseenthosthostflagsplayerpSet)
{
    if(
get_pcvar_num(gCvarEnable))
    {
        if(
player)
        {
            if(
gPlayerSolid[host] && gPlayerSolid[ent] && gPlayerTeam[host] == gPlayerTeam[ent])
            {
                
set_es(esES_SolidSOLID_NOT);
                
set_es(esES_RenderModekRenderTransAlpha);
                
set_es(esES_RenderAmtget_pcvar_num(gCvarAlpha));
            }
        }
    }
}

FirstThink()
{
    for(new 
1<= gMaxPlayersi++)
    {
        if(!
is_user_alive(i))
        {
            
gPlayerSolid[i] = false;
            continue;
        }
        
        
gPlayerTeam[i] = get_user_team(i);
        
gPlayerSolid[i] = pev(ipev_solid) == SOLID_SLIDEBOX true false;
    }
}

public 
fwd_PlayerPreThink(id)
{
    if(
get_pcvar_num(gCvarEnable))
    {
        if(
get_pcvar_num(gCvarShowNames) && is_user_alive(id))
        {
            new 
Target
            
new Temp
        
            get_user_aiming
(idTargetTemp9999)
            
            if(
Target && get_user_team(id) == get_user_team(Target))
            {
                new 
TargetName[32]
                
get_user_name(TargetTargetName31)
                
                switch(
get_user_team(id))
                {
                    case 
1set_hudmessage(25500, -1.00.4000.00.10.00.02);
                    case 
2set_hudmessage(00255, -1.00.4000.00.10.00.02);
                }
                
                
ShowSyncHudMsg(idgHudSyncObj"%s"TargetName)
            }
        }
        
        static 
iLastThink;
        
        if(
LastThink id)
        {
            
FirstThink();
        }
    }
}

public 
fwd_PlayerPostThink(id)
{
    if(
get_pcvar_num(gCvarEnable))
    {
        static 
i;
        
        for(
1<= gMaxPlayersi++)
        {
            if(
gPlayerRestore[i])
            {
                
set_pev(ipev_solidSOLID_SLIDEBOX);
                
gPlayerRestore[i] = false;
            }
        }
    }

Thank's
sanimare is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-23-2019 , 19:14   Re: Names of members team above head
Reply With Quote #2

You can't put an actual dynamic message in the game. It can only be on the screen like it is right now.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:38.


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