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
Script Help Problem with script
amusei Offline
Junior Member

Posts: 23
Threads: 8
Joined: Aug 2012
Reputation: 2
#1
Problem with script

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.

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);
    }
09-04-2012, 06:16 AM
Find


Messages In This Thread
Problem with script - by amusei - 09-04-2012, 06:16 AM
RE: Problem with script - by FlawlessHappiness - 09-04-2012, 07:08 AM
RE: Problem with script - by ferryadams10 - 09-04-2012, 01:13 PM
RE: Problem with script - by Apjjm - 09-04-2012, 05:00 PM
RE: Problem with script - by GoranGaming - 09-04-2012, 08:07 PM



Users browsing this thread: 4 Guest(s)