Raised This Month: $ Target: $400
 0% 

Remaining CT = slay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-22-2020 , 20:00   Re: Remaining CT = slay
Reply With Quote #1

So if no bots are on the server:
1 CT, 2 T

Bots on server:
1 CT, 4 T

?

How many seconds for the HUD before slay occurs?

What happens if a player connects during count down?
__________________

Last edited by Bugsy; 05-22-2020 at 20:02.
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-22-2020 , 20:44   Re: Remaining CT = slay
Reply With Quote #2

PHP Code:

#include <amxmodx>

new const Version[] = "0.5";

new 
g_pSlayNoBots g_pSlayWithBots g_pSlayDelay g_pPluginStartDelay;
new 
g_Bots g_iSeconds g_iSlayID;
new 
g_szName33 ] , g_shHUD g_iRoundStartTime;

public 
plugin_init() 
{
    
register_plugin"Slay CT" Version "bugsy" );

    
register_event"HLTV" "NewRound" "a" "1=0" "2=0" );
    
register_logevent"RoundEnd" "1=Round_End" );
    
    
g_pSlayNoBots register_cvar"sct_nobotslay" "3" );
    
g_pSlayWithBots register_cvar"sct_botslay" "5" );
    
g_pSlayDelay register_cvar"sct_slaydelay" "5" );
    
g_pPluginStartDelay register_cvar"sct_rounddelayseconds" "90" );
    
    
g_shHUD CreateHudSyncObj();
    
    
set_task1.0 "SlayCheck" 139457 , .flags="b" );
}

public 
client_putinserverid )
{
    
g_Bots |= ( is_user_botid ) << ( id 31 ) );
}

public 
client_disconnectid )
{
    
g_Bots &= ~( << ( id 31 ) );
    
    if ( 
id == g_iSlayID )
        
remove_taskg_iSlayID );
}

public 
NewRound()
{
    
g_iRoundStartTime get_systime();
}

public 
RoundEnd()
{
    
remove_taskg_iSlayID );
}

public 
SlayCheck()
{
    new 
iPlayers32 ] , iNum;
    
    if ( !
g_iSlayID && ( get_systime() - g_iRoundStartTime ) >= get_pcvar_numg_pPluginStartDelay ) && ( get_playersnum() > get_pcvar_numg_Bots g_pSlayWithBots g_pSlayNoBots ) ) )
    {
        
get_playersiPlayers iNum "ae" "CT" );
        
        if ( 
iNum == )
        {
            
set_task1.0 "DisplayHUD" , ( g_iSlayID iPlayers] ) , .flags="a" , .repeat=( g_iSeconds get_pcvar_numg_pSlayDelay ) + )  );
        }
    }
}

public 
DisplayHUDid )
{
    if ( 
g_szName] == EOS )
        
get_user_nameid g_szName charsmaxg_szName ) );
    
    if ( --
g_iSeconds >= 
    {
        
set_hudmessage170 255 , -1.0 0.40 0.0 1.0 0.0 0.0 , -);
        
ShowSyncHudMsgg_shHUD "%s will be slayed in %d second%s!" g_szName g_iSeconds g_iSeconds "s" "" );
    }
    else
    {
        
user_killid );
        
g_iSlayID 0;
        
g_szName] = EOS;
    }

__________________

Last edited by Bugsy; 05-24-2020 at 11:01.
Bugsy is offline
Reply


Thread Tools
Display Modes

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 11:34.


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