Raised This Month: $ Target: $400
 0% 

Miscount roundtime help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hectik17
AlliedModders Donor
Join Date: Oct 2005
Old 03-13-2017 , 04:47   Miscount roundtime help
Reply With Quote #1

I have this working but it will exec early so i have to change the round count up to 16 or 17 when it should run the cmd at the 15th round.

But i think the lo3 sv_restartround 1 is getting counted into it. I want the round count to start after lo3 so any rounds won or lost to ct or t before the lo3 are not included in the increment. The plugin getting disabled at 15th round it a team-lock plugin. This is so players are able to change teams at half time and wen relive on 3 the plugin is te enabled. Also i have "cmd live" exec the plugin in my war.cfg

PHP Code:
#include < amxmodx >
#include < cstrike >

new CurrentRound;
new 
Rcount;

public 
plugin_init( )
{
    
register_concmd"live""ClientCommand_Live" );
    
//register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" );    
    
register_logevent"LogEvent_RoundEnd"2"1=Round_End" );        //FOUND THIS WOULD COUNT ROUNDS MORE ACCURATE
    //register_event("HLTV", "round_start", "a", "1=0", "2=0")        //DONT KNOW HOW OR IF THIS WOULD BE BETER
    
register_event"SendAudio""Event_SendAudio_TWin""a""2&%!MRAD_terwin" );
    
register_event"SendAudio""Event_SendAudio_CTWin""a""2&%!MRAD_ctwin" );
    
    
Rcount register_cvar"amx_rcount""15"ADMIN_BAN );
    
    
state live;
    
CurrentRound 0;
}
//STARTS WHEN amx_rcon "cmd live" IS EXEC IN MY **WAR.CFG**
public ClientCommand_LiveClient )
{
    
server_cmd"amx_rcount 15" );            //CANT GET ROUNDS TO RESET ON /LO3
    
CurrentRound 0;                //ONLY RESETS IF TEAMS JOIN TO STARTGAME OR ON NEW MAP
    
{                //SV_RESTARTROUND 1 CMDS AND WARMUP ROUNDS ARE INCLUDED, NOT GOOD!! ENABLES TEAM TO SWAP EARLY AND STACKERS TO JOIN
new Rcount get_pcvar_num(Rcount)            //GET THE CVAR NUMBER 15 AND THEN STARTS COUNTING
}
}
//COUNTS THE ROUNDS AFTER ROUND END **TEAM DIES**
public LogEvent_RoundEnd( ) <live>
{
    
CurrentRound++;
    if( 
CurrentRound >= get_pcvar_numRcount ) )    //IF ROUND IS EQUAL OR ABOVE CVAR **15* EXEC DISABLE TEAMLOCK
    
{
        
server_cmd"fmatch_enable 0" );    //ENABLES PLAYER TO CHANGE TEAM **M1** **M2**
        
CurrentRound 0;
}
}
//WHEN TEAM WINS A ROUND
public Event_SendAudio_TWin( ) <live>            //DONT THINK I NEED THIS BUT IT WAS USED WHEN I WAS..
{
}
public 
Event_SendAudio_CTWin( ) <live>            //REGISTERING EVENT TWIN CTWIN SOUNDS TO COUNT ROUNDS **WAS INCORECT**
{
}                            
//ONLY PROBLEM I NEED HELP WITH IS RESETING CURRENTROUND = 0 WHEN I EXEC war.cfg IT DONT WORK 
UPDATED

one problem cant reset round count halfway Thru a pug if its not live and needs to start from the beginning, rounds are still counted from the false NL pug. and then that enables specs to stack and join a team when it should be 5v5

i got the rounds to count accurate, well accurate enough to not be a issue.

please help me able to restart the count!!

Last edited by Hectik17; 03-14-2017 at 04:40. Reason: Updated progress
Hectik17 is offline
Old 03-13-2017, 09:47
Hectik17
This message has been deleted by Hectik17.
Hectik17
AlliedModders Donor
Join Date: Oct 2005
Old 03-14-2017 , 04:37   Re: Miscount roundtime help
Reply With Quote #3

ive done it im a frigin genius, lol if anyone can over look and see if im missing something or can tidy up the code that would be good, i know im missing author info, but is that needed relay?

PHP Code:
#include < amxmodx >
#include < cstrike >

new CurrentRound;
new 
Rcount;

public 
plugin_init( )
{
    
register_concmd"live""ClientCommand_Live" );
    
//register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" );
    
register_logevent"RoundEnd"2"1=Round_End" );
    
//register_event("HLTV", "round_start", "a", "1=0", "2=0")
    
Rcount register_cvar"amx_rcount""15"ADMIN_BAN );
    
register_event"SendAudio""Event_SendAudio_TWin""a""2&%!MRAD_terwin" );
    
register_event"SendAudio""Event_SendAudio_CTWin""a""2&%!MRAD_ctwin" );
    
register_event("TextMsg","Reset_Counter","a","2&#Game_C","2&#Game_w")
    
state live;
    
CurrentRound 0;
}
public 
ClientCommand_LiveClient )
{
    
server_cmd"amx_rcount 15" );
    
CurrentRound 0;
    {
        new 
Rcount get_pcvar_num(Rcount)
    }
}

public 
RoundEnd( ) <live>
{
    
CurrentRound++;
    if( 
CurrentRound >= get_pcvar_numRcount ) )
    {
        
server_cmd"fmatch_enable 0" );
        
CurrentRound 0;
    }
}
public 
Reset_Counter( ) <live>
{
    
state live;
    
CurrentRound 0;
}

public 
Event_SendAudio_TWin( ) <live>
{
}
public 
Event_SendAudio_CTWin( ) <live>
{


Last edited by Hectik17; 03-14-2017 at 05:51. Reason: Dont need ya hospitality
Hectik17 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 17:49.


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