Raised This Month: $ Target: $400
 0% 

Cells.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mrki_Drakula
Senior Member
Join Date: Jun 2011
Location: Serbia
Old 08-25-2012 , 18:21   Cells.
Reply With Quote #1

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.
Mrki_Drakula is offline
Send a message via MSN to Mrki_Drakula Send a message via Skype™ to Mrki_Drakula
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 08-26-2012 , 00:23   Re: Cells.
Reply With Quote #2

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.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Mrki_Drakula
Senior Member
Join Date: Jun 2011
Location: Serbia
Old 08-26-2012 , 05:43   Re: Cells.
Reply With Quote #3

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
Mrki_Drakula is offline
Send a message via MSN to Mrki_Drakula Send a message via Skype™ to Mrki_Drakula
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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