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
On and off light.
gabiaef Offline
Junior Member

Posts: 4
Threads: 1
Joined: Jul 2012
Reputation: 0
#8
RE: On and off light.

(07-16-2012, 01:15 AM)Ongka Wrote: Create a lever, doesn't matter which one.
Set the configuration of the lever like shown in the image.
[Image: Qw2NX.jpg]


Put this into your script:
void LightSwitch(string &in asEntity, int alState)
{
    if(alState == 1){
    
        for(int i=1;i<=20;i++)  //Change the 20 to any number you want, e.g. 10, this will cause only the first 10 to be lit/unlit
        {
        SetLampLit("l"+i, false, true);
        }

    }
    else if(alState == -1){
        for(int i=1;i<=20;i++)  //Change the 20 to any number you want, e.g. 10, this will cause only the first 10 to be lit/unlit
        {
        SetLampLit("l"+i, true, true);
        }
    }
}

By moving the lever up the lamps get lit and by moving down they get unlit.
Works infinite times.

Have fun! Wink
Thank you very much! Did not know recently started with this.
07-16-2012, 01:45 AM
Find


Messages In This Thread
On and off light. - by gabiaef - 07-15-2012, 11:04 PM
RE: On and off light. - by Your Computer - 07-15-2012, 11:22 PM
RE: On and off light. - by Ongka - 07-15-2012, 11:23 PM
RE: On and off light. - by gabiaef - 07-15-2012, 11:30 PM
RE: On and off light. - by Ongka - 07-15-2012, 11:46 PM
RE: On and off light. - by gabiaef - 07-15-2012, 11:59 PM
RE: On and off light. - by Ongka - 07-16-2012, 01:15 AM
RE: On and off light. - by gabiaef - 07-16-2012, 01:45 AM
RE: On and off light. - by Ongka - 07-16-2012, 01:51 AM



Users browsing this thread: 1 Guest(s)