View Single Post
sanimare
Senior Member
Join Date: Sep 2010
Old 06-05-2020 , 08:05   Re: Glow instead of flashlight
Reply With Quote #9

Working perfect!

Can you just make it when you press F to show up glow for like 2 seconds and auto-disappear (cvar would be good or in sma) and showing glow only for team, you don't see enemy glow (cvar too or in sma) ?

Implementing "show name" would be great too.
I have some edited code that's working when you aim at player, can you implement with this plugin to show hud name too when he press F (cvar or in sma settings)?

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