Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I - disable all hints/turn on lights with a switch?
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: How do I - disable all hints/turn on lights with a switch?

All the functions can be found here.
But here's the script:

void OnStart()
{
    SetLocalVarInt("lamp_1", 1);
    SetEntityPlayerInteractCallback("nameofyourswitch", "lamp_onoff", false);
}

void lamp_onoff(string &in asEntity)
{
    if(GetLocalVarInt("lamp_1")==0)
    {
    SetLightVisible("nameofyourlight", true);
    AddLocalVarInt("lamp_1", 1);
    }
    else if(GetLocalVarInt("lamp_1")==1)
    {
    SetLightVisible("nameofyourlight", false);
    AddLocalVarInt("lamp_1", -1);
    }
}

There, that should do it
(This post was last modified: 08-05-2013, 07:54 AM by OriginalUsername.)
08-05-2013, 07:49 AM
Find


Messages In This Thread
RE: How do I - disable all hints/turn on lights with a switch? - by OriginalUsername - 08-05-2013, 07:49 AM



Users browsing this thread: 2 Guest(s)