Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
Check LampLit?
hey guys, i was wondering how to call a check on weather 2 lamps have been lit or not.
E.g. Player lights 2 lamps, calls an easter egg sound.
I have a feeling it has something to do with GetPropIsInteractedWith(string& asName);, but i wouldn't know how to call that...
In other words, what would a callback be when a player uses a tinderbox?
Can i get a hand?
________________________
Edit, Nevermind, just figured it out|| SetEntityCallbackFunc(string& asName, string& asCallback);
void MyFunc(string &in asEntity, string &in OnIgnite)
(This post was last modified: 01-21-2012, 12:01 PM by Tripication.)
|
|
01-21-2012, 11:44 AM |
|
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
|
RE: Check LampLit?
You could do variable and every time you lit a candle it adds one to it
and checks when its 2 ---> Easter egg sound
|
|
01-21-2012, 12:03 PM |
|
Tripication
Member
Posts: 172
Threads: 19
Joined: Dec 2011
Reputation:
6
|
RE: Check LampLit?
Thats exactly what i did.
void OnStart
{
SetEntityCallbackFunc("EE1", "AddAndCheck1");
SetEntityCallbackFunc("EE2", "AddAndCheck2");
}
void AddAndCheck1(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}
void AddAndCheck2(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}
void EasterEgg()
{
if (GetLocalVarInt("EE") == 2)
{
SetEntityActive("Otis", true);
}
}
|
|
01-21-2012, 12:05 PM |
|