Frictional Games Forum (read-only)
Need help on a code! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Need help on a code! (/thread-11186.html)



Need help on a code! - TheDavenia - 11-05-2011

I know how to do this with scripts, but not with items.
How do I make it that if I pick up an item things get disabled and some get enabled?
Please help!


RE: Need help on a code! - flamez3 - 11-05-2011

Void OnStart()
{
SetEntityPlayerInteractCallback("nameofitem", "nameoffunction", false);
}


void nameoffunction(string &in asEntity)
{
SetEntityActive("nameofentitytodisable/enable", true); \\true means enable, false means disable
}




RE: Need help on a code! - TheDavenia - 11-05-2011

(11-05-2011, 05:27 AM)flamez3 Wrote: Void OnStart()
{
SetEntityPlayerInteractCallback("nameofitem", "nameoffunction", false);
}


void nameoffunction(string &in asEntity)
{
SetEntityActive("nameofentitytodisable/enable", true); \\true means enable, false means disable
}
Yeah, only needed to know the VoidOnstart though
(11-05-2011, 05:28 AM)TheDavenia Wrote:
(11-05-2011, 05:27 AM)flamez3 Wrote: Void OnStart()
{
SetEntityPlayerInteractCallback("nameofitem", "nameoffunction", false);
}


void nameoffunction(string &in asEntity)
{
SetEntityActive("nameofentitytodisable/enable", true); \\true means enable, false means disable
}
Yeah, only needed to know the VoidOnstart though
Worked thanks Smile