Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ Help request
Re: C++ Help request [message #420789 is a reply to message #420409] Wed, 24 February 2010 10:48 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
time_t reftime = 0;
bool ShowHealth = 1;


void TimerThink()
{
   if(reftime - time(0) > 5)
   {
      ShowHealth = ShowHealth ? 0 : 1;
      reftime = time(0);
   }
}

//draw code:

TimerThink(); //not a good place for this tbh, but whatever

if(ShowHealth)
{
    //draw health
}


Be sure to:

#include "time.h"
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help installing LUA 5?
Next Topic: C&C Volcano
Goto Forum:
  


Current Time: Sun Dec 22 01:48:43 MST 2024

Total time taken to generate the page: 0.00908 seconds