The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with script
amusei Offline
Junior Member

Posts: 23
Threads: 8
Joined: Aug 2012
Reputation: 2
#1
Information  Help with script

Hi, guys.

I am trying to call a certain func when the player interacts with a door and the door is not locked. However, the function just keeps repeating when the player interacts and I want it to stop after it is called once. Here is my script.

void OnStart()
{
SetEntityPlayerInteractCallback("mansion_6", "Fade", false);
}

void Fade(string &in asEntity)
{
    if(GetSwingDoorLocked("mansion_6") == false)
    {
        SetSwingDoorClosed("mansion_3", true, true);
        SetSwingDoorLocked("mansion_3", true, true);
        PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
        GiveSanityDamage(10, true);
        StartScreenShake(0.05f, 3.5f, 1.25f, 3.5f);
        FadePlayerRollTo(-50, 33, 33);
        MovePlayerHeadPos(0, -1, 0, 1, 0);
        PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, false);
        SetPlayerCrouching(true);
        SetPlayerActive(false);
        FadeOut(7);
        AddTimer("", 13, "Fog");
    }
}

If I change the
SetEntityPlayerInteractCallback("mansion_6", "Fade", false);
to
SetEntityPlayerInteractCallback("mansion_6", "Fade", true);

The "Fade" won't be called if the player has already interacted with the door when it's locked. If it remains "false" it will just continue to repeat (the player will just fade every time he touches the door if it isn't locked and I want him to fade only the first time). Quite a head rush, eh ? Smile . I hope it has a solution Big Grin
(This post was last modified: 08-28-2012, 07:23 AM by amusei.)
08-27-2012, 10:16 AM
Find


Messages In This Thread
Help with script - by amusei - 08-27-2012, 10:16 AM
RE: Help with script - by Adny - 08-27-2012, 10:36 AM
RE: Help with script - by amusei - 08-28-2012, 07:02 AM
RE: Help with script - by Adny - 08-28-2012, 07:12 AM
RE: Help with script - by amusei - 08-28-2012, 07:22 AM



Users browsing this thread: 1 Guest(s)