Jump to content

ENTFLAG.CARRYINGGOAL


Recommended Posts

Good Evening!

 

I would like to solve in a script that when an Axis player or a bot picks up the objective, compare every bot and players position (who hold an objective) distance to a Vector3 point position.

After that, it is also necessary, when he throws the object, which Axis bot is closest to the objective.

 

 

        

foreach(bot in BotTable)
        {
            if( GetEntTeam(ent) == TEAM.AXIS  && GetEntFlags( ent, ENTFLAG.CARRYINGGOAL ) )
            {

                if(DistanceBetween(b.GetGameEntity(player), Vector3(-1824, 2115, 4)) <= 100 )
                {
                    Util.MapDebugPrint("<= 100");
                }
                else
                {
                    Util.MapDebugPrint("> 100");
                }

            }
        }

In this exampleI got following error message: 

Quote

expecting param 0 gameentity or int param. got null

Quote

 

 

ENTFLAG.CARRYINGGOAL works only in triggerregions?

 

Link to comment
Share on other sites

Scripts that return some data or value are always very useful. I'm sorry that the content of the old forum was lost because it was a treasure trove, but in my case it is necessary that when a player drop the object, a query from the bot table is run for the current position and name of the bots. The name would be necessary for the test. After that, a comparison between the position of the bots and the original position of the pick-up object (pick-up point) Then the bots with the two smallest values execute the bot.ExecCommand("kill"); command.
Link to comment
Share on other sites

  • Moderators

First of all bots should wait for respawn. You can use function bot.GetReinforceTime() and sleep until 1 second before respawn. Then you should check if the book is at its original location and nobody is carrying it. Then you kill bots that have bot.GetMapGoalName()=="FLAG_book".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...