The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LocalVar and if-statements
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
LocalVar and if-statements

As you can read in the script. If all the machines are running the player can use the item on the area but if only 4 or less are you can't. I thought this script would work but it will not.

void OnStart()
{
for(int i=1;i<=6;i++){
AddUseItemCallback("UsingOrbPieces", "orb_piece_"+i+"", "AreaUseOrbPiece","UseOrbPiecesOnArea", false);
}
}


///Using the orb pieces///
void UseOrbPiecesOnArea(string &in asItem, string &in asEntity)
{
if(GetLocalVarInt("AllMachineryUpAndRunning") == 5)
{
RemoveItem(asItem);
AddLocalVarInt("OrbPutTogether", 1);
OrbAllDoneLocal();

}
else if(GetLocalVarInt("AllMachineryUpAndRunning") == 0 && GetLocalVarInt("AllMachineryUpAndRunning") == 1 &&
GetLocalVarInt("AllMachineryUpAndRunning") == 2 && GetLocalVarInt("AllMachineryUpAndRunning") == 3 && GetLocalVarInt("AllMachineryUpAndRunning") == 4)
{
SetMessage("Descriptions", "Hint_15", 3.0f);
PlaySoundAtEntity("", "27_thump.snt", "Player", 0.1f, true);
}
}

"What you think is irrelevant" - A character of our time

A Christmas Hunt
11-24-2012, 11:53 PM
Find


Messages In This Thread
LocalVar and if-statements - by i3670 - 11-24-2012, 11:53 PM
RE: LocalVar and if-statements - by The chaser - 11-25-2012, 12:21 AM
RE: LocalVar and if-statements - by i3670 - 11-25-2012, 12:23 AM
RE: LocalVar and if-statements - by The chaser - 11-25-2012, 12:29 AM
RE: LocalVar and if-statements - by i3670 - 11-25-2012, 12:32 AM
RE: LocalVar and if-statements - by Your Computer - 11-25-2012, 12:40 AM
RE: LocalVar and if-statements - by i3670 - 11-25-2012, 12:47 AM
RE: LocalVar and if-statements - by Your Computer - 11-25-2012, 12:59 AM
RE: LocalVar and if-statements - by i3670 - 11-25-2012, 01:03 AM



Users browsing this thread: 1 Guest(s)