Re: [hlcoders] Making timers

2005-02-21 Thread Andre Bandarra
Or you can always use the CountDownTimer class in the util_shared.h...

CountDownTimer roundTimer;
roundTimer.Start(mp_roundlimit.GetFloat() * 60);

if (roundTimer.isElapsed())
{

}

roundTimer.Reset()...

and so on.. Just look the CountDownTimer class.


On Mon, 21 Feb 2005 17:04:09 +, Ben Davison
[EMAIL PROTECTED] wrote:
 I'll show you my basic timer(you have to add the hud elements yourself)

 This for HL2DM.

 multiplay_gamerules.h
 extern ConVar mp_roundlimit;

 multiplay_gamerules.cpp
 // Round limit
 ConVar  mp_roundlimit( mp_roundlimit,
  0,
  FCVAR_NOTIFY|FCVAR_REPLICATED,
  game time per round in minutes );

 hl2mp_gamerules.cpp

 void CHL2MPRules::Think( void ) In this function.

  float flRoundTimer = mp_roundlimit.GetFloat() * 60;

 //Intrest: Timer.
 if ( flRoundTimer != 0  gpGlobals-curtime = flRoundTimer )
 {
 Msg(Round over);
 return;
 //RestartRound();
 }

 As you can see you will have to put it on the hud and RestartRound();
 On Thu, 01 Jan 2004 00:13:54 +, Knifa [EMAIL PROTECTED] wrote:
  Okay, thanks alot :)
 
  http://www.sourcewiki.org/wiki/index.php/Creating_a_Roundtimer
  
  that shows you how to make a round timer and display it on the HUD.
  basically all you do is put a timer in either your game rules(for a
  global timer) or your player(for a timer for each player) by checking
  a start time against gpGlobals-curtime and getting a hud element to
  display it, or in your case call something to trigger a build event
  and restart. the tute decribes it better :(
  
  
  --
  **
  Draco
  Coder for Perfect Dark and Kreedz Climbing
  http://perfectdark.game-mod.net
  
  ___
  To unsubscribe, edit your list preferences, or view the list archives, 
  please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
  
  
  
  
  
  
 
  --
  Knifa
  Domino Mod
  http://knd.org.uk/dominomod/
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives, 
  please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 

 --
 - Ben Davison
 - http://www.shadow-phoenix.com

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] Making timers

2005-02-19 Thread Knifa
Hi all.
How would I go about setting up round timers?
I want to have it so that a timer goes for 10 minutes (mp_buildtime)
then, when that ends, do something and start another timer, then do
something with that.
(Sorry if that didn't make any sense)
Thanks.
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


Re: [hlcoders] Making timers

2005-02-19 Thread Knifa
Okay, thanks alot :)
http://www.sourcewiki.org/wiki/index.php/Creating_a_Roundtimer
that shows you how to make a round timer and display it on the HUD.
basically all you do is put a timer in either your game rules(for a
global timer) or your player(for a timer for each player) by checking
a start time against gpGlobals-curtime and getting a hud element to
display it, or in your case call something to trigger a build event
and restart. the tute decribes it better :(
--
**
Draco
Coder for Perfect Dark and Kreedz Climbing
http://perfectdark.game-mod.net
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



--
Knifa
Domino Mod
http://knd.org.uk/dominomod/
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders