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

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

Hello! I come here for a code.
sorry if this is not well understood English ... that I speak Spanish and am using the translator
I hope you understand me

I want prener a light with a button or area (same for me) and off (like a switch). This time it was with a book by touching an area comprising a light.

But I have a problem. Achievement on and off the light but after aver done this. no light turns back on, it's like only use the script only once I leave here.


void OnStart()
{
SetLocalVarInt("Var0", 0);
SetLocalVarInt("Var1", 0);
AddEntityCollideCallback("B0", "A0A", "Prender0", true, 1);
AddEntityCollideCallback("B1", "A1A", "Prender1", true, 1);
AddEntityCollideCallback("B0", "D0", "Desactivo0", true, 1);
AddEntityCollideCallback("B1", "D1", "Desactivo1", true, 1);

}

void Desactivo0(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("Var0", 0);


}
void Desactivo1(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("Var1", 0);



}

void Prender1(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var1", 1);
if(GetLocalVarInt("Var1") == 1)
{

SetLampLit("l1", false, false);
SetLampLit("l2", false, false);
SetLampLit("l3", false, false);
SetLampLit("l4", false, false);
SetLampLit("l5", false, false);
SetLampLit("l6", false, false);
SetLampLit("l7", false, false);
SetLampLit("l8", false, false);
SetLampLit("l9", false, false);
SetLampLit("l10", false, false);
SetLampLit("l11", false, false);
SetLampLit("l12", false, false);
SetLampLit("l13", false, false);
SetLampLit("l14", false, false);
SetLampLit("l15", false, false);
SetLampLit("l16", false, false);
SetLampLit("l17", false, false);
SetLampLit("l18", false, false);
SetLampLit("l19", false, false);
SetLampLit("l20", false, false);

SetLampLit("l16", true, true);
SetLampLit("l12", true, true);
SetLampLit("l8", true, true);
SetLampLit("l4", true, true);
SetLampLit("l20", true, true);
}

}
void Prender0(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var0", 1);
if(GetLocalVarInt("Var0") == 1)
{
SetLampLit("l1", false, false);
SetLampLit("l2", false, false);
SetLampLit("l3", false, false);
SetLampLit("l4", false, false);
SetLampLit("l5", false, false);
SetLampLit("l6", false, false);
SetLampLit("l7", false, false);
SetLampLit("l8", false, false);
SetLampLit("l9", false, false);
SetLampLit("l10", false, false);
SetLampLit("l11", false, false);
SetLampLit("l12", false, false);
SetLampLit("l13", false, false);
SetLampLit("l14", false, false);
SetLampLit("l15", false, false);
SetLampLit("l16", false, false);
SetLampLit("l17", false, false);
SetLampLit("l18", false, false);
SetLampLit("l19", false, false);
SetLampLit("l20", false, false);

SetLampLit("l1", true, true);
SetLampLit("l2", true, true);
SetLampLit("l3", true, true);
SetLampLit("l4", true, true);
SetLampLit("l5", true, true);
SetLampLit("l9", true, true);
SetLampLit("l13", true, true);
SetLampLit("l17", true, true);
SetLampLit("l20", true, true);
SetLampLit("l16", true, true);
SetLampLit("l12", true, true);
SetLampLit("l8", true, true);
SetLampLit("l18", true, true);
SetLampLit("l19", true, true);

}

}
hopefully can give me the solution Thanks.
(This post was last modified: 07-16-2012, 11:33 PM by gabiaef.)
07-15-2012, 11:04 PM
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)