Raised This Month: $ Target: $400
 0% 

Changing Timeleft


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPQC
SourceMod Donor
Join Date: Dec 2011
Old 06-10-2012 , 16:53   Changing Timeleft
Reply With Quote #1

How do we access the current timeleft (ie when a player types timeleft)? There's a command to get the current time left, GetMapTimeLeft(), but how can set we the time left?
MPQC is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 06-10-2012 , 18:05   Re: Changing Timeleft
Reply With Quote #2

I'm also interested in finding out how to alter the time life until map change.
Maybe there is an offset or anything like that ?

I've seen a method with getting mp_timeleft cvar pointer and later setting time left with set_pcvar_num(pointer, value) but it is a bad method.
t3hNox is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-10-2012 , 18:49   Re: Changing Timeleft
Reply With Quote #3

Quote:
Originally Posted by t3hNox View Post
I've seen a method with getting mp_timeleft cvar pointer and later setting time left with set_pcvar_num(pointer, value) but it is a bad method.
try
set_cvar_num("mp_timeleft", desiredTime)
that's what the documentation tells us to do.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
isotonic
AlliedModders Donor
Join Date: Jun 2011
Location: Moscow, Russia
Old 06-10-2012 , 22:38   Re: Changing Timeleft
Reply With Quote #4

Quote:
Originally Posted by MPQC View Post
How do we access the current timeleft (ie when a player types timeleft)? There's a command to get the current time left, GetMapTimeLeft(), but how can set we the time left?
Use get_timeleft(), then alter mp_timelimit value as you need. You can't set timeleft directly as I know.

Quote:
Originally Posted by t3hNox View Post
I'm also interested in finding out how to alter the time life until map change.
What?
__________________
isotonic is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 06-11-2012 , 06:54   Re: Changing Timeleft
Reply With Quote #5

Lol, I obviously meant "time left" not "time life"

@Liverwiz
The problem with that method is that if original time limit is, for example, 20 mins. and a map has been played for more than these 20 mins. then changing mp_timelimit value will result in map change. At least I've experienced this issue.
t3hNox is offline
MPQC
SourceMod Donor
Join Date: Dec 2011
Old 06-11-2012 , 10:39   Re: Changing Timeleft
Reply With Quote #6

Well what I'm doing is when nobody is on a team, the timer resets (happens a lot on deathrun servers, even when they're full), so I'm trying to prevent this.
MPQC is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-11-2012 , 10:45   Re: Changing Timeleft
Reply With Quote #7

Quote:
Originally Posted by MPQC View Post
How do we access the current timeleft (ie when a player types timeleft)? There's a command to get the current time left, GetMapTimeLeft(), but how can set we the time left?
Where do you see that command? Are you talking about Source or HL1-based games?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
MPQC
SourceMod Donor
Join Date: Dec 2011
Old 06-11-2012 , 11:19   Re: Changing Timeleft
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
Where do you see that command? Are you talking about Source or HL1-based games?
I'm talking about Source, and it's in the API.
MPQC is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-11-2012 , 11:26   Re: Changing Timeleft
Reply With Quote #9

You should post in the SourceMod section, then. This is the AMXX section.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
MPQC
SourceMod Donor
Join Date: Dec 2011
Old 06-11-2012 , 19:24   Re: Changing Timeleft
Reply With Quote #10

Whoops..lol
MPQC 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 11:47.


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