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

Remaining CT = slay


Post New Thread Reply   
 
Thread Tools Display Modes
Stefanos
Senior Member
Join Date: May 2020
Old 05-23-2020 , 21:55   Re: Remaining CT = slay
Reply With Quote #41

Oh i get it.. sorry im bad with english, dont get mad.. can you do something that death dont need to happen, bcs what if im in 85 seconds on round, and im alone.. plugin wont work then.. i hope u understand me..
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 21:56   Re: Remaining CT = slay
Reply With Quote #42

Ok hang on
__________________

Last edited by Bugsy; 05-23-2020 at 21:56.
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2020 , 21:57   Re: Remaining CT = slay
Reply With Quote #43

Try above code
__________________
Bugsy is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-23-2020 , 21:59   Re: Remaining CT = slay
Reply With Quote #44

works perfect, add deagle for allowed guns, and thats it

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

Code updated for CT slay

You can make it allow deagle, look at the code for other allowed weapons and figure it out
__________________

Last edited by Bugsy; 05-23-2020 at 22:26.
Bugsy is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-24-2020 , 07:27   Re: Remaining CT = slay
Reply With Quote #46

slay for ct does not work, again 2 min passed, last alive 10 dead, nothing happens..

Last edited by Stefanos; 05-24-2020 at 10:35.
Stefanos is offline
Old 05-24-2020, 07:42
Cirovic
This message has been deleted by Cirovic.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-24-2020 , 11:09   Re: Remaining CT = slay
Reply With Quote #47

Please re-test, it's working fine for me.
__________________
Bugsy is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-25-2020 , 08:35   Re: Remaining CT = slay
Reply With Quote #48

retested 10times, sometimes WORK sometimes DONT work... dont know reason but i sometime get slayed, sometime no..
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 12:19   Re: Remaining CT = slay
Reply With Quote #49

I added logging. When it doesn't work, I need the logs for that time frame.
PHP Code:

#include <amxmodx>

new const Version[] = "0.61";

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" );
    
log_to_file"CTSlay.log" "Plugin started, starting task" );
}

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

public 
client_disconnectid )
{
    
g_Bots &= ~( << ( id 31 ) );
    
    if ( 
id == g_iSlayID )
    {
        
log_to_file"CTSlay.log" "Removed HUD on disconnect - g_iSlayID=%d" g_iSlayID );
        
remove_taskg_iSlayID );
        
g_iSlayID 0;
    }
}

public 
NewRound()
{
    
log_to_file"CTSlay.log" "New round" );
    
g_iRoundStartTime get_systime();
}

public 
RoundEnd()
{
    
log_to_file"CTSlay.log" "Removed HUD on round end - g_iSlayID=%d" g_iSlayID );
    
remove_taskg_iSlayID );
    
g_iSlayID 0;
}

public 
SlayCheck()
{
    new 
iPlayers32 ] , iCTNum iTNum
    
    log_to_file
"CTSlay.log" "Task Check - g_iSlayID=%d : Slay delay: %d >= %d : Players %d > %d" g_iSlayID get_systime() - g_iRoundStartTime get_pcvar_numg_pPluginStartDelay ) , get_playersnum() , get_pcvar_numg_Bots g_pSlayWithBots g_pSlayNoBots ) );
    
    if ( !
g_iSlayID && ( get_systime() - g_iRoundStartTime ) >= get_pcvar_numg_pPluginStartDelay ) && ( get_playersnum() > get_pcvar_numg_Bots g_pSlayWithBots g_pSlayNoBots ) ) )
    {
        
get_playersiPlayers iTNum "ae" "TERRORIST" );
        
get_playersiPlayers iCTNum "ae" "CT" );
        
        if ( ( 
iCTNum == ) && iTNum )
        {
            
get_user_name( ( g_iSlayID iPlayers] ) , g_szName charsmaxg_szName ) );
            
set_task1.0 "DisplayHUD" g_iSlayID , .flags="a" , .repeat=( g_iSeconds get_pcvar_numg_pSlayDelay ) + ) );
            
            
log_to_file"CTSlay.log" "Created HUD on %d" g_iSlayID );
        }
    }
}

public 
DisplayHUDid )
{
    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;
    }

__________________

Last edited by Bugsy; 08-17-2020 at 16:55.
Bugsy is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-25-2020 , 12:49   Re: Remaining CT = slay
Reply With Quote #50

@Bugsy can i ask you, why arent you checking this on DeathMsg event and get players count accordingly instead of adding a task to be executed every second ?

Last edited by instinctpt1; 05-25-2020 at 12:55. Reason: hm got it
instinctpt1 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 19:42.


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