Raised This Month: $ Target: $400
 0% 

Auto Restartround


Post New Thread Reply   
 
Thread Tools Display Modes
feren02
Senior Member
Join Date: Mar 2012
Old 03-09-2022 , 00:30   Re: Auto Restartround
Reply With Quote #11

Quote:
Originally Posted by Supremache View Post
When the countdown end or when the new round start or when the round end etc..
tried it does not work.

The first sv_restart counts properly 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

However after 30 rounds again, it counts -1, -2, -3, -4, -5, -6, -7, -8, -9, -10

After 30 rounds again it counts, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20

Should always be 10, 9, 8, 7, 6, 5, 4, 3, 2, 1


Please help.
feren02 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-09-2022 , 02:01   Re: Auto Restartround
Reply With Quote #12

5
Quote:
Originally Posted by feren02 View Post
tried it does not work.

The first sv_restart counts properly 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

However after 30 rounds again, it counts -1, -2, -3, -4, -5, -6, -7, -8, -9, -10

After 30 rounds again it counts, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20

Should always be 10, 9, 8, 7, 6, 5, 4, 3, 2, 1


Please help.

Try this, Untested, Next time request on the suggestion/request section:
Code:
#include <amxmodx> #include <cromchat> #if !defined MAX_FMT_LENGTH     const MAX_FMT_LENGTH = 192 #endif const TASK_RESTART = 616641; enum _:TotalCvar {     Restart_Round,     Restart_Time,     Restart_Sound,     Restart_Message,     Restart_HudMessage,     Restart_HudColor } new g_iGameRounds, g_iCountdown, g_iCvars[ TotalCvar ] public plugin_init( ) {     register_plugin( "Auto restart round", "1.0.0", "Supremache" )         CC_SetPrefix( "^4[AutoRestart]" )         register_event( "HLTV", "OnRoundStart", "a", "1=0", "2=0" );         g_iCvars[ Restart_Round ] = register_cvar( "amx_restartround", "30" )     g_iCvars[ Restart_Time ] = register_cvar( "amx_restart_time", "10" )     g_iCvars[ Restart_Sound ] = register_cvar( "amx_restart_sound", "1" )     g_iCvars[ Restart_Message ] = register_cvar("amx_restart_message", "30 ROUNDS ENDED! Restarting..." )     g_iCvars[ Restart_HudMessage ] = register_cvar( "amx_restart_hudmessage", "%seconds% seconds until restart!" )     g_iCvars[ Restart_HudColor ] = register_cvar( "amx_restart_hudcolor", "0 255 0" ) } public OnRoundStart( ) {     if( ++g_iGameRounds == get_pcvar_num( g_iCvars[ Restart_Round ] ) )     {         if( !task_exists( TASK_RESTART ) )         {             set_task( 1.0, "OnTaskCountDown", TASK_RESTART, .flags = "a" , .repeat = ( g_iCountdown = get_pcvar_num( g_iCvars[ Restart_Time ] ) - 1 ) )         }     } } public OnTaskCountDown( ) {     new szMessage[ MAX_FMT_LENGTH ], szColor[ 12 ], szRed[ 4 ], szGreen[ 4 ], szBlue[ 4 ], szRounds[ 4 ], szCountdown[ 4 ];     get_pcvar_string( g_iCvars[ Restart_HudMessage ], szMessage, charsmax( szMessage ) )     get_pcvar_string( g_iCvars[ Restart_HudColor ], szColor, charsmax( szColor ) )     parse( szColor, szRed, charsmax( szRed ), szGreen, charsmax( szGreen ), szBlue, charsmax( szBlue ) )     new R = clamp( str_to_num( szRed ), -1, 255 )     new G = clamp( str_to_num( szGreen ), -1, 255 )     new B = clamp( str_to_num( szBlue ), -1, 255 )         g_iCountdown--         if( get_pcvar_num( g_iCvars[ Restart_Sound ] ) )     {         new szSoundNum[ 16 ]         num_to_word( g_iCountdown, szSoundNum, charsmax( szSoundNum ) )         client_cmd(0, "spk ^"vox/%s^"", szSoundNum )     }         num_to_str( g_iGameRounds, szRounds, charsmax( szRounds ) )     num_to_str( g_iCountdown, szCountdown, charsmax( szCountdown ) )     replace_all( szMessage, charsmax( szMessage ), "%round%", szRounds )     replace_all( szMessage, charsmax( szMessage ), "%seconds%", szCountdown )     replace_all( szMessage, charsmax( szMessage ), "/n", "^n" )         set_hudmessage( R, G, B, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10 );     show_hudmessage( 0, szMessage );         if( !g_iCountdown )     {         server_cmd("sv_restart 1")         get_pcvar_string( g_iCvars[ Restart_Message ], szMessage, charsmax( szMessage ) )         CC_SendMessage( 0, szMessage )     } }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 03-09-2022 at 03:50.
Supremache is offline
PatrickEganlandria
BANNED
Join Date: Feb 2022
Old 03-14-2022 , 06:17   Re: Auto Restartround
Reply With Quote #13

you are using this on zombie escape with this mod ? are you sure
i tried it yesterday and nothin work like the echatrandom one i give.

Last edited by PatrickEganlandria; 11-23-2022 at 23:58.
PatrickEganlandria is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-14-2022 , 07:21   Re: Auto Restartround
Reply With Quote #14

No, I just recreated the plugin you attached
Also Iam not at home for testing it
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-14-2022 , 11:00   Re: Auto Restartround
Reply With Quote #15

Try, If it still didn't work then wait untill i back
PHP Code:
if( !g_iCountdown )
    {
        
server_cmd("sv_restart 1")
        
get_pcvar_stringg_iCvarsRestart_Message ], szMessagecharsmaxszMessage ) )
        
CC_SendMessage0szMessage )
    } 

PHP Code:
if( g_iCountdown == )
    {
        
server_cmd("sv_restart 1")
        
get_pcvar_stringg_iCvarsRestart_Message ], szMessagecharsmaxszMessage ) )
        
CC_SendMessage0szMessage )
    } 
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-18-2022 , 11:02   Re: Auto Restartround
Reply With Quote #16

I tested old code and it worked perfectly without any problem
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache 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 21:59.


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