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
Script Help [FIXED] "If get player health" function?
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#9
RE: [FIXED] "If get player health" function?

(05-12-2016, 11:15 PM)Daemian Wrote:
(05-12-2016, 09:03 PM)Darkfire Wrote: Shit. I forgot that the entities will collide all the time, so most likely you're right.
However If you set the timer to 0.01f the delay will be unnoticeable.
But you were right imo, I think that code is not working too.
He probably solved it using timers cause -as you know- that callback should only trigger when the player enters/leaves the area, and that happens only once.

PHP Code: (Select All)
void OnStart()
{
AddTimer("tmr_heal"0.01f"healing_timer");
}
void healing_timer(string &in asTimer)
{
    if(
GetPlayerHealth() >= 40.0f
        {
            
FadeImageTrailTo(0,0.2f); 
            
CompleteQuest("quest_heall""heal");
            
RemoveTimer("tmr_heal");
            
AddTimer("tmr_chapter"4.0f"chapter_switch"); 
            
SetLevelDoorLocked("level_celler_1"false);
            return;
        }
    
//AddDebugMessage("Health = " + GetPlayerHealth(), false);
    
SetPlayerHealth(30.0f);
    
AddTimer("tmr_heal"0.01f"healing_timer"); 

05-14-2016, 12:09 PM
Find


Messages In This Thread
RE: [FIXED] "If get player health" function? - by Slanderous - 05-14-2016, 12:09 PM



Users browsing this thread: 1 Guest(s)