AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Timeleft in rounds (https://forums.alliedmods.net/showthread.php?t=223483)

Gamperis 08-14-2013 06:18

Timeleft in rounds
 
Hello everyone. I am set in my server the map time in rounds, but when i type in chat timeleft, i do not see the map rounds remaining before change map... What do i do? Or i need other plugin? I use amx_round_count.amxx

The example what i need:

http://www.part.lt/img/7031b5bdabc02...2d7fa23657.png

I see which round now when the rounds start, but i do not see rounds remaining when i type timeleft...

http://www.part.lt/img/3e0fb335e58e4...bb67c25727.png

Xellath 08-14-2013 06:46

Re: Timeleft in rounds
 
That is pretty easily achieved.

Add the following in timeleft.sma and recompile it:

Under new g_Switch and above plugin_init() add:
Code:
new Rounds = 0;

Inside the plugin_init() function (inside the brackets) add:
Code:
register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" )

Under plugin_init() add:
Code:
public LogEvent_RoundStart( ) {     Rounds++; }

Look for client_print(0, print_chat, "%L", LANG_PLAYER, "NO_T_LIMIT") and comment or replace it with this:
Code:
client_print( 0, print_chat, "Rounds Remaining: %i", ( get_cvar_num( "mp_maxrounds" ) - Rounds ) );

That's it. Recompile and you're done.

Gamperis 08-14-2013 06:57

Re: Timeleft in rounds
 
1 Attachment(s)
Quote:

Originally Posted by Xellath (Post 2012785)
That is pretty easily achieved.

Add the following in timeleft.sma and recompile it:

Under new g_Switch and above plugin_init() add:
Code:
new Rounds = 0;

Inside the plugin_init() function (inside the brackets) add:
Code:
register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" )

Under plugin_init() add:
Code:
public LogEvent_RoundStart( ) {     Rounds++; }

Look for client_print(0, print_chat, "%L", LANG_PLAYER, "NO_T_LIMIT") and comment or replace it with this:
Code:
client_print( 0, print_chat, "Rounds Remaining: %i", ( get_cvar_num( "mp_maxrounds" ) - Rounds ) );

That's it. Recompile and you're done.

Compile errors, warnings. I do not understand not everything what you wrote because i am not English :(. Can you do it, please?

Xellath 08-14-2013 07:03

Re: Timeleft in rounds
 
1 Attachment(s)
Served on a silver platter.

Gamperis 08-14-2013 07:39

Re: Timeleft in rounds
 
Quote:

Originally Posted by Xellath (Post 2012793)
Served on a silver platter.

:D Thank you very much!


All times are GMT -4. The time now is 15:58.

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