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
If player has lantern
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#1
If player has lantern

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
PHP Code: (Select All)
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: (Select All)
void OnStart()
{
SetGlobalVarInt("LanternVar", 0);
SetEntityPlayerInteractCallback("Lantern", "Setvar", true);
}

void Setvar(string &in asEntity)
{
    
AddGlobalVarInt("LanternVar", 1);
} 

Map B
PHP Code: (Select All)
void OnEnter()
{
if(
GetGlobalVarInt("LanternVar")==1)
{ 
SetEntityActive("Entity_Name", true);
}
} 
But nothing changes when player has item.
08-02-2015, 02:22 PM
Find


Messages In This Thread
If player has lantern - by User01 - 08-02-2015, 02:22 PM
RE: If player has lantern - by Mudbill - 08-02-2015, 03:32 PM
RE: If player has lantern - by User01 - 08-02-2015, 04:03 PM



Users browsing this thread: 1 Guest(s)