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
Could I get some assistance with these if's?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#1
Could I get some assistance with these if's?

Okay, I have declared some stuff up top.
PHP Code: (Select All)
AddEntityCollideCallback("Player""CanBuild""PlaceLadder"false0);
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 Tongue

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.

PHP Code: (Select All)
void PlaceLadder(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
        {
        
SetLocalVarInt("CanBuildLadder"1);
        }
        else
        {
        
SetLocalVarInt("CanBuildLadder"0);
        }
}
        
void BuildLadder(string &in asItemAstring &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 Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 10-02-2013, 05:39 PM by Romulator.)
10-02-2013, 09:19 AM
Find


Messages In This Thread
Could I get some assistance with these if's? - by Romulator - 10-02-2013, 09:19 AM



Users browsing this thread: 1 Guest(s)