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

Solved Online player nicks in hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-16-2016 , 09:07   Online player nicks in hud
Reply With Quote #1

A plugin which shows players nicks in hud.

Terrorists to the left and red color.
Counter Terrorists to the right and blue color.
When someone dies he is removed from the list.
If possible it would be cool with kills and deaths like this: Player 1 | K: 10 | D: 10

When everyone is alive.

Terrorists
Counter Terrorists
Player 1
Player 1
Player 2
Player 2
Player 3
Player 3
Player 4
Player 4
Player 5
Player 5

When player 5 in ct dies.

Terrorists
Counter Terrorists
Player 1
Player 1
Player 2
Player 2
Player 3
Player 3
Player 4
Player 4
Player 5

Last edited by 4ever16; 01-10-2017 at 22:43.
4ever16 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2016 , 10:02   Re: [Searching] Player nicks in hud
Reply With Quote #2

PHP Code:
#include <amxmodx>

new g_iHudSync[2]

public 
plugin_init()
{
    
register_plugin("Players on HUD""1.0""OciXCrom")
    
g_iHudSync[0] = CreateHudSyncObj()
    
g_iHudSync[1] = CreateHudSyncObj()
    
set_task(1.0"ShowPlayers", .flags "b")
}
    
public 
ShowPlayers()
{    
    new 
szMessage[192], szName[16], iPlayers[32], iPnum
    
    get_players
(iPlayersiPnum"ae""TERRORIST")
    
copy(szMessagecharsmax(szMessage), "Terrorists:^n")
    
    for(new 
iiPnumi++)
    {
        
get_user_name(iPlayers[i], szNamecharsmax(szName))
        
format(szMessagecharsmax(szMessage), "%s^n%s"szMessageszName)
    }
    
    
set_hudmessage(255000.020.201.01.0)
    
ShowSyncHudMsg(0g_iHudSync[0], szMessage)
    
    
get_players(iPlayersiPnum"ae""CT")
    
copy(szMessagecharsmax(szMessage), "Counter-Terrorists:^n")
    
    for(new 
iiPnumi++)
    {
        
get_user_name(iPlayers[i], szNamecharsmax(szName))
        
format(szMessagecharsmax(szMessage), "%s^n%s"szMessageszName)
    }
    
    
set_hudmessage(002550.880.201.01.0)
    
ShowSyncHudMsg(0g_iHudSync[1], szMessage)

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-16-2016 , 10:42   Re: [Searching] Player nicks in hud
Reply With Quote #3

Nice works good.
4ever16 is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-16-2016 , 11:13   Re: [Searching] Player nicks in hud
Reply With Quote #4

Nice works good.

Can you make so longer nicks can also be displayed?
Cause it only displays like 10 charecters only.

It would also be nice if kills and deaths are displayed before or after the nick but its not a must but would be cool.
4ever16 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2016 , 11:32   Re: [Searching] Player nicks in hud
Reply With Quote #5

Max player name = 32
Max players per team = 16
Max length of HUD message = 128 or 192 (not sure)

32x16 = 400+
Adding kills and deaths = 500+

500 or 400 > 192 or 128

Simple math explains it's not possible.
__________________

Last edited by OciXCrom; 12-16-2016 at 11:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-16-2016 , 11:46   Re: [Searching] Player nicks in hud
Reply With Quote #6

So not even longer names?
4ever16 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2016 , 12:13   Re: [Searching] Player nicks in hud
Reply With Quote #7

If the max legnth is 128, with max names it would be 160+, so no.
I need someone to tell me what's the max name of a HUD message, because I can't find it anywhere. I know it's 128 for DHUD, but I'm not sure if it's the same for HUD.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
JusTGo
Veteran Member
Join Date: Mar 2013
Old 12-16-2016 , 12:36   Re: [Searching] Player nicks in hud
Reply With Quote #8

i guess he only needs the hud for just 10 players so can change name size.
__________________
JusTGo is offline
Old 12-16-2016, 12:37
OciXCrom
This message has been deleted by OciXCrom.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2016 , 12:39   Re: [Searching] Player nicks in hud
Reply With Quote #9

10x32 = 320
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-16-2016 , 13:10   Re: [Searching] Player nicks in hud
Reply With Quote #10

So its possible?
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 19:19.


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