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

[Req] Team Score HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-19-2012 , 16:48   Re: [Req] Team Score HUD
Reply With Quote #11

Quote:
Originally Posted by bibu View Post
I got this from some plugins here:

PHP Code:
    // Condition Zero
    
if ( g_MOD == GAME_CZERO )
    {
        
register_event("TextMsg""on_GameRestart""a""2&#Game_Commencing")
    }
    
// Counter-Strike
    
else
    {
        
register_event("TextMsg""on_GameRestart""a""2&#Game_C")
    } 
That makes no sense, since "2&#Game_C" will match the same as "2&#Game_Commencing".
Also, it doesn't catch the restarts from sv_restart and sv_restartround cvars.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
TeddiBer
Senior Member
Join Date: Oct 2011
Old 03-19-2012 , 17:37   Re: [Req] Team Score HUD
Reply With Quote #12

can you make the same plugin, only that it is dhud ?
TeddiBer is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-19-2012 , 17:54   Re: [Req] Team Score HUD
Reply With Quote #13

dHUD support.

Note: You have to compile locally using the dhudmessage.inc include,

Code:
#include < amxmodx > #include < dhudmessage > #pragma semicolon 1 #define UPDATE_INTERVAL         1.0 enum _: iRGB {     r,     g,     b }; new const gCvarColorNames[ ][ ] = {     "white",     "red",     "blue",     "green",     "yellow" }; new Trie:gCvarNameToIndex; new const gColorValues[ ][ iRGB ] = {     { 255, 255, 255 },     { 255, 10, 10 },     { 10, 10, 255 },     { 10, 255, 10 },     { 255, 255, 10 } }; new gCountCTScore = 0; new gCountTScore = 0; new gCvarColorHud; new gColorId[ iRGB ]; public plugin_init( ) {     register_plugin( "Score Counter", "1.0.1", "tuty" );         register_event( "SendAudio", "Hook_Terr_Win", "a", "2&%!MRAD_terwin" );     register_event( "SendAudio", "Hook_CT_Win", "a", "2&%!MRAD_ctwin" );     register_event( "TextMsg", "Hook_Restart", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );         gCvarColorHud = register_cvar( "amx_hudscorecolor", "white" );         gCvarNameToIndex = TrieCreate( );     for( new i = 0; i < sizeof gCvarColorNames; i++ )     {         TrieSetCell( gCvarNameToIndex, gCvarColorNames[ i ], i );     }     set_task( UPDATE_INTERVAL, "UpdateScore", _, _, _, "b" ); } public plugin_cfg( ) {     UTIL_InitColor( ); } public Hook_Terr_Win( ) {     gCountTScore++; } public Hook_CT_Win( ) {     gCountCTScore++; } public Hook_Restart( ) {     gCountCTScore = 0;     gCountTScore = 0; } public plugin_end( ) {     TrieDestroy( gCvarNameToIndex ); } public UpdateScore( ) {     set_dhudmessage( gColorId[ r ], gColorId[ g ], gColorId[ b ], -1.0, 0.03, 0, 6.0, UPDATE_INTERVAL + 0.1 );     show_dhudmessage( 0, "[CT] Vs. [T]^n%d - %d", gCountCTScore, gCountTScore ); } UTIL_InitColor( ) {     new szColor[ 20 ], i;     get_pcvar_string( gCvarColorHud, szColor, charsmax( szColor ) );         strtolower( szColor );         if( TrieGetCell( gCvarNameToIndex, szColor, i ) )     {         gColorId[ r ] = gColorValues[ i ][ r ];         gColorId[ g ] = gColorValues[ i ][ g ];         gColorId[ b ] = gColorValues[ i ][ b ];     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-19-2012 , 17:57   Re: [Req] Team Score HUD
Reply With Quote #14

the only thing that dhud sux, is when the previous dhud time isnt expired, will replace another dhud on same channel that's why its better with default hud system for loops
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
TeddiBer
Senior Member
Join Date: Oct 2011
Old 03-20-2012 , 07:57   Re: [Req] Team Score HUD
Reply With Quote #15

Quote:
Originally Posted by Exolent[jNr] View Post
dHUD support.

Note: You have to compile locally using the dhudmessage.inc include,

Code:
#include < amxmodx > #include < dhudmessage > #pragma semicolon 1 #define UPDATE_INTERVAL         1.0 enum _: iRGB {     r,     g,     b }; new const gCvarColorNames[ ][ ] = {     "white",     "red",     "blue",     "green",     "yellow" }; new Trie:gCvarNameToIndex; new const gColorValues[ ][ iRGB ] = {     { 255, 255, 255 },     { 255, 10, 10 },     { 10, 10, 255 },     { 10, 255, 10 },     { 255, 255, 10 } }; new gCountCTScore = 0; new gCountTScore = 0; new gCvarColorHud; new gColorId[ iRGB ]; public plugin_init( ) {     register_plugin( "Score Counter", "1.0.1", "tuty" );         register_event( "SendAudio", "Hook_Terr_Win", "a", "2&%!MRAD_terwin" );     register_event( "SendAudio", "Hook_CT_Win", "a", "2&%!MRAD_ctwin" );     register_event( "TextMsg", "Hook_Restart", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );         gCvarColorHud = register_cvar( "amx_hudscorecolor", "white" );         gCvarNameToIndex = TrieCreate( );     for( new i = 0; i < sizeof gCvarColorNames; i++ )     {         TrieSetCell( gCvarNameToIndex, gCvarColorNames[ i ], i );     }     set_task( UPDATE_INTERVAL, "UpdateScore", _, _, _, "b" ); } public plugin_cfg( ) {     UTIL_InitColor( ); } public Hook_Terr_Win( ) {     gCountTScore++; } public Hook_CT_Win( ) {     gCountCTScore++; } public Hook_Restart( ) {     gCountCTScore = 0;     gCountTScore = 0; } public plugin_end( ) {     TrieDestroy( gCvarNameToIndex ); } public UpdateScore( ) {     set_dhudmessage( gColorId[ r ], gColorId[ g ], gColorId[ b ], -1.0, 0.03, 0, 6.0, UPDATE_INTERVAL + 0.1 );     show_dhudmessage( 0, "[CT] Vs. [T]^n%d - %d", gCountCTScore, gCountTScore ); } UTIL_InitColor( ) {     new szColor[ 20 ], i;     get_pcvar_string( gCvarColorHud, szColor, charsmax( szColor ) );         strtolower( szColor );         if( TrieGetCell( gCvarNameToIndex, szColor, i ) )     {         gColorId[ r ] = gColorValues[ i ][ r ];         gColorId[ g ] = gColorValues[ i ][ g ];         gColorId[ b ] = gColorValues[ i ][ b ];     } }

Thanks So Much Exolent !
You To tuty !

maby post it in new plugins, im sure people will need it
TeddiBer is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-20-2012 , 08:46   Re: [Req] Team Score HUD
Reply With Quote #16

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
"2&#Game_w", "2&#Game_will_restart_in"

Those are the same condition, FYI.
i got this from a random plugin idk where and just copied and pasted, it doesnt matter
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Isstrati
Member
Join Date: Feb 2012
Location: Republic of Moldova/Chis
Old 03-20-2012 , 18:22   Re: [Req] Team Score HUD
Reply With Quote #17

who to make this, to show only in freezetime....not a permanently message, or 1-2 seconds on start round.
Sorry for my bad eng.

Last edited by Isstrati; 03-21-2012 at 06:40.
Isstrati is offline
Send a message via Skype™ to Isstrati
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 20:44.


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