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
What does "+=" do?
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#1
What does "+=" do?

i saw it in the code lock script
( http://www.frictionalgames.com/forum/sho...e=threaded ) from NaxEla

i couldnt find it anywhere else.

void PressedButton(string &in entity)
{
    int buttonsPressed;
    
    AddLocalVarInt("ButtonsPressed", 1);
    
    playersGuessedCode += GetButtonPressed(entity);    /// HERE
    buttonsPressed = GetLocalVarInt("ButtonsPressed");
    
    AddDebugMessage("Buttons Pressed: "+buttonsPressed+"  Guessed Code: "+playersGuessedCode, false);
    
    if(playersGuessedCode == correctCode) {
        SetSwingDoorLocked("door", false, false);
        for(int i=0; i<=9; i++) {
            SetEntityActive("Button_"+i, true);
        }
        ResetCode();
        AddDebugMessage("Correct code!", false);
        
        return;
    }
    
    if(buttonsPressed == 4) {
        ResetCode();
        AddDebugMessage("Wrong code!", false);
    }
}

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 02-25-2013, 04:58 PM by tonitoni1998.)
02-25-2013, 04:57 PM
Find


Messages In This Thread
What does "+=" do? - by tonitoni1998 - 02-25-2013, 04:57 PM
RE: What does "+=" do? - by darksky - 02-25-2013, 05:01 PM
RE: What does "+=" do? - by tonitoni1998 - 02-25-2013, 05:03 PM
RE: What does "+=" do? - by darksky - 02-25-2013, 05:10 PM
RE: What does "+=" do? - by No Author - 02-26-2013, 12:16 AM



Users browsing this thread: 1 Guest(s)