View Full Version : [Solved] Online player nicks in hud
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.
TerroristsCounter Terrorists
Player 1Player 1
Player 2Player 2
Player 3Player 3
Player 4Player 4
Player 5Player 5
When player 5 in ct dies.
TerroristsCounter Terrorists
Player 1Player 1
Player 2Player 2
Player 3Player 3
Player 4Player 4
Player 5
OciXCrom
12-16-2016, 10:02
#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(iPlayers, iPnum, "ae", "TERRORIST")
copy(szMessage, charsmax(szMessage), "Terrorists:^n")
for(new i; i < iPnum; i++)
{
get_user_name(iPlayers[i], szName, charsmax(szName))
format(szMessage, charsmax(szMessage), "%s^n%s", szMessage, szName)
}
set_hudmessage(255, 0, 0, 0.02, 0.2, 0, 1.0, 1.0)
ShowSyncHudMsg(0, g_iHudSync[0], szMessage)
get_players(iPlayers, iPnum, "ae", "CT")
copy(szMessage, charsmax(szMessage), "Counter-Terrorists:^n")
for(new i; i < iPnum; i++)
{
get_user_name(iPlayers[i], szName, charsmax(szName))
format(szMessage, charsmax(szMessage), "%s^n%s", szMessage, szName)
}
set_hudmessage(0, 0, 255, 0.88, 0.2, 0, 1.0, 1.0)
ShowSyncHudMsg(0, g_iHudSync[1], szMessage)
}
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.
OciXCrom
12-16-2016, 11:32
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.
So not even longer names?
OciXCrom
12-16-2016, 12:13
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.
i guess he only needs the hud for just 10 players so can change name size.
OciXCrom
12-16-2016, 12:39
10x32 = 320 :P
OciXCrom
12-16-2016, 13:23
If 320 is smaller than 128, the answer is yes.
If 320 is smaller than 128, the answer is yes.
well it will be true only if 10 players play with a name of 32 length xD which rarely happens.
OciXCrom
12-16-2016, 13:34
And if it does, the results will be everything but good.
Well i only have max 10 players on the server.
OciXCrom
12-17-2016, 10:13
That doesn't change the number 320.
10x32 = 320 :P
According to your post below, wouldn't it be 5*32 = 160, since he said 10 players- meaning 5 players per team? That making it 160 < 192 (if the max length is 192), which should technically work.
And regardless, your current code would make a problem either way because you have:
new szMessage[192], szName[16], iPlayers[32], iPnum
This would mean 16 players per team * 16 characters per name = 256 > 192. And if he only has 10 people playing on the server (it's most likely a PUG server), there would be unused characters locked by szName[16] since it would be 16*5 = 80; 80 < 192. In this case, however, you may be able to add the Kills and Deaths as he requested since the array would have available characters to be used.
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.
Well sounds complicated. Its not necessary to add kills and deaths. But would be cool.
Yes its 5x5 server.
Also i command to turn off the hud message for player who writes it only.
Like /tabon /tabboff
For those who doesnt like it.
Try this. It's unlikely that all players will have long names, but if they do you may begin to see issues. Same goes for if you have very uneven teams. I tested this on a 32 player server with all names between 9-10 characters and had no problems. Keep an eye out on your error logs and adjustments may need to be made to the length of name that is allowed.
https://dl.dropboxusercontent.com/u/97433215/AMXX/TeamHUD.png
#include <amxmodx>
#include <cstrike>
#define MAX_PLAYERS 32
new g_iHudSync[ CsTeams ];
new Float:g_fHUDCoords[ CsTeams ][ 2 ] =
{
{ 0.0 , 0.0 },
{ 0.02 , 0.2 },
{ 0.75 , 0.2 },
{ 0.0 , 0.0 }
}
new g_iHUDRGB[ CsTeams ][ 3 ] =
{
{ 0 , 0 , 0 },
{ 255 , 0 , 0 },
{ 0 , 112 , 255 },
{ 0 , 0 , 0 }
}
public plugin_init()
{
register_plugin( "Players on HUD" , "1.0" , "OciXCrom / bugsy" );
g_iHudSync[ CS_TEAM_T ] = CreateHudSyncObj();
g_iHudSync[ CS_TEAM_CT ] = CreateHudSyncObj();
set_task( 1.0 , "ShowPlayers" , .flags = "b" );
}
public ShowPlayers()
{
//31 chars per name, + 1 space, + 3 for kills, 3 for deaths, 1 backslash, 1 new line
// teamheading[20] + name[31] + ' | K: ' + ### + ' | D: ' + ### + '^n'
static szMessage[ 20 + ( MAX_PLAYERS * 50 ) + 1 ];
new szName[ 32 ] , iPlayers[ 32 ] , iPos , iPlayer , iNum;
for ( new CsTeams:cstTeam = CS_TEAM_T ; cstTeam <= CS_TEAM_CT ; cstTeam++ )
{
get_players( iPlayers , iNum , "ae" , cstTeam == CS_TEAM_T ? "TERRORIST" : "CT" );
iPos = copy( szMessage , charsmax( szMessage ) , cstTeam == CS_TEAM_T ? "Terrorists:^n" : "Counter-Terrorists:^n" );
for ( new i ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
get_user_name( iPlayer , szName , charsmax( szName ) );
iPos += formatex( szMessage[ iPos ] , charsmax( szMessage ) - iPos , "%s | K: %d | D: %d^n" , szName , get_user_frags( iPlayer ) , cs_get_user_deaths( iPlayer ) );
}
set_hudmessage( g_iHUDRGB[ cstTeam ][ 0 ] , g_iHUDRGB[ cstTeam ][ 1 ] , g_iHUDRGB[ cstTeam ][ 2 ] , g_fHUDCoords[ cstTeam ][ 0 ] , g_fHUDCoords[ cstTeam ][ 1 ] , 0 , 0.0 , 1.1 , 0.0 , 0.0 );
ShowSyncHudMsg( 0 , g_iHudSync[ cstTeam ] , szMessage );
}
}
Testing bugsy.
Yes long names works now.
Kills and deaths wasnt so nice as i thought. To much text to see. So i just deleted that part.
But can you make so it turns off and turns on if i write .on .off?
Everyuser should be able to write .on .off so it turns off and on for them only.
When connected it should be auto on and users can then choose to turn off or on.
Here is with no scores and .on/.off commands.
#include <amxmodx>
new const Version[] = "0.1";
#define MAX_PLAYERS 32
enum Teams
{
Team_T,
Team_CT
}
enum Coords
{
Float:Coord_X,
Float:Coord_Y
}
enum RGB
{
Red,
Green,
Blue
}
new const TeamHeadings[ Teams ][ 21 ] =
{
"Terrorists:^n",
"Counter-Terrorists:^n"
};
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.02 , 0.2 },
{ 0.84 , 0.2 }
};
new const g_iHUDRGB[ Teams ][ RGB ] =
{
{ 255 , 0 , 0 },
{ 0 , 112 , 255 }
};
new g_iHudSync[ Teams ] , bool:g_bEnabled[ MAX_PLAYERS + 1 ];
public plugin_init()
{
register_plugin( "Players on HUD" , Version , "bugsy" );
register_clcmd( "say .on" , "TurnOn" );
register_clcmd( "say .off" , "TurnOff" );
register_clcmd( "say .toggle" , "ToggleHUD" );
register_clcmd( "say_team .on" , "TurnOn" );
register_clcmd( "say_team .off" , "TurnOff" );
register_clcmd( "say_team .toggle" , "ToggleHUD" );
g_iHudSync[ Team_T ] = CreateHudSyncObj();
g_iHudSync[ Team_CT ] = CreateHudSyncObj();
set_task( 1.0 , "ShowPlayers" , .flags = "b" );
}
public client_connect( id )
{
g_bEnabled[ id ] = true;
}
public TurnOn( id )
{
g_bEnabled[ id ] = true;
return PLUGIN_HANDLED;
}
public TurnOff( id )
{
g_bEnabled[ id ] = false;
return PLUGIN_HANDLED;
}
public ToggleHUD( id )
{
g_bEnabled[ id ] = !g_bEnabled[ id ];
return PLUGIN_HANDLED;
}
public ShowPlayers()
{
static szMessage[ Teams ][ charsmax( TeamHeadings[] ) + ( MAX_PLAYERS * 32 ) + 1 ];
new iPlayers[ 32 ] , iNum , i , iPlayer , iPos;
for ( new Teams:tTeam = Team_T ; tTeam < Teams ; tTeam++ )
{
get_players( iPlayers , iNum , "ae" , tTeam == Team_T ? "TERRORIST" : "CT" );
iPos = copy( szMessage[ tTeam ] , charsmax( szMessage[] ) , TeamHeadings[ tTeam ] );
for ( i = 0 ; i < iNum ; i++ )
{
iPos += get_user_name( iPlayers[ i ] , szMessage[ tTeam ][ iPos ] , charsmax( szMessage[] ) - iPos );
szMessage[ tTeam ][ iPos++ ] = '^n';
}
szMessage[ tTeam ][ iPos++ ] = EOS;
}
get_players( iPlayers , iNum , "ch" );
for ( new i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_bEnabled[ iPlayer ] )
{
set_hudmessage( g_iHUDRGB[ Team_T ][ Red ] , g_iHUDRGB[ Team_T ][ Green ] , g_iHUDRGB[ Team_T ][ Blue ] , g_fHUDCoords[ Team_T ][ Coord_X ] , g_fHUDCoords[ Team_T ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_T ] , szMessage[ Team_T ] );
set_hudmessage( g_iHUDRGB[ Team_CT ][ Red ] , g_iHUDRGB[ Team_CT ][ Green ] , g_iHUDRGB[ Team_CT ][ Blue ] , g_fHUDCoords[ Team_CT ][ Coord_X ] , g_fHUDCoords[ Team_CT ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_CT ] , szMessage[ Team_CT ] );
}
}
}
Mhm i was thinking isnt it better to have a button instead of typing .on .off?
Like ''F1'' on/off same button to turn off and turn off? A button which i can change?
I test stuff and try to find what could be done better thats it.
Just as easy, it would be a toggle command bound to a users key.
Maybe have both?
And what is set_task( 1.0 , "ShowPlayers" , .flags = "b" )
Code has been updated with .toggle command.
Maybe have both?
And what is set_task( 1.0 , "ShowPlayers" , .flags = "b" )
That calls the HUD function once every second.
.toggle? You mean that this command turns off and on?
So need to run some other plugin to force players to bind key to say .toogle?
client_cmd bind ''F1'' ''say .toogle''
I will solve it myself no problem.
You know what? I will reply with a new idea.
Intressting one.
Will not be made but cool idea.
Much thanks i have what i needed now :D
.toggle?
You mean that this command turns off and on?
Yes.. try it.
Works good. Thanks!
Maybe future idea?
The best idea i have for it is to add sprites after and before the nickname.
This could be done with some other sprite plugin which i will post later.
If there would be time it would be so cool to add sprites.
I will add as much information and codes as i can so maybe someone will make this one day.
Right now i have <POINTS> after nicks allmost like ranks.
Niceer with sprites/images like in CS GO but CS 1.6 style like allways.
https://i.imgsafe.org/7157b223dc.png
Works good. Thanks!
Maybe future idea?
The best idea i have for it is to add sprites after and before the nickname.
This could be done with some other sprite plugin which i will post later.
If there would be time it would be so cool to add sprites.
I will add as much information and codes as i can so maybe someone will make this one day.
Right now i have <POINTS> after nicks allmost like ranks.
Niceer with sprites/images like in CS GO but CS 1.6 style like allways.
https://i.imgsafe.org/7157b223dc.png
wher is link ????
Here is with no scores and .on/.off commands.
#include <amxmodx>
new const Version[] = "0.1";
#define MAX_PLAYERS 32
enum Teams
{
Team_T,
Team_CT
}
enum Coords
{
Float:Coord_X,
Float:Coord_Y
}
enum RGB
{
Red,
Green,
Blue
}
new const TeamHeadings[ Teams ][ 21 ] =
{
"Terrorists:^n",
"Counter-Terrorists:^n"
};
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.02 , 0.2 },
{ 0.84 , 0.2 }
};
new const g_iHUDRGB[ Teams ][ RGB ] =
{
{ 255 , 0 , 0 },
{ 0 , 112 , 255 }
};
new g_iHudSync[ Teams ] , bool:g_bEnabled[ MAX_PLAYERS + 1 ];
public plugin_init()
{
register_plugin( "Players on HUD" , Version , "bugsy" );
register_clcmd( "say .on" , "TurnOn" );
register_clcmd( "say .off" , "TurnOff" );
register_clcmd( "say .toggle" , "ToggleHUD" );
register_clcmd( "say_team .on" , "TurnOn" );
register_clcmd( "say_team .off" , "TurnOff" );
register_clcmd( "say_team .toggle" , "ToggleHUD" );
g_iHudSync[ Team_T ] = CreateHudSyncObj();
g_iHudSync[ Team_CT ] = CreateHudSyncObj();
set_task( 1.0 , "ShowPlayers" , .flags = "b" );
}
public client_connect( id )
{
g_bEnabled[ id ] = true;
}
public TurnOn( id )
{
g_bEnabled[ id ] = true;
return PLUGIN_HANDLED;
}
public TurnOff( id )
{
g_bEnabled[ id ] = false;
return PLUGIN_HANDLED;
}
public ToggleHUD( id )
{
g_bEnabled[ id ] = !g_bEnabled[ id ];
return PLUGIN_HANDLED;
}
public ShowPlayers()
{
static szMessage[ Teams ][ charsmax( TeamHeadings[] ) + ( MAX_PLAYERS * 32 ) + 1 ];
new iPlayers[ 32 ] , iNum , i , iPlayer , iPos;
for ( new Teams:tTeam = Team_T ; tTeam < Teams ; tTeam++ )
{
get_players( iPlayers , iNum , "ae" , tTeam == Team_T ? "TERRORIST" : "CT" );
iPos = copy( szMessage[ tTeam ] , charsmax( szMessage[] ) , TeamHeadings[ tTeam ] );
for ( i = 0 ; i < iNum ; i++ )
{
iPos += get_user_name( iPlayers[ i ] , szMessage[ tTeam ][ iPos ] , charsmax( szMessage[] ) - iPos );
szMessage[ tTeam ][ iPos++ ] = '^n';
}
szMessage[ tTeam ][ iPos++ ] = EOS;
}
get_players( iPlayers , iNum , "ch" );
for ( new i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_bEnabled[ iPlayer ] )
{
set_hudmessage( g_iHUDRGB[ Team_T ][ Red ] , g_iHUDRGB[ Team_T ][ Green ] , g_iHUDRGB[ Team_T ][ Blue ] , g_fHUDCoords[ Team_T ][ Coord_X ] , g_fHUDCoords[ Team_T ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_T ] , szMessage[ Team_T ] );
set_hudmessage( g_iHUDRGB[ Team_CT ][ Red ] , g_iHUDRGB[ Team_CT ][ Green ] , g_iHUDRGB[ Team_CT ][ Blue ] , g_fHUDCoords[ Team_CT ][ Coord_X ] , g_fHUDCoords[ Team_CT ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_CT ] , szMessage[ Team_CT ] );
}
}
}
i see up and i see player name on hud with csgo rank how can i download it ?
I made that image in paint.exe
There is no plugin with image/sprite ranks.
I hope someone will make it but hopes not big.
PS! Another smart thing is to run some cind of max characters in nick. So people who nick PlayerSlayer1337NoMamA dont take up the whole screen.
About the images/sprites. It should be more like this.
Sprites/images/ranks should be show before the nick for T team.
After the nick for CT team.
https://i.imgsafe.org/74f1bd8187.png
Bugsy. Got an idea again hehe.
Can you add health to the hud?
I think people will request it in the future anyway.
This future should have 3 cvars.
1 On to all
2 See only your team health
3 Off
It should be in the begining of the nicks for Ts and in the end for CTs.
Also it should have different hud color from the team color if possible.
100% | Player 1 Player 1 | 100%
OciXCrom
12-19-2016, 20:19
You can't combine two colors in one message. If you add another message, you'll never get the position right. You can have only 4 HUD messages displayed at a time, so adding two more for health would completely block out the HUD messages from being used.
Sad.
Can you still put in health with team colors/same color? With cvars?
<100%>Player1
Player1<100%>
100% | Player1
Player1 | 100%
SomewhereLost
12-20-2016, 16:48
Instead of health, better to put if player is dead or alive.
OciXCrom
12-20-2016, 17:36
He doesn't show up on the list if he's dead. :c
Sad.
Can you still put in health with team colors/same color? With cvars?
<100%>Player1
Player1<100%>
100% | Player1
Player1 | 100%
What do you want to change with cvar?
#include <amxmodx>
new const Version[] = "0.1";
#define MAX_PLAYERS 32
enum Teams
{
Team_T,
Team_CT
}
enum Coords
{
Float:Coord_X,
Float:Coord_Y
}
enum RGB
{
Red,
Green,
Blue
}
new const TeamHeadings[ Teams ][ 21 ] =
{
"Terrorists:^n",
"Counter-Terrorists:^n"
};
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.02 , 0.2 },
{ 0.84 , 0.2 }
};
new const g_iHUDRGB[ Teams ][ RGB ] =
{
{ 255 , 0 , 0 },
{ 0 , 112 , 255 }
};
new g_iHudSync[ Teams ] , bool:g_bEnabled[ MAX_PLAYERS + 1 ];
public plugin_init()
{
register_plugin( "Players on HUD" , Version , "bugsy" );
register_clcmd( "say .on" , "TurnOn" );
register_clcmd( "say .off" , "TurnOff" );
register_clcmd( "say .toggle" , "ToggleHUD" );
register_clcmd( "say_team .on" , "TurnOn" );
register_clcmd( "say_team .off" , "TurnOff" );
register_clcmd( "say_team .toggle" , "ToggleHUD" );
g_iHudSync[ Team_T ] = CreateHudSyncObj();
g_iHudSync[ Team_CT ] = CreateHudSyncObj();
set_task( 1.0 , "ShowPlayers" , .flags = "b" );
}
public client_connect( id )
{
g_bEnabled[ id ] = true;
}
public TurnOn( id )
{
g_bEnabled[ id ] = true;
return PLUGIN_HANDLED;
}
public TurnOff( id )
{
g_bEnabled[ id ] = false;
return PLUGIN_HANDLED;
}
public ToggleHUD( id )
{
g_bEnabled[ id ] = !g_bEnabled[ id ];
return PLUGIN_HANDLED;
}
public ShowPlayers()
{
static szMessage[ Teams ][ charsmax( TeamHeadings[] ) + ( MAX_PLAYERS * 32 ) + 1 ];
new iPlayers[ 32 ] , iNum , i , iPlayer , iPos , szName[ 32 ];
for ( new Teams:tTeam = Team_T ; tTeam < Teams ; tTeam++ )
{
get_players( iPlayers , iNum , "ae" , tTeam == Team_T ? "TERRORIST" : "CT" );
iPos = copy( szMessage[ tTeam ] , charsmax( szMessage[] ) , TeamHeadings[ tTeam ] );
for ( i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
get_user_name( iPlayer , szName , charsmax( szName ) );
if ( tTeam == Team_T )
{
iPos += formatex( szMessage[ tTeam ][ iPos ] , charsmax( szMessage[] ) - iPos , "%d%%%% | %s^n" , get_user_health( iPlayer ) , szName );
}
else
{
iPos += formatex( szMessage[ tTeam ][ iPos ] , charsmax( szMessage[] ) - iPos , "%s | %d%%%%^n" , szName , get_user_health( iPlayer ) );
}
}
szMessage[ tTeam ][ iPos++ ] = EOS;
}
get_players( iPlayers , iNum , "ch" );
for ( new i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_bEnabled[ iPlayer ] )
{
set_hudmessage( g_iHUDRGB[ Team_T ][ Red ] , g_iHUDRGB[ Team_T ][ Green ] , g_iHUDRGB[ Team_T ][ Blue ] , g_fHUDCoords[ Team_T ][ Coord_X ] , g_fHUDCoords[ Team_T ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_T ] , szMessage[ Team_T ] );
set_hudmessage( g_iHUDRGB[ Team_CT ][ Red ] , g_iHUDRGB[ Team_CT ][ Green ] , g_iHUDRGB[ Team_CT ][ Blue ] , g_fHUDCoords[ Team_CT ][ Coord_X ] , g_fHUDCoords[ Team_CT ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_CT ] , szMessage[ Team_CT ] );
}
}
}
SomewhereLost
12-20-2016, 21:51
He doesn't show up on the list if he's dead. :c
No like, make the name different color when player is dead or something like that.
No like, make the name different color when player is dead or something like that.
You can't combine two colors in one message. If you add another message, you'll never get the position right. You can have only 4 HUD messages displayed at a time, so adding two more for health would completely block out the HUD messages from being used.
can you make it be have cs go rank sprites ??? can you ?
can you make it be have cs go rank sprites ??? can you ?
This is already requested by me and also in another thread here by me also: https://forums.alliedmods.net/showthread.php?t=291739
This is a hard task but i hope someone one day will make it.
Anyway...
Bugsy thanks for your active replies in this thread.
Well cvars.
1 - show everyones health
2 - show your team health only
3 - off (just health)
And about the death things its fine like it is.
SomewhereLost
12-21-2016, 22:36
So what I'm saying is impossible? Somehow
So what I'm saying is impossible? Somehow
Well its a function i dont want cause the existing one is the best one i think.
But maybe change color to white when dead would be cool allmost spec like. Transparent white :D
But if it will be added please make a new plugin i would like to keep this one as a back up if i lose it some day.
OciXCrom
12-22-2016, 18:19
For the last time - you CAN'T change the color of a HUD message. You can only add another message and only God knows how you're going to get the position of that message to match with the other one. Plus, you will reach the limit of 4 HUD messages, which will bug out all messages from all plugins.
Yeah.
Anyways this is already a good plugin i dont need anymore from it.
Also here is some other guy who made simular one with HP and stuff but i dont think it can fit all names etc.
https://www.youtube.com/watch?v=ARNFHC3Mw9k
Bugsy, can you take a look at this thread https://forums.alliedmods.net/showthread.php?t=291925
In my head i think that its not an impossible task.
I think that this plugin could help solve my request in that other thread problem.
You could add hp and kills after the nickname so why not just add little bit of code from existing plugin where the hp and kills are?
What do you think about it? Not your area?
This is the most requested plugin ever 101%
https://forums.alliedmods.net/showthread.php?t=291925
Sorry for bumping.
Bugsy can you make this to show DHUD instead of just hud?
Need bigger text.
#include <amxmodx>
new const Version[] = "0.1";
#define MAX_PLAYERS 32
enum Teams
{
Team_T,
Team_CT
}
enum Coords
{
Float:Coord_X,
Float:Coord_Y
}
enum RGB
{
Red,
Green,
Blue
}
new const TeamHeadings[ Teams ][ 21 ] =
{
"Terrorists:^n",
"Counter-Terrorists:^n"
};
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.02 , 0.2 },
{ 0.84 , 0.2 }
};
new const g_iHUDRGB[ Teams ][ RGB ] =
{
{ 255 , 0 , 0 },
{ 0 , 112 , 255 }
};
new g_iHudSync[ Teams ] , bool:g_bEnabled[ MAX_PLAYERS + 1 ];
public plugin_init()
{
register_plugin( "Players on HUD" , Version , "bugsy" );
register_clcmd( "say .on" , "TurnOn" );
register_clcmd( "say .off" , "TurnOff" );
register_clcmd( "say .toggle" , "ToggleHUD" );
register_clcmd( "say_team .on" , "TurnOn" );
register_clcmd( "say_team .off" , "TurnOff" );
register_clcmd( "say_team .toggle" , "ToggleHUD" );
g_iHudSync[ Team_T ] = CreateHudSyncObj();
g_iHudSync[ Team_CT ] = CreateHudSyncObj();
set_task( 1.0 , "ShowPlayers" , .flags = "b" );
}
public client_connect( id )
{
g_bEnabled[ id ] = true;
}
public TurnOn( id )
{
g_bEnabled[ id ] = true;
return PLUGIN_HANDLED;
}
public TurnOff( id )
{
g_bEnabled[ id ] = false;
return PLUGIN_HANDLED;
}
public ToggleHUD( id )
{
g_bEnabled[ id ] = !g_bEnabled[ id ];
return PLUGIN_HANDLED;
}
public ShowPlayers()
{
static szMessage[ Teams ][ charsmax( TeamHeadings[] ) + ( MAX_PLAYERS * 32 ) + 1 ];
new iPlayers[ 32 ] , iNum , i , iPlayer , iPos;
for ( new Teams:tTeam = Team_T ; tTeam < Teams ; tTeam++ )
{
get_players( iPlayers , iNum , "ae" , tTeam == Team_T ? "TERRORIST" : "CT" );
iPos = copy( szMessage[ tTeam ] , charsmax( szMessage[] ) , TeamHeadings[ tTeam ] );
for ( i = 0 ; i < iNum ; i++ )
{
iPos += get_user_name( iPlayers[ i ] , szMessage[ tTeam ][ iPos ] , charsmax( szMessage[] ) - iPos );
szMessage[ tTeam ][ iPos++ ] = '^n';
}
szMessage[ tTeam ][ iPos++ ] = EOS;
}
get_players( iPlayers , iNum , "ch" );
for ( new i = 0 ; i < iNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_bEnabled[ iPlayer ] )
{
set_hudmessage( g_iHUDRGB[ Team_T ][ Red ] , g_iHUDRGB[ Team_T ][ Green ] , g_iHUDRGB[ Team_T ][ Blue ] , g_fHUDCoords[ Team_T ][ Coord_X ] , g_fHUDCoords[ Team_T ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_T ] , szMessage[ Team_T ] );
set_hudmessage( g_iHUDRGB[ Team_CT ][ Red ] , g_iHUDRGB[ Team_CT ][ Green ] , g_iHUDRGB[ Team_CT ][ Blue ] , g_fHUDCoords[ Team_CT ][ Coord_X ] , g_fHUDCoords[ Team_CT ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 , 1 );
ShowSyncHudMsg( iPlayer , g_iHudSync[ Team_CT ] , szMessage[ Team_CT ] );
}
}
}
Try this:
set_dhudmessage( g_iHUDRGB[ Team_T ][ Red ] , g_iHUDRGB[ Team_T ][ Green ] , g_iHUDRGB[ Team_T ][ Blue ] , g_fHUDCoords[ Team_T ][ Coord_X ] , g_fHUDCoords[ Team_T ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 );
show_dhudmessage( iPlayer , szMessage[ Team_T ] );
set_hudmessage( g_iHUDRGB[ Team_CT ][ Red ] , g_iHUDRGB[ Team_CT ][ Green ] , g_iHUDRGB[ Team_CT ][ Blue ] , g_fHUDCoords[ Team_CT ][ Coord_X ] , g_fHUDCoords[ Team_CT ][ Coord_Y ] , 0 , 0.0 , 1.2 , 0.0 , 0.0 );
show_dhudmessage( iPlayer , szMessage[ Team_CT ] );
Can also remove these lines and the hud sync obj array.
g_iHudSync[ Team_T ] = CreateHudSyncObj();
g_iHudSync[ Team_CT ] = CreateHudSyncObj();
So far so good.
Needed to add.
#include <dhudmessage>
In the first line for it to compile.
And replace the dhud positions.
Could you put the ct roll right below (with some space in between) the t row??
OciXCrom
03-14-2017, 09:56
Can't you change the position yourself?
Can't you change the position yourself?
Sorry, I don't know how to do that, buddy!
OciXCrom
03-14-2017, 19:26
It's because you didn't try.
new*const*Float:g_fHUDCoords[*Teams*][*Coords*]*=**
{*
****{*0.02*,*0.2*},*
****{*0.84*,*0.2*}*
};
It's because you didn't try.
new*const*Float:g_fHUDCoords[*Teams*][*Coords*]*=**
{*
****{*0.02*,*0.2*},*
****{*0.84*,*0.2*}*
};
I just don't understand amxx codes... and I'm really grateful for all your help!
This worked:
{ 0.84 , 0.4 },
{ 0.84 , 0.2 }
But the terrorist roll of player names ain't showing up, just the title.
Found a bug dont know why but the terrorist team is underlapsing the counter terrorist team.
http://i.imgur.com/ktb8MuV.jpg
The ter team roll shows up empy
The Y coordinate needs more separation. Modify the 0.62 value to bring the CT list higher or lower on the screen.
//For left side of screen
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.02 , 0.2 },
{ 0.02 , 0.62 }
};
//OR for right-side of screen
new const Float:g_fHUDCoords[ Teams ][ Coords ] =
{
{ 0.84 , 0.2 },
{ 0.84 , 0.62 }
};
Bugsy, is this possible that a plugin conflict is causing CT roll not to be displayed? The weird thing is that the T works perfectly and the CT title show up as well but not the list below it.
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.