Frictional Games Forum (read-only)

Full Version: Quick and easy question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to remove an callback like when I click on a door it sdays something and when I broke it open the door ofcourse doesn't say anything anymore.
So I want to like remove the callback of the message when I broke it so is this possible?
Yea, there are some like:

RemoveEntityCollideCallback(string& asParentName, string& asChildName);
RemoveCombineCallback(string& asName);
RemoveUseItemCallback(string& asName);

All of these are void.

Hope that helped Wink
Or you could make a LocalVarInt, so
if(GetLocalVarInt("VarName") == 0)
{
DO STUFF
}

And then later when the callback shouldn't be there anymore call SetLocalVarInt("VarName", 1)
(11-26-2012, 05:48 PM)beecake Wrote: [ -> ]Or you could make a LocalVarInt, so
if(GetLocalVarInt("VarName") == 0)
{
DO STUFF
}

And then later when the callback shouldn't be there anymore call SetLocalVarInt("VarName", 1)

I see what you are running at I think I can make some of this Big Grin
(11-26-2012, 04:58 PM)Steve Wrote: [ -> ]Is there a way to remove an callback like when I click on a door it sdays something and when I broke it open the door ofcourse doesn't say anything anymore.
So I want to like remove the callback of the message when I broke it so is this possible?
You could also do:

void OnStart()
{
SetEntityPlayerInteractCallback("DoorName", "InteractDoor", false);
}

void InteractDoor(string &in asEntity)
{
if(GetSwingDoorLocked("DoorName")== true)
{
SetMessage("Category", "Entry");//Sets a message when the door is locked
}
else
{
//When the door is open and you press it, nothing happens
}
}