AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true , 1);
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
Thanks on beforehand
Assuming this is all your code?
If so, then just put the AddEntityCollideCallback in an OnStart() subroutine.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true, 1);
}
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
(04-17-2014, 03:39 PM)MacKetchup Wrote: [ -> ]AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true , 1);
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
Thanks on beforehand
Let me fix that for you:
AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true, 1);
void Light(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_floor_1", true, true);
SetLampLit("torch_floor_2", true, true);
SetLampLit("torch_floor_3", true, true);
SetLampLit("torch_floor_4", true, true);
}
You are using wrong function and wrong commands to make the lamps lit.
This should work.
Just use "torch_floor_*" for the first SetLampLit argument. Naming them all individually is more tedious (if they all had the same name).
(04-17-2014, 04:22 PM)SomethingRidiculous Wrote: [ -> ]Just use "torch_floor_*" for the first SetLampLit argument. Naming them all individually is more tedious (if they all had the same name).
Thanks. This is useful if i use a larger amount of torches as for this case