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
Script Help Lightswitch with locals [SOLVED]
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
Lightswitch with locals [SOLVED]

I can switch the light on but not off.

Spoiler below!

void OnStart()
{
SetLocalVarInt("loc_light_living", 0);
}

void switch_living(string &in asEntity)
{
if(GetLocalVarInt("loc_light_living") == 0)
{
SetLampLit("gas_lamp_ceiling_1", true, true);
SetLampLit("gas_lamp_ceiling_2", true, true);

FadeLightTo("fade", 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f);

AddTimer("LocalValTimer", 0.1f,"living_val_on");
}

if(GetLocalVarInt("loc_light_living") == 1)
{
SetLampLit("gas_lamp_ceiling_1", false, true);
SetLampLit("gas_lamp_ceiling_2", false, true);

AddTimer("LocalValTimer", 0.1f,"living_val_off");
}
}

void LocalValTimer(string &in asTimer)
{
if(asTimer == "living_val_on")
{
SetLocalVarInt("loc_light_living", 1);
}
if(asTimer == "living_val_off")
{
SetLocalVarInt("loc_light_living", 0);
}
}


FIXED IT.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 01-23-2014, 10:48 PM by i3670.)
01-23-2014, 09:54 PM
Find


Messages In This Thread
Lightswitch with locals [SOLVED] - by i3670 - 01-23-2014, 09:54 PM
RE: Lightswitch with locals - by daortir - 01-23-2014, 10:00 PM
RE: Lightswitch with locals - by i3670 - 01-23-2014, 10:03 PM
RE: Lightswitch with locals - by daortir - 01-23-2014, 10:10 PM
RE: Lightswitch with locals - by i3670 - 01-23-2014, 10:12 PM
RE: Lightswitch with locals - by daortir - 01-23-2014, 10:25 PM



Users browsing this thread: 1 Guest(s)