Frictional Games Forum (read-only)

Full Version: Lever Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After i made the script the ERR messages kept coming again. It said the same thing, I fixed it but it still didnt work. Here is my script:
void UnlockDoor(String &in entity, int level_state)
{
if (level_state == 1)
{
SetEntityActive("LockedDoor2", true);
}

}
What is wrong?
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever", "UnlockDoor");
}


void UnlockDoor(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}
That didnt work :/ it said :
main ERR 4,6 can't be void
main ERR 4,44 only objects have constructors
Here is my script:
void OnStart()
{
AddUseItemCallback("", "key", "LockedDoor1", "UsedKeyOnDoor", true);
void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
RemoveItem("key");
}

void UnlockDoor(string &in asEntity, int alState);
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}
void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
I know I figured that out.. but it says 14,2 unexpected token "{"

when i take out the { in 14 and 2 it gives me a whole list of MORE problems... :/
void UnlockDoor(string &in asEntity, int alState);
At the end of the function remove the ;
That worked but after it say'd
No matching signatures to SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
but Lever was &in Name or something, do i have to change the name?

sorry I mean string @&.. thats what it said
SetEntityConnectionStateChangeCallback(string @&, UnlockDoor)