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

Solved Modify Team Score Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ssproxima
Senior Member
Join Date: Jan 2015
Old 03-09-2018 , 12:02   Modify Team Score Plugin
Reply With Quote #1

Can this plugin be modified so that the score is visible only when a player is dead and not alive

any help appreciated

PHP Code:
/* Plugin generated by AMXX-Studio */

    #include < amxmodx >
    #include < dhudmessage >
    
    #pragma semicolon 1
        
    
new const
        
PLUGIN_NAME[ ]         = "Furien Score & Round",
        
PLUGIN_VERSION[ ]     = "0.2.1";
    
    
    
#define    iNameRed    0
    #define    iNameGreen    255
    #define    iNameBlue    255
    #define    iScoreRed    255
    #define    iScoreGreen    0
    #define    iScoreBlue    0
    
    
new const
        
g_szTeamsMessage[ ]     = "    |-  Furien           AntiFurien  -|    ",
        
g_szScoreMessage[ ]    = "%02i                                                %02i",
        
g_szRoundMessage[ ]    = "                  Round                     ",
        
g_szRound[ ]        = "                    %02i                       ";
        
        
    
enum _:iTeamWons
    
{
        
FURIEN,
        
ANTIFURIEN
    
}
    
    new 
g_iTeamWonsiTeamWons ];
    new 
g_iRounds;
    
    new 
SyncHudTeamNamesSyncHudTeamScore;
            
                
public 
plugin_init( )
{
    
    
register_pluginPLUGIN_NAMEPLUGIN_VERSION"Askhanar" );
    
    
    
register_event"HLTV""ev_NewRound""a""1=0""2=0" );
    
register_event"TextMsg""ev_RoundRestart""a""2&#Game_C""2&#Game_w" );
    
    
register_event"SendAudio""ev_TerroristWin""a""2&%!MRAD_terwin" );
    
register_event"SendAudio""ev_CtWin""a""2&%!MRAD_ctwin" );
    
    
g_iRounds 0;
    
g_iTeamWonsFURIEN ] = 0;
    
g_iTeamWonsANTIFURIEN ] = 0;
    
    
SyncHudTeamNames CreateHudSyncObj( );
    
SyncHudTeamScore CreateHudSyncObj( );
    
    
    
set_task1.0"task_DisplayHudScore"___"b");
    
// Add your code here...
}


public 
ev_NewRound( )        g_iRounds++;
public 
ev_RoundRestart( )    {    g_iRounds 0;    g_iTeamWonsFURIEN ] = 0;    g_iTeamWonsANTIFURIEN ] = 0;    }
public 
ev_TerroristWin( )    g_iTeamWonsFURIEN ]++;
public 
ev_CtWin( )    g_iTeamWonsANTIFURIEN ]++;

public 
task_DisplayHudScore( )
{
    static 
iPlayers32 ];
    static 
iPlayersNum;
        
    
get_playersiPlayersiPlayersNum"ch" );
    if( !
iPlayersNum )
        return;
        
    static 
idi;
    for( 
0iPlayersNumi++ )
    {
        
id iPlayers];
        
        if( 
<= get_user_teamid ) <= )
        {
            
set_hudmessageiNameRediNameGreeniNameBlue, -1.0is_user_aliveid ) ? 0.01 0.16 0_1.0__);
            
ShowSyncHudMsgidSyncHudTeamNamesg_szTeamsMessage );
            
            
set_hudmessageiScoreRediScoreGreeniScoreBlue, -1.0is_user_aliveid ) ? 0.01 0.16 0_1.0__);
            
ShowSyncHudMsgidSyncHudTeamScoreg_szScoreMessage,  g_iTeamWonsFURIEN ], g_iTeamWonsANTIFURIEN ]  );
            
            
            
set_dhudmessageiNameRediNameGreeniNameBlue, -1.0is_user_aliveid ) ? 0.03 0.18 0_1.0_);
            
show_dhudmessageidg_szRoundMessage );
            
            
set_dhudmessageiScoreRediScoreGreeniScoreBlue, -1.0is_user_aliveid ) ? 0.06 0.21 0_1.0_);
            
show_dhudmessageidg_szRoundg_iRounds );
        }
    
    }


Last edited by ssproxima; 03-10-2018 at 14:00.
ssproxima is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-09-2018 , 12:41   Re: [REQ] Modify Team Score Plugin
Reply With Quote #2

Hook client_death(), then set_task()
Hook Round Start, then remove_task()
- You can also use Ham_Spawn & Ham_Killed / DeathMsg
__________________
Relaxing is offline
ssproxima
Senior Member
Join Date: Jan 2015
Old 03-09-2018 , 14:57   Re: [REQ] Modify Team Score Plugin
Reply With Quote #3

Quote:
Originally Posted by Relaxing View Post
Hook client_death(), then set_task()
Hook Round Start, then remove_task()
- You can also use Ham_Spawn & Ham_Killed / DeathMsg
Please bro can you put that in code I am noob at coding. Also I want one more thing that score should not reset at "sv_restart 1" but only score should reset at map change.
ssproxima is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-10-2018 , 08:39   Re: [REQ] Modify Team Score Plugin
Reply With Quote #4

Try this

PHP Code:

/* Plugin generated by AMXX-Studio */ 

    #include < amxmodx > 
    #include < dhudmessage > 
     
    #pragma semicolon 1 
         
    
new const 
        
PLUGIN_NAME[ ]         = "Furien Score & Round"
        
PLUGIN_VERSION[ ]     = "0.2.1"
     
     
    
#define    iNameRed    0 
    #define    iNameGreen    255 
    #define    iNameBlue    255 
    #define    iScoreRed    255 
    #define    iScoreGreen    0 
    #define    iScoreBlue    0 
     
    
new const 
        
g_szTeamsMessage[ ]     = "    |-  Furien           AntiFurien  -|    "
        
g_szScoreMessage[ ]    = "%02i                                                %02i"
        
g_szRoundMessage[ ]    = "                  Round                     "
        
g_szRound[ ]        = "                    %02i                       "
         
         
    
enum _:iTeamWons 
    

        
FURIEN
        
ANTIFURIEN 
    

     
    new 
g_iTeamWonsiTeamWons ]; 
    new 
g_iRounds
     
    new 
SyncHudTeamNamesSyncHudTeamScore
             
                 
public 
plugin_init( ) 

     
    
register_pluginPLUGIN_NAMEPLUGIN_VERSION"Askhanar" ); 
     
     
    
register_event"HLTV""ev_NewRound""a""1=0""2=0" ); 
    
register_event"TextMsg""ev_RoundRestart""a""2&#Game_C""2&#Game_w" ); 
     
    
register_event"SendAudio""ev_TerroristWin""a""2&%!MRAD_terwin" ); 
    
register_event"SendAudio""ev_CtWin""a""2&%!MRAD_ctwin" ); 
     
    
g_iRounds 0
    
g_iTeamWonsFURIEN ] = 0
    
g_iTeamWonsANTIFURIEN ] = 0
     
    
SyncHudTeamNames CreateHudSyncObj( ); 
    
SyncHudTeamScore CreateHudSyncObj( ); 
     
     
    
set_task1.0"task_DisplayHudScore"___"b"); 
    
// Add your code here... 



public 
ev_NewRound( )        g_iRounds++; 
public 
ev_RoundRestart( )    {    g_iRounds 0;    g_iTeamWonsFURIEN ] = 0;    g_iTeamWonsANTIFURIEN ] = 0;    } 
public 
ev_TerroristWin( )    g_iTeamWonsFURIEN ]++; 
public 
ev_CtWin( )    g_iTeamWonsANTIFURIEN ]++; 

public 
task_DisplayHudScore( ) 

    static 
iPlayers32 ]; 
    static 
iPlayersNum
         
    
get_playersiPlayersiPlayersNum"ch" ); 
    if( !
iPlayersNum 
        return; 
         
    static 
idi
    for( 
0iPlayersNumi++ ) 
    { 
        
id iPlayers]; 
         
        if( 
<= get_user_teamid ) <= 
        { 
                 if (!
is_user_alive(id))
                 {
            
set_hudmessageiNameRediNameGreeniNameBlue, -1.00.16 0_1.0__); 
            
ShowSyncHudMsgidSyncHudTeamNamesg_szTeamsMessage ); 
             
            
set_hudmessageiScoreRediScoreGreeniScoreBlue, -1.0,  0.16 0_1.0__); 
            
ShowSyncHudMsgidSyncHudTeamScoreg_szScoreMessage,  g_iTeamWonsFURIEN ], g_iTeamWonsANTIFURIEN ]  ); 
             
             
            
set_dhudmessageiNameRediNameGreeniNameBlue, -1.0,  0.18 0_1.0_); 
            
show_dhudmessageidg_szRoundMessage ); 
             
            
set_dhudmessageiScoreRediScoreGreeniScoreBlue, -1.00.21 0_1.0_); 
            
show_dhudmessageidg_szRoundg_iRounds ); 
            }
        } 
     
    } 

indraraj striker is offline
ssproxima
Senior Member
Join Date: Jan 2015
Old 03-10-2018 , 13:59   Re: [REQ] Modify Team Score Plugin
Reply With Quote #5

Thanks #Indraraj striker plugin worked.
ssproxima 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 05:52.


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