08-02-2015, 02:22 PM
Player gets lantern on map A. In map B an entity is supposed to be active when player has the item.
My first try (I like this better cause it seems simpler)
Map B
My second try
Map A
Map B
But nothing changes when player has item.
My first try (I like this better cause it seems simpler)
Map B
PHP Code:
void OnStart()
{
AddTimer("LanternChecker", 0.1f, "haslantern");
}
void haslantern(string &in asTimer)
{
if(HasItem("Lantern"))
{
SetEntityActive("Entity_Name", true);
}
}
My second try
Map A
PHP Code:
void OnStart()
{
SetGlobalVarInt("LanternVar", 0);
SetEntityPlayerInteractCallback("Lantern", "Setvar", true);
}
void Setvar(string &in asEntity)
{
AddGlobalVarInt("LanternVar", 1);
}
Map B
PHP Code:
void OnEnter()
{
if(GetGlobalVarInt("LanternVar")==1)
{ SetEntityActive("Entity_Name", true);
}
}