Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing map if you die.
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Changing map if you die.

Here's a timer that checks the player's health every 0.2 seconds (this is smallest time to loop without having an effect on performance); if the player's health reaches 0, the map will change:


void OnStart()
{
AddTimer("dead", 0.2f, "Check_Dead");
}

void Check_Dead(string &in asTimer)
{
AddTimer("dead", 0.2f, "Check_Dead");

if(GetPlayerHealth() == 0.0f)
{
ChangeMap("NAME_OF_MAP", "NAME_OF_START_POSITION", "", "");
RemoveTimer(asTimer);
}
}

Hope that helped!

I rate it 3 memes.
07-30-2012, 01:50 PM
Find


Messages In This Thread
Changing map if you die. - by onv - 07-30-2012, 01:43 PM
RE: Changing map if you die. - by Adny - 07-30-2012, 01:50 PM
RE: Changing map if you die. - by Your Computer - 07-30-2012, 02:21 PM
RE: Changing map if you die. - by onv - 07-30-2012, 06:55 PM



Users browsing this thread: 1 Guest(s)