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
Can't for the problem with the unexpected token [SOLVED]
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#6
RE: Can't for the problem with the unexpected token

///////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "crowbar", "crowbardoor", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
SetEntityPlayerInteractCallback("slamdoor", "func_slam", true);
AddUseItemCallback("", "key1", "lockeddoor1", "unlock", true);
}


void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar");
}

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("crowbardoor", false, true);
AddPropImpulse("crowbardoor", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("crowbardoor", true);
SetSwingDoorClosed("crowbardoor", false, false);
SetMoveObjectState("crowbardoor", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}


void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("slamdoor", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}

void unlock(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem("key1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}

(This post was last modified: 06-18-2012, 04:28 PM by Rownbear.)
06-18-2012, 04:28 PM
Find


Messages In This Thread
RE: Can't for the problem with the unexpected token - by Rownbear - 06-18-2012, 04:28 PM



Users browsing this thread: 1 Guest(s)