Raised This Month: $23 Target: $400
 5% 

Remaining CT = slay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stefanos
Member
Join Date: May 2020
Old 05-22-2020 , 18:31   Remaining CT = slay
Reply With Quote #1

I Need plugin that will only work if server has 3 players(no counting bots,if counting bots 5 players)

When CT Stay ALONE vs TR, hud message is shown on screen RGB "000,000,255"
CT Slaying in: #seconds, when time ends, remaining CT Player get slayed.
Stefanos is offline
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 #2

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 online now
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 #3

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 online now
Old 05-23-2020, 07:42
Cirovic
This message has been deleted by Cirovic.
Stefanos
Member
Join Date: May 2020
Old 05-23-2020 , 11:09   Re: Remaining CT = slay
Reply With Quote #4

Okay bugsy, i didn't typed how i should.. when server has MORE than 3 players(or more than 5 players if bots are counted) last CT player will get slayed in 30 seconds... sorry i was typing that late..
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 11:37   Re: Remaining CT = slay
Reply With Quote #5

Above code is updated.
__________________

Last edited by Bugsy; 05-23-2020 at 11:38.
Bugsy is online now
Stefanos
Member
Join Date: May 2020
Old 05-23-2020 , 14:44   Re: Remaining CT = slay
Reply With Quote #6

It was 24ct vs 1 tr, i was last ct, and when i was remaining CT there was no HUD + i waited 1min and no slay :/
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 14:46   Re: Remaining CT = slay
Reply With Quote #7

You told me player count has to be > 3 or 5. Based on what you just said, if it's 1 tr vs 1 remaining ct, it will not work.
__________________
Bugsy is online now
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 14:49   Re: Remaining CT = slay
Reply With Quote #8

Assuming player count means ALIVE player count..
__________________
Bugsy is online now
Stefanos
Member
Join Date: May 2020
Old 05-23-2020 , 14:53   Re: Remaining CT = slay
Reply With Quote #9

yes my bad.. PLUGIN WILL WORK ONLY IF THERE IS MORE THAN 3 PLAYERS ON SERVER!!!(5 if counting bots)
BUT.. Plugin will slay only LAST ALIVE CT player !
so if is there 25 ct players and 1 remaining, hud is activated and player will be slayed in 30s
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 14:54   Re: Remaining CT = slay
Reply With Quote #10

Ok, so player count should include dead and alive?
__________________
Bugsy is online now
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 14:08.


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