09-04-2012, 06:16 AM
Hi, forum.
Is there any way to check if an entity is active? I have tried using GetEntityExists but it doesn't work (I think it checks if an entity exists in any state - active or not). Or maybe I made a mistake with my script? Here it is.
Is there any way to check if an entity is active? I have tried using GetEntityExists but it doesn't work (I think it checks if an entity exists in any state - active or not). Or maybe I made a mistake with my script? Here it is.
Code:
void OnStart()
{
SetEntityPlayerInteractCallback("bedroom_key", "ActivateMonster", true);
}
void ActivateMonster(string &in asEntity)
{
if(GetEntityExists("grunt_1") == false && GetEntityExists("brute_1") == false
&& GetEntityExists("brute_2") == true)
{
SetEntityActive("grunt_1", true);
}
else if(GetEntityExists("grunt_1") == false &&
GetEntityExists("brute_1") == true &&
GetEntityExists("brute_2") == true)
{
SetEntityActive("brute_1", false);
SetEntityActive("grunt_1", true);
}