02-24-2012, 10:08 PM
02-24-2012, 10:09 PM
SetLampLit. Use Indexes.
Torch_1
Torch_2
Torch_3
All will be turned on if you use
Torch_*
Torch_1
Torch_2
Torch_3
All will be turned on if you use
Torch_*
02-24-2012, 10:13 PM
Thanks man , although idk what to do next -.-
(02-24-2012, 10:09 PM)Obliviator27 Wrote: [ -> ]SetLampLit. Use Indexes.
Torch_1
Torch_2
Torch_3
All will be turned on if you use
Torch_*
02-25-2012, 02:57 PM
Someone mind telling me how to do this?
02-25-2012, 03:10 PM
To make all the lamps lit at the same time you use
for(int x=1; x <= 3; x++) SetLampLit("torch_"+x, true, true);
change the 3 to the amount of torches you have
for(int x=1; x <= 3; x++) SetLampLit("torch_"+x, true, true);
change the 3 to the amount of torches you have
02-25-2012, 04:45 PM
(02-25-2012, 03:10 PM)SilentStriker Wrote: [ -> ]To make all the lamps lit at the same time you use
for(int x=1; x <= 3; x++) SetLampLit("torch_"+x, true, true);
change the 3 to the amount of torches you have
Yea but where do i put the script area?
02-25-2012, 04:48 PM
Just put a script area where ever you want the lamps to be lit and use a AddEntityCollideCallback and then in the function you call you put the code i wrote
02-25-2012, 05:13 PM
(02-25-2012, 04:48 PM)SilentStriker Wrote: [ -> ]Just put a script area where ever you want the lamps to be lit and use a AddEntityCollideCallback and then in the function you call you put the code i wrotei tried this:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "LightOn", "Lights", true, 1);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_*", true);
}
It didn't work
02-25-2012, 05:15 PM
(02-25-2012, 05:13 PM)LulleBulle Wrote: [ -> ]because it should look like this(02-25-2012, 04:48 PM)SilentStriker Wrote: [ -> ]Just put a script area where ever you want the lamps to be lit and use a AddEntityCollideCallback and then in the function you call you put the code i wrotei tried this:
Code:void OnStart()
{
AddEntityCollideCallback("Player", "LightOn", "Lights", true, 1);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_*", true);
}
It didn't work
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "LightOn", "Lights", true, 1);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
for(int x=1; x <= 3; x++) SetLampLit("torch_static01_"+x, true, true);
}
02-25-2012, 05:21 PM
(02-25-2012, 05:15 PM)SilentStriker Wrote: [ -> ](02-25-2012, 05:13 PM)LulleBulle Wrote: [ -> ]because it should look like this(02-25-2012, 04:48 PM)SilentStriker Wrote: [ -> ]Just put a script area where ever you want the lamps to be lit and use a AddEntityCollideCallback and then in the function you call you put the code i wrotei tried this:
Code:void OnStart()
{
AddEntityCollideCallback("Player", "LightOn", "Lights", true, 1);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_*", true);
}
It didn't work
Code:void OnStart()
{
AddEntityCollideCallback("Player", "LightOn", "Lights", true, 1);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
for(int x=1; x <= 3; x++) SetLampLit("torch_static01_"+x, true, true);
}
Why can't I index the torches?
Also, it worked perfectly.