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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Script help

Here's what i used to bang the door three times:
string current_door = "";

void BangDoorThreeTimes()
    {
        current_door = "front_door";
        AddTimer("door_slam1", 0, "PlaySound");
        AddTimer("door_slam2", 0.5, "PlaySound");
        AddTimer("door_slam3", 1, "PlaySound");
    }

void PlaySound(string &in timer_name)
    {
        if (StringContains(timer_name, "door_slam"))
            PlaySoundAtEntity("hit_wood2", "hit_wood.snt", current_door, 0, false);
    }

(07-28-2011, 11:52 PM)DRedshot Wrote: how would i get the return value to use in another part of my script? thanks

int func()
{
int i = 1;
return i; // or just: return 1;
}

void other_func ()
{
int i = func();
}

Tutorials: From Noob to Pro
(This post was last modified: 07-29-2011, 04:17 AM by Your Computer.)
07-29-2011, 04:13 AM
Website Find


Messages In This Thread
Script help - by DRedshot - 07-28-2011, 09:35 PM
RE: Script help - by palistov - 07-28-2011, 10:07 PM
RE: Script help - by DRedshot - 07-28-2011, 11:52 PM
RE: Script help - by Your Computer - 07-29-2011, 04:13 AM
RE: Script help - by palistov - 07-29-2011, 07:28 AM
RE: Script help - by DRedshot - 07-29-2011, 11:08 AM
RE: Script help - by palistov - 07-29-2011, 01:24 PM



Users browsing this thread: 1 Guest(s)