Raised This Month: $ Target: $400
 0% 

[HELP] Get warmup time left


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NewbSkiddy
Junior Member
Join Date: Mar 2017
Old 05-16-2017 , 05:18   [HELP] Get warmup time left
Reply With Quote #1

Well, the title probably says it all. Is there anyway to get the time left of the warmup?
NewbSkiddy is offline
WilliamDG
Junior Member
Join Date: Oct 2016
Location: Italy
Old 05-17-2017 , 11:58   Re: [HELP] Get warmup time left
Reply With Quote #2

Quote:
Originally Posted by NewbSkiddy View Post
Well, the title probably says it all. Is there anyway to get the time left of the warmup?
Hi,

have you try:
PHP Code:
int warUpTime;
warUpTime GetConVarInt(FindConVar("mp_warmuptime")); 
I think the time you mean is mp_warmuptime this convar, in case i wrong change it with the convar you need.
WilliamDG is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-17-2017 , 18:23   Re: [HELP] Get warmup time left
Reply With Quote #3

mp_warmuptime is the warmup time length.

It doesn't count down.

Warmup time is probably held in gamerules.
__________________
Neuro Toxin is offline
WilliamDG
Junior Member
Join Date: Oct 2016
Location: Italy
Old 05-17-2017 , 21:11   Re: [HELP] Get warmup time left
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
mp_warmuptime is the warmup time length.

It doesn't count down.

Warmup time is probably held in gamerules.

Oh right,

so you can manage it calculating the time left by yourself with a timer:


PHP Code:
int countdown GetConVarInt(FindConVar("mp_warmuptime")); 
PHP Code:
//Create the timer when warmup start
CreateTimer(1.0Call_Back_Here_TIMER_REPEAT);     //I think repeat it every 1 sec is good 
PHP Code:
public Action Call_Back_Here(Handle timer)
{
     
//Every time you are here it's past 1 sec so you can create a GLOBAL countdown int and use it
     
countdown--;
     if(
countdown == 0)
           return 
Plugin_Stop;
     return 
Plugin_Continue;

I'm new at sourcemod scripting so i can wrong something but i hope to be helpful to you

Last edited by WilliamDG; 05-17-2017 at 21:16.
WilliamDG is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-17-2017 , 21:38   Re: [HELP] Get warmup time left
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?p=2327031

Quote:
Originally Posted by maciasbarlinek View Post
Code:
if(GameRules_GetProp("m_bWarmupPeriod") == 1)
        ReplyToCommand(client, "You cannot use this command on warmup..");
        return Plugin_Handled;
}
Should it work?
Quote:
Originally Posted by Darkness_ View Post
Yep.

Member: m_bWarmupPeriod (offset 55 (type integer) (bits 1) (Unsigned)
Member: m_fWarmupPeriodEnd (offset 560) (type float) (bits 0) (NoScale)
Member: m_fWarmupPeriodStart (offset 564) (type float) (bits 0) (NoScale)
__________________

Last edited by Neuro Toxin; 05-17-2017 at 21:39.
Neuro Toxin 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 15:54.


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