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);
}
}