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

Restart round without affecting the timeleft


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 04-22-2017 , 15:11   Restart round without affecting the timeleft
Reply With Quote #1

Hello, as the title says. i want a way to Restart round without changing the timeleft (ps: killing all players won't do it cuz i have fake bot that's always alive)
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-22-2017 , 15:14   Re: Restart round without affecting the timeleft
Reply With Quote #2

1. save the timeleft in a variable
2. restart the round
3. set the old timeleft
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 04-22-2017 , 15:15   Re: Restart round without affecting the timeleft
Reply With Quote #3

would u share a small snippet, i have something like this in mind but i dunno how to do it.
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-22-2017 , 15:25   Re: Restart round without affecting the timeleft
Reply With Quote #4

Code:
new g_pTimelimit, g_iTimelimit new bool:g_bRestart public plugin_init() {     g_pTimelimit = get_cvar_pointer("mp_timelimit")     register_logevent("OnRoundRestart", 2, "0=World triggered", "1&Restart_Round_")     register_logevent("OnRoundRestart", 2, "0=World triggered", "1=Game_Commencing")     register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start") } public OnRoundRestart() {     if(g_bRestart)         return             g_bRestart = true     g_iTimelimit = get_pcvar_num(g_pTimelimit) } public OnRoundStart() {     if(g_bRestart)     {         set_pcvar_num(g_pTimelimit, g_iTimelimit)         g_bRestart = false     } }
__________________

Last edited by OciXCrom; 04-22-2017 at 15:26.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 04-22-2017 , 15:44   Re: Restart round without affecting the timeleft
Reply With Quote #5

Quote:
g_iTimelimit = get_pcvar_num(g_pTimelimit)
i think this is getting the default map time not timeleft
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-22-2017 , 16:12   Re: Restart round without affecting the timeleft
Reply With Quote #6

Just edit the timeleft plugin
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 04-22-2017 , 16:47   Re: Restart round without affecting the timeleft
Reply With Quote #7

Solved thx i used this
Quote:
new g_iTimelimit[3];
get_cvar_string("amx_timeleft", g_iTimelimit, 2);
set_cvar_string("mp_timelimit", g_iTimelimit);
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn 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 22:48.


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