(07-05-2011, 01:49 AM)Tanshaydar Wrote: State Change is what you are looking for.
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);
A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in EntityName, int alState)
alState: -1 = off, 0 = between, 1 = on
What do insert where??
Can anybody see why its not working???
////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityConnectionStateChangeCallback(LoL, EndaMer);
AddEntityCollideCallback("Player", "HaveLantern", "MayIGo", false, 1);
AddEntityCollideCallback("Player", "HaveLantern_1", "MayINot", false, 1);
}
void Func("button_simple_1", 1)
{
PlaySoundAtEntity("", "13_steam.snt", "Player", 0, true);
}
void MayINot(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==false)
{
SetMessage("NotWorking", "CisternDarkness", 0);
}
}
void MayIGo(string &in asParent, string &in asChild, int alState)
{
if(HasItem("ZuLantern")==true)
{
SetEntityActive("BlockBuster", false);
SetEntityActive("BlockBuster_1", false);
SetEntityActive("BlockBuster_2", false);
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}