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
i need some help/ explaination
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#10
RE: i need some help/ explaination

PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("Player""DoorLocked""DoorOpenSlamming""DOORopen"true);
    
AddUseItemCallback("""DoorLocked""SlammingSound""DOORopenSOUND"true);
    
AddUseItemCallback("""Key""Door""UseKeyOnDoor"true);
    
SetLocalVarInt("DoorVar"0);
    
SetSwingDoorLocked("Door_A"truetrue);
    
SetSwingDoorLocked("Door_B"truetrue);
    
SetEntityPlayerInteractCallback("Door_A""Slam_Door_B"false);
}

void UseKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
RemoveItem(asItem);
}

void Slam_Door_B(string &in asEntity)
{
    
AddLocalVarInt("DoorVar"1);
    
DoorCheck();
}

void DoorCheck()
{
    if(
GetLocalVarInt("DoorVar") == 10//Indicates you have to interact with it ten(10) times
    
{
        
AddTimer("Slam"2.75f"Slam");
    }
}

void Slam(string &in asTimer)
{
    
SetSwingDoorLocked("Door_B"falsefalse);
    
AddPropForce("Door_B", -100"World"); //Change the Z or X argument (X is the first zero, Z is the last zero) to fit your door's alignment


Corrected.


Here's a lesson.
Spoiler below!

ALL FUNCTIONS MUST EXIST IN A CALLBACK FUNCTION. So stuff like SetSwingDoorLocked or AddTimer must be inside things like:
void Function(parameter)
{
//Function//
}

If you see two void OnStarts that are conflicting, put the functions in the secondary OnStart. So if you see:
//Primary OnStart//
void OnStart()
{
//Function A..//
}
AND
//Secondary OnStart
void OnStart()
{
//Function B..
}

that, eliminate the second OnStart and put the functions in the secondary OnStart to the primary OnStart. In the end it should look like:
//Primary OnStart//
void OnStart()
{
//Function A...//
//Function B...// <- Function from second OnStart
}


"Veni, vidi, vici."
"I came, I saw, I conquered."
12-24-2014, 02:43 PM
Find


Messages In This Thread
i need some help/ explaination - by Headless - 12-24-2014, 01:28 AM
RE: i need some help/ explaination - by Kurton - 12-24-2014, 02:13 AM
RE: i need some help/ explaination - by Headless - 12-24-2014, 11:08 AM
RE: i need some help/ explaination - by Headless - 12-24-2014, 12:43 PM
RE: i need some help/ explaination - by Headless - 12-24-2014, 01:52 PM
RE: i need some help/ explaination - by Headless - 12-24-2014, 02:14 PM
RE: i need some help/ explaination - by PutraenusAlivius - 12-24-2014, 02:43 PM
RE: i need some help/ explaination - by Headless - 12-24-2014, 02:58 PM
RE: i need some help/ explaination - by Headless - 12-24-2014, 04:46 PM
RE: i need some help/ explaination - by Headless - 12-24-2014, 11:43 PM
RE: i need some help/ explaination - by L00T3R123 - 12-25-2014, 04:29 AM
RE: i need some help/ explaination - by Headless - 12-25-2014, 12:26 PM
RE: i need some help/ explaination - by Headless - 12-25-2014, 01:43 PM
RE: i need some help/ explaination - by Romulator - 12-26-2014, 05:35 AM
RE: i need some help/ explaination - by Headless - 12-26-2014, 01:03 PM
RE: i need some help/ explaination - by Headless - 12-26-2014, 05:48 PM
RE: i need some help/ explaination - by Headless - 12-26-2014, 06:22 PM
RE: i need some help/ explaination - by Traggey - 12-26-2014, 06:56 PM
RE: i need some help/ explaination - by Headless - 12-26-2014, 07:21 PM
RE: i need some help/ explaination - by Headless - 12-26-2014, 10:23 PM
RE: i need some help/ explaination - by Headless - 12-27-2014, 02:20 AM
RE: i need some help/ explaination - by Headless - 12-27-2014, 01:11 PM
RE: i need some help/ explaination - by Daemian - 12-27-2014, 04:34 PM



Users browsing this thread: 6 Guest(s)