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

[REQ] Show the number of enemy players that are still alive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-19-2018 , 09:52   [REQ] Show the number of enemy players that are still alive
Reply With Quote #1

I would like to request a plugin that displays the number of enemy players that are still alive.
Players has to be able to enable/disable this feature, and it should be disabled by default.

It should look something like this, but I dont want the color to be blue.
I think its less invasive if it matches the rest of the HUD.

It would be much appreciated!



edit: This is what I was able to put together, it does not work.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "gn_enemiesleft" #define VERSION "0.1" #define AUTHOR "GoldNux" public plugin_init() {     set_hudmessage(0, 255, 0, 0.009, 0.00, 0, 6.0, 105.0, 0.3, 0.3, 1)     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("HLTV", "eventNewRound", "a", "1=0", "2=0")     register_event( "DeathMsg" , "registerDeath" , "a" ); } new playersT[32] new playersCT[32] new playerCount_T new playerCount_CT new playersAliveT new playersAliveCT public eventNewRound() {     get_players(playersCT, playerCount_CT, "e", "CT")     get_players(playersT, playerCount_T, "e", "T")     playersAliveT = playerCount_T     playersAliveCT = playerCount_CT     new iCT     for (iCT = 0; iCT < playerCount_CT; iCT++)     show_hudmessage(playersCT[iCT], "%d", playersAliveT)     new iT     for (iT = 0; iT < playerCount_T; iT++)     show_hudmessage(playersT[iT], "%d", playersAliveCT) } public registerDeath() {     new victim = read_data(2);     if (get_user_team(victim) == CS_TEAM_T)     {         playersAliveT--         updateCT_HUD     }     if (get_user_team(victim) == CS_TEAM_CT)     {         playersAliveCT--         updateT_HUD     } } public updateCT_HUD()     {         new i         for (i = 0; i < playerCount_CT; i++)         show_hudmessage(playersCT[i], "%d", playersAliveT)     } public updateT_HUD()     {         new i         for (i = 0; i < playerCount_T; i++)         show_hudmessage(playersT[i], "%d", playersAliveCT)     }
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 04-19-2018 at 15:10.
GoldNux is offline
Old 04-19-2018, 16:10
marcelowzd
This message has been deleted by marcelowzd. Reason: Nvm my amxx was buggy as fuck
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 04-19-2018 , 17:15   Re: [REQ] Show the number of enemy players that are still alive
Reply With Quote #2

Try.

Type /hud to enabled/disable hud.

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

new const g_sPlugin[ ] = "Show Alive";
new const 
g_sVersion[ ] = "0.0.1";
new const 
g_sAuthor[ ] = "wizard";

new const 
g_szEntClass[ ] = "HudThinker";

new const 
Float:g_fEntityTime 6.0// Change this to lower if you wish the HUD to update faster

new g_iMsgSync;

new 
bool:g_bUserHud33 ] = { false, ... };

new 
bool:g_bHideCMD false// Change to true if you wish to block /hud from showing on chat

public plugin_init() 
{
    
register_pluging_sPluging_sVersiong_sAuthor );
        
    
register_logevent"OnRoundStart"2"1=Round_Start" );
    
    
RegisterHamHam_Think"info_target""OnEntityThink");
    
    
register_event"DeathMsg""OnClientDeath""a" );
    
    
register_clcmd"say /hud""ClCmdHud" );
    
    
g_iMsgSync CreateHudSyncObj( );
}

public 
ClCmdHudiClient )
{
    
g_bUserHudiClient ] = !g_bUserHudiClient ];
    
    
client_printiClientprint_chat"Your HUD is now %s"g_bUserHudiClient ] ? "enabled" "disabled" );
    
    return ( 
g_bHideCMD == true PLUGIN_HANDLED PLUGIN_CONTINUE );
}

public 
plugin_precache( )
{
    new 
iEnt engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"info_target" ) );
    
    
set_peviEntpev_classnameg_szEntClass );
    
set_peviEntpev_nextthinkget_gametime( ) + 0.1 );
}

public 
client_putinserveriClient )
{
    
g_bUserHudiClient ] = false;
}

public 
OnEntityThinkiEnt )
{
    if( !
pev_validiEnt ) )
        return 
HAM_IGNORED;
        
    static 
szClassname32 ];
    
    
peviEntpev_classnameszClassnamecharsmaxszClassname ) );
    
    if( !
equaliszClassnameg_szEntClass ) )
        return 
HAM_IGNORED;
        
    
MakeHudAct( );    
    
    
set_peviEntpev_nextthinkget_gametime( ) + g_fEntityTime );
    
    return 
HAM_IGNORED;
}

public 
OnRoundStart( )
{    
    
MakeHudAct( );
}

public 
OnClientDeath( )
{
    
MakeHudAct( );
}

MakeHudAct( )
{    
    static 
iPlayersCT32 ], iNumCT;
    static 
iPlayersTR32 ], iNumTR;
    static 
iTotalPlayers32 ], iTotal;
    
    new 
iClientiCSTeamszMessage16 ];
    
    
get_playersiPlayersCTiNumCT"ae""CT" );
    
get_playersiPlayersTRiNumTR"ae""TERRORIST" );
    
get_playersiTotalPlayersiTotal );
    
    
set_hudmessage25500, -1.00.206.012.0 );
    
    for( new 
0iTotali++ )
    {
        
iClient iTotalPlayers];
        
        if( !
g_bUserHudiClient ] )
            continue;
            
        
iCSTeam cs_get_user_teamiClient );
                
        
ClearSyncHudiClientg_iMsgSync );
        
        switch( 
iCSTeam )
        {
            case 
CS_TEAM_CTformatexszMessagecharsmaxszMessage ), "Enemies: %i"iNumTR );
            case 
CS_TEAM_T:  formatexszMessagecharsmaxszMessage ), "Enemies: %i"iNumCT );
            case 
CS_TEAM_UNASSIGNEDCS_TEAM_SPECTATORformatexszMessagecharsmaxszMessage ), "" );
        }
            
        
ShowSyncHudMsgiClientg_iMsgSyncszMessage );
    }

__________________

Last edited by marcelowzd; 04-19-2018 at 17:16.
marcelowzd is offline
karimoo97
Member
Join Date: Apr 2018
Location: Tamazgha
Old 04-20-2018 , 07:05   Re: [REQ] Show the number of enemy players that are still alive
Reply With Quote #3

Hey,
you know what would be great ? Having it for both teams,and ofc the option to turn it off

RED NUMBER FOR ALIVE Ts - or / AND A BLEU ONE FOR CT's


It's just an idea,don't mind me it's his request
karimoo97 is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 04-20-2018 , 15:33   Re: [REQ] Show the number of enemy players that are still alive
Reply With Quote #4

Quote:
Originally Posted by karimoo97 View Post
Hey,
you know what would be great ? Having it for both teams,and ofc the option to turn it off

RED NUMBER FOR ALIVE Ts - or / AND A BLEU ONE FOR CT's


It's just an idea,don't mind me it's his request
I did exactly like this first but then i read again what OP wanted.

Anyway, if you really want this create a new request. (i'm not sure if i can post in this one)
__________________
marcelowzd is offline
karimoo97
Member
Join Date: Apr 2018
Location: Tamazgha
Old 04-20-2018 , 17:31   Re: [REQ] Show the number of enemy players that are still alive
Reply With Quote #5

Quote:
Originally Posted by karimoo97 View Post
It's just an idea,don't mind me it's his request
You are right sir, as i said,it's his request not mine,i just wanted to support his idea.

Greetings
karimoo97 is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-26-2018 , 00:11   Re: [REQ] Show the number of enemy players that are still alive
Reply With Quote #6

Not exactly what you where searching for but maybe you can use it: https://forums.alliedmods.net/showthread.php?t=291624

Check all the pages there are many versions of this plugin.

You can remove health.
People can turn it on and off.
Red and blue colors.

https://www.youtube.com/watch?v=ARNFHC3Mw9k

Last edited by 4ever16; 04-26-2018 at 00:14.
4ever16 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 18:52.


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