Raised This Month: $32 Target: $400
 8% 

Check if player is entering a area/zone


Post New Thread Reply   
 
Thread Tools Display Modes
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 08-06-2013 , 09:41   Re: Check if player is entering a area/zone
Reply With Quote #11

This topic comes up once every week for the last two month. Use the search.
Dr. Greg House is offline
NRG21
Member
Join Date: Mar 2013
Old 08-06-2013 , 11:46   Re: Check if player is entering a area/zone
Reply With Quote #12

Sorry but i can't find anything, i wouldn't ask if i had found something
NRG21 is offline
LeGone
Senior Member
Join Date: Dec 2006
Location: Germany
Old 08-06-2013 , 12:03   Re: Check if player is entering a area/zone
Reply With Quote #13

You could create a trigger. Than hook the touch function of that trigger.
Am I going too far, if I would call that the "engine-way" of doing sth like that?
LeGone is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 08-06-2013 , 18:51   Re: Check if player is entering a area/zone
Reply With Quote #14

Quote:
Originally Posted by NRG21 View Post
Thanks blaacky! I don't understand the CreateZonePoints-function (generate 8 zone points from just 2), can you give me an example how to use this with only 2 zone points?
Generally when creating a zone, you add one point that marks one corner of the zone, you go somewhere else and create the second corner of the zone. At that point you only have 2 corners of the whole zone but you need 6 more in order to draw the zone. Those 6 points are created with the CreateZonePoints function.
blaacky is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-06-2013 , 19:17   Re: Check if player is entering a area/zone
Reply With Quote #15

You can use a minimum xyz and maximum xyz coordinate, translate this to your origin, calculate mins and maxs fro the translated origin, and send that to a trigger. Hook touch thr trigger and done.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-07-2013 , 00:45   Re: Check if player is entering a area/zone
Reply With Quote #16

A while ago I did a picture for Minecraft, but it's still easy to understand which 2 coordinates you should choose.
By choosing this 2 coordinates plugin above will automatically select other angles, and will create a zone between them(in this case - a house).
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 08-07-2013 at 00:47.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
NRG21
Member
Join Date: Mar 2013
Old 08-07-2013 , 05:37   Re: Check if player is entering a area/zone
Reply With Quote #17

Quote:
Originally Posted by blaacky View Post
Generally when creating a zone, you add one point that marks one corner of the zone, you go somewhere else and create the second corner of the zone. At that point you only have 2 corners of the whole zone but you need 6 more in order to draw the zone. Those 6 points are created with the CreateZonePoints function.
Yes but i don't understand your code!
The function doesn't return something, so how can i use this to calculate the other points from 2?
NRG21 is offline
Doodil
Senior Member
Join Date: Mar 2012
Old 08-07-2013 , 06:07   Re: Check if player is entering a area/zone
Reply With Quote #18

it fills the float array you pass in the parameter with data. It doesn't return anything, but it still changes the values
Doodil is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 08-07-2013 , 06:15   Re: Check if player is entering a area/zone
Reply With Quote #19

PHP Code:
/*
* Generates all 8 points of a zone given just 2 of its points
*/
CreateZonePoints(Float:point[8][3])
{
    for(new 
i=1i<7i++)
    {
        for(new 
j=0j<3j++)
        {
            
point[i][j] = point[((>> (2-j)) & 1) * 7][j];
        }
    }

If I have a global array like Float:g_fZone[8][3] where g_fZone[0] = {0.0, 0.0, 0.0} and g_fZone[7] = {1.0, 1.0, 1.0}, the g_fZone array can be passed in the CreateZonePoints parameter and every point from 1-6 in the g_fZone array will be given their correct coordinates just by doing the function CreateZonePoints(g_fZone);

Last edited by blaacky; 08-07-2013 at 06:18.
blaacky is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-08-2013 , 02:01   Re: Check if player is entering a area/zone
Reply With Quote #20

You dont need 8 points, you need 2. Send them to a trigger, or just do basic subtraction to see if the origin of the entity you are tracking lies between them.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
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 19:27.


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