GoreGrinder99
Member
Posts: 166
Threads: 47
Joined: Feb 2013
Reputation:
1
|
RE: How do I - disable all hints/turn on lights with a switch?
(08-05-2013, 07:49 AM)Smoke Wrote: 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
I copied what you had pasted and replaced the names but still no action. I'm testing this with a candle for the time being before I replace the entity with a custom lamp and confuse myself even more. The candle is not lit, has it's original name "candlestick_wall_1", my lever has the interact callback in it "LightsFunction" and I don't have any lights so left it blank.
This is the script now:
void OnStart
{
SetLocalVarInt("candlestick_wall_1", 1);
SetEntityPlayerInteractCallback("lever_nice01_1", "LightsFunction", false);
}
void LightsFunction(string &in asEntity)
{
if(GetLocalVarInt("candlestick_wall_1")==0)
{
SetLightVisible("", true);
AddLocalVarInt("candlestick_wall_1", 1);
}
else if(GetLocalVarInt("candlestick_wall_1")==1)
{
SetLightVisible("", false);
AddLocalVarInt("candlestick_wall_1", -1);
}
}
-Grind to the Gore-
(This post was last modified: 08-05-2013, 08:30 AM by GoreGrinder99.)
|
|
08-05-2013, 08:10 AM |
|