AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Cells. (https://forums.alliedmods.net/showthread.php?t=194151)

Mrki_Drakula 08-25-2012 18:21

Cells.
 
Hello there.

How i can search for the closest door to the player, and then open it? Thanks :)
Be quick please. Just point me somewhere, i have no knowledge about origins and entities.

Thanks again.

Emp` 08-26-2012 00:23

Re: Cells.
 
Here's some pseudo code:
Code:

Find and loop through entities within sphere of largest distance
{
    if entity is a door
    {
        if entity distance is < largest entity distance
        {
            largest entity distance = entity distance
            closest entity = entity
        }
    }
}

Look at other plugins to understand entities better. If you know how a plugin behaves, you should be able to deduce how the code executes.

Mrki_Drakula 08-26-2012 05:43

Re: Cells.
 
Thanks Emp, I'll check that later. I've already solved this problem with Fwd_DoorAttack function, but i left this thread open to get some useful responds like your one. Thank you :)


All times are GMT -4. The time now is 05:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.