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
Desk gas lamp help?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Desk gas lamp help?

I think you meant to do something like this:

PHP Code: (Select All)
void MyFunc(string &in asEntity)
{
    if(
GetLocalVarInt("OnState") == 1)
    {
        
SetLampLit("LampName"falsetrue);
        
SetLocalVarInt("OnState"0);
    }
    else {
        
SetLampLit("LampName"truetrue);
        
SetLocalVarInt("OnState"1);
    }


I also recommend using something like asEntity+"Light" for the light name and var name, so you can reuse the same code for all lamps. Perhaps even add the "tick" sound effect in there.

(This post was last modified: 06-09-2014, 03:31 PM by Mudbill.)
06-09-2014, 03:24 PM
Find


Messages In This Thread
Desk gas lamp help? - by Artsy - 06-09-2014, 10:38 AM
RE: Desk gas lamp help? - by PutraenusAlivius - 06-09-2014, 11:17 AM
RE: Desk gas lamp help? - by Straxedix - 06-09-2014, 11:48 AM
RE: Desk gas lamp help? - by Mudbill - 06-09-2014, 03:24 PM
RE: Desk gas lamp help? - by DnALANGE - 06-09-2014, 06:52 PM
RE: Desk gas lamp help? - by Straxedix - 06-09-2014, 09:28 PM
RE: Desk gas lamp help? - by Artsy - 06-09-2014, 10:29 PM
RE: Desk gas lamp help? - by DnALANGE - 06-10-2014, 11:47 AM
RE: Desk gas lamp help? - by Artsy - 06-10-2014, 02:15 PM
RE: Desk gas lamp help? - by Straxedix - 06-11-2014, 06:52 AM
RE: Desk gas lamp help? - by koriroxx - 07-01-2014, 01:46 PM
RE: Desk gas lamp help? - by Artsy - 07-01-2014, 01:55 PM
RE: Desk gas lamp help? - by DnALANGE - 06-11-2014, 11:12 AM
RE: Desk gas lamp help? - by Straxedix - 06-11-2014, 08:19 PM
RE: Desk gas lamp help? - by DnALANGE - 06-11-2014, 08:31 PM
RE: Desk gas lamp help? - by Straxedix - 06-11-2014, 08:39 PM
RE: Desk gas lamp help? - by Artsy - 06-11-2014, 09:49 PM
RE: Desk gas lamp help? - by DnALANGE - 06-11-2014, 11:27 PM
RE: Desk gas lamp help? - by Artsy - 06-11-2014, 11:39 PM
RE: Desk gas lamp help? - by DnALANGE - 06-11-2014, 11:41 PM
RE: Desk gas lamp help? - by Straxedix - 06-12-2014, 08:28 PM
RE: Desk gas lamp help? - by Artsy - 06-12-2014, 09:58 PM
RE: Desk gas lamp help? - by PutraenusAlivius - 06-13-2014, 09:25 AM
RE: Desk gas lamp help? - by Artsy - 06-13-2014, 11:56 AM
RE: Desk gas lamp help? - by Mudbill - 07-01-2014, 05:41 PM
RE: Desk gas lamp help? - by KiraImmortal - 07-02-2014, 11:49 AM
RE: Desk gas lamp help? - by DnALANGE - 07-02-2014, 04:31 PM



Users browsing this thread: 4 Guest(s)