Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
why wont this work :<
void OnStart() { AddEntityCollideCallback("Player", "area1", "func_slam", true, 1); }
void func_slam(string &in asParent, string &in asChild, int alState) { SetPropHealth("door1", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); }
i want that the player enters an area wich makes the door explode (not interacting with any entetie)
(This post was last modified: 01-10-2012, 11:14 AM by Quotentote.)
|
|
01-10-2012, 10:05 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: why wont this work :<
Is it giving you an error?
|
|
01-10-2012, 10:16 AM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: why wont this work :<
no^^ i can hear the sound files but the door doesnt explode (01-10-2012, 10:16 AM)flamez3 Wrote: Is it giving you an error?
|
|
01-10-2012, 10:22 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: why wont this work :<
What door is this?
|
|
01-10-2012, 10:27 AM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: why wont this work :<
a prison section (im on that part you already know^^)
the grunt cant smash the door so i created an area that gets activated after the first script. i want the player to get chased after entering the second script area so that he has a little chance
if its not 'smashable' could i do something like unlocking the door with that script?
(This post was last modified: 01-10-2012, 10:31 AM by Quotentote.)
|
|
01-10-2012, 10:30 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: why wont this work :<
I'm not sure if that door can be broken. If the sounds are playing it means that the function is being called; but the door isn't been destroyed. Yeh; sounds like it can't be broken. :/ I guess you would just have to make the door open instead of it breaking apart.
(This post was last modified: 01-10-2012, 10:32 AM by flamez3.)
|
|
01-10-2012, 10:32 AM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: why wont this work :<
SetSwingDoorLocked("door1", false, true);
?
void func_slam(string &in asParent, string &in asChild, int alState) { SetSwingDoorLocked("door1", false, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); }
tried this but it didnt work T_T
(This post was last modified: 01-10-2012, 10:40 AM by Quotentote.)
|
|
01-10-2012, 10:33 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: why wont this work :<
(01-10-2012, 10:33 AM)Quotentote Wrote: SetSwingDoorLocked("door1", false, true);
?
void func_slam(string &in asParent, string &in asChild, int alState) { SetSwingDoorLocked("door1", false, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); }
tried this but it didnt work T_T That only unlocks the door, doesn't make it swing open.
AddPropImpulse("door1", float afX, float afY, float afZ, "world");
The floats are X, Y and Z. Look into the map and check what axis the door moves on to open. Then add like a 2 or 4 on that float, leave all the others to 0.
Or you could just
SetEntityActive("door1", false);
SetEntityActive("door2", true);
Click on the door1 and hit Ctrl + D and make door2 unactive, also make the OpenAmount to 1.
(This post was last modified: 01-10-2012, 10:55 AM by flamez3.)
|
|
01-10-2012, 10:55 AM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: why wont this work :<
okay thanks im going to use the active/inactive thing cause im not pretty goot in these propimpulse things...a few more tips and i have to write 'made by flamez3' o.o
|
|
01-10-2012, 11:07 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: why wont this work :<
Hahaha ^^
|
|
01-10-2012, 11:27 AM |
|
|