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_Live( Client )
{
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_num( Rcount ) ) //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!!