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

HUD Scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-15-2013 , 10:13   HUD Scoreboard
Reply With Quote #1

HUD Scoreboard


by Kia


Description
  • This Plugin adds a Director HUD Message at the top of your screen and counts the alive Ts / CTs and their Team Score.
  • Color can be changed via CVars.

Requirements
CVars
  • hud_rcolor <0-255> - Default : 0 - Red Part of Color (RGB)
  • hud_gcolor <0-255> - Default : 255 - Green Part of Color (RGB)
  • hud_bcolor <0-255> - Default : 0 - Blue Part of Color (RGB)
  • hud_terror_prefix <STRING> - Default : T's - Prefix for Terrorists (alive)
  • hud_counter_prefix <STRING> - Default : CT's - Prefix for Counter-Terrorists (alive)
  • hud_terror_tprefix <STRING> - Default : Terrorists - Name for Terrorists Team
  • hud_counter_tprefix <STRING> - Default : Counter-Terrorists - Name for Counter-Terrorists Team
  • hud_design <INTEGER> - Default : 1 - '1' for Normal, '2' for new style

Credits
  • her0p - Original Request (Link : here)
  • Arkshine - dhudmessage Module (Link : here)
  • Kia - Coding the Plugin

Changelogs :

Spoiler
Attached Files
File Type: sma Get Plugin or Get Source (hudscoreboard.sma - 2873 views - 3.3 KB)
__________________

Last edited by Kia; 05-21-2013 at 12:15.
Kia is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-15-2013 , 11:54   Re: HUD Scoreboard
Reply With Quote #2

You don't need "is_user_alive()" when using "get_players" with flag "a".
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-15-2013 , 12:28   Re: HUD Scoreboard
Reply With Quote #3

PHP Code:
    new iPlayers[32], iNumplayer
    
get_players(iPlayersiNum"a");
    
    
Terrorists 0
    CounterTerrorists 
0
    
    
for(new i<= iNumi++) 
    { 
        
player iPlayers[i];
        if(
is_user_alive(player))
        {
            switch(
get_user_team(player))
            {
                case(
1):Terrorists++
                case(
2):CounterTerrorists++
            }
        }
    } 
->

PHP Code:
    new iPlayers[32], TerroristsCounterTerrorists
    
get_players(iPlayersTerrorists"ae""TERRORIST");
    
get_players(iPlayersCounterTerrorists"ae""CT"); 
Then no loop is needed.

Also, use cvar pointers is a must.


Last, use register_event with filters, do NEVER use register_message when you don't block them or change some args (also was useless to declare strings as const in the callback because those strings were used only once).
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-15-2013 at 12:32.
ConnorMcLeod is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-15-2013 , 13:26   Re: HUD Scoreboard
Reply With Quote #4

Version 1.1

Changelog :
  • Added CVars :
    1. hud_terror_prefix <STRING> - Default : T's - Prefix for Terrorists (alive)
    2. hud_counter_prefix <STRING> - Default : CT's - Prefix for Counter-Terrorists (alive)
    3. hud_terror_tprefix <STRING> - Default : Terrorists - Name for Terrorists Team
    4. hud_counter_tprefix <STRING> - Default : Counter-Terrorists - Name for Counter-Terrorists Team
  • Optimized Code
  • Added CVar Pointers
  • Replaced register_message with SendAudio Events
__________________

Last edited by Kia; 02-16-2013 at 03:08.
Kia is offline
her0p
Senior Member
Join Date: Nov 2011
Old 02-15-2013 , 21:02   Re: HUD Scoreboard
Reply With Quote #5

I have some problems, I've put on two different servers, the first works fine, the second does not count the terrorists. wtf? in the two gives me this error


PHP Code:
L 02/16/2013 02:49:38Info (map "de_dust2_long_2012") (file "addons/amxmodx/logs/error_20130216.log")
L 02/16/2013 02:49:38: Function "PrintDev" was not found
L 02
/16/2013 02:49:38: [AMXXDisplaying debug trace (plugin "hudscoreboard.amxx")
L 02/16/2013 02:49:38: [AMXXRun time error 19: function not found 
L 02
/16/2013 02:49:38: [AMXX]    [0hudscoreboard.sma::plugin_init (line 45
I forgot, since I've installed on my server goes down the HLTV
Also uploaded the include

thanks for the plugin

Last edited by her0p; 02-15-2013 at 21:13.
her0p is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-16-2013 , 01:59   Re: HUD Scoreboard
Reply With Quote #6

Sorry, forgot to remove a line of code which was used for testing, I'll remove it asap.
New Plugin in first post now.
__________________

Last edited by Kia; 02-16-2013 at 03:09. Reason: Plugin error
Kia is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-16-2013 , 12:57   Re: HUD Scoreboard
Reply With Quote #7

Version 1.2

Changelog :
  • Added CVars :
    1. hud_design <INTEGER> - Default : 1 - '1' for Normal, '2' for new style
  • Optimized Code
  • Added new HUD Style.
__________________
Kia is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 02-16-2013 , 15:09   Re: HUD Scoreboard
Reply With Quote #8

Why don't you parse and formatex the color.

And sth that isn't needed but it will look clearer
PHP Code:
public t_win()
{
    
TerrorWins++
}

public 
ct_win()
{
    
CounterWins++
}

public 
EventRoundEnd()
{
    
g_round_start = -1.0;
}

public 
EventRoundRestart()
{
    
g_round_start = -1.0;

----->
PHP Code:
public t_win() TerrorWins++;
public 
ct_win() CounterWins++;
public 
EventRoundEnd() g_round_start = -1.0;
public 
EventRoundRestart() g_round_start = -1.0
didoWEE is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-17-2013 , 03:45   Re: HUD Scoreboard
Reply With Quote #9

Quote:
Why don't you parse and formatex the color.
Why should I?
__________________
Kia is offline
her0p
Senior Member
Join Date: Nov 2011
Old 02-17-2013 , 16:08   Re: HUD Scoreboard
Reply With Quote #10

thanks works perfectly.

Installed on my server goes down the HLTV, you can fix?
her0p 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:22.


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