Okay, I have declared some stuff up top.
AddEntityCollideCallback("Player", "CanBuild", "PlaceLadder", false, 0);
AddCombineCallback("", "Half_Ladder_1", "Half_Ladder_2", "BuildLadder", true);
SetLocalVarInt("CanBuildLadder", 0);
Then I have worked the functions down the bottom. I have used Local Vars because I cannot check.. well, I don't think I can do what I wanted in a simpler method. Basically I want to be able to combine two ladder parts together (Justine items) to make one larger ladder item, but that ladder can only be put together within a certain script area, because it would technically be too big to hold in the inventory
In order to check if the player is in the Script Area, I change the Local Var to 1, and if the player is not in the area, it becomes 0.
void PlaceLadder(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
SetLocalVarInt("CanBuildLadder", 1);
}
else
{
SetLocalVarInt("CanBuildLadder", 0);
}
}
void BuildLadder(string &in asItemA, string &in asItemB)
{
if (GetLocalVarInt("CanBuildLadder") == 1)
{
SetEntityActive("LadderArea_1", true);
SetEntityActive("ladder_static_1", true);
}
}
The errors returned are:
(210, 2) Expected "," or ";"
(214, 3) Unexpected Token else
(220, 2) Expected "," or ";"
Line 210 is if(alState == 1)
If needed, I can and will post the whole code