08-31-2012, 08:19 AM
le try this:
void OnStart()
{
AddEntityCollideCallback("Player", "script_slam_1", "func_slam_shut", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_1", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_2", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_3", "func_slam", true, 1);
}
void func_slam_shut(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("prison1", true, true);
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 func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door_smash_1", 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);
SetPropHealth("door_smash_2", 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);
SetPropHealth("door_smash_3", 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);
}
I'm not quite sure it's this you want but this is what I can make out of your explaination.
also I higlighted some stuff which name I changed baceause you can't use spaces alos make area's with the name I put in the code.
void OnStart()
{
AddEntityCollideCallback("Player", "script_slam_1", "func_slam_shut", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_1", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_2", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_3", "func_slam", true, 1);
}
void func_slam_shut(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("prison1", true, true);
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 func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door_smash_1", 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);
SetPropHealth("door_smash_2", 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);
SetPropHealth("door_smash_3", 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);
}
I'm not quite sure it's this you want but this is what I can make out of your explaination.
also I higlighted some stuff which name I changed baceause you can't use spaces alos make area's with the name I put in the code.