Raised This Month: $ Target: $400
 0% 

detect area


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepegoz
Senior Member
Join Date: Apr 2019
Old 07-14-2022 , 06:19   detect area
Reply With Quote #1

I want to detect left area as seen in the picture. How do I find the left of the midpoint and how to detect a player in left area?
tepegoz is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-14-2022 , 06:31   Re: detect area
Reply With Quote #2

Explain what do you want to do, it will be much easier to understand.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-14-2022 , 07:44   Re: detect area
Reply With Quote #3

you can preset that 4 corners on the map and detect if player is between them using get_user_origin
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-14-2022 , 08:48   Re: detect area
Reply With Quote #4

Direction = (TestOrigin - Player origin)
Normalize Direction
Direction to angle

(Angle Y - Player Angle Y ) <= 180.0

TestOrigin is on the left side of the player.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-14-2022 at 08:48.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
tepegoz
Senior Member
Join Date: Apr 2019
Old 07-14-2022 , 16:51   Re: detect area
Reply With Quote #5

I have football plugin with offside. Players catching offside own areas. I don't want this. I have soccer map that has two areas with lines. I don't know much coding. I will add yours code to offside public.
tepegoz is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 07-14-2022 , 20:49   Re: detect area
Reply With Quote #6

you will have to get coordinates for the lines manually and maybe create SOLID_TRIGGER entities to detect players crossing the line

Last edited by jimaway; 07-14-2022 at 20:49.
jimaway is offline
tepegoz
Senior Member
Join Date: Apr 2019
Old 10-14-2022 , 08:01   Re: detect area
Reply With Quote #7

This middle line origin = new Float:Origin[3] = {2087.0,215.0,-500.0}
I want to detect in which zone the players are walking. If player is terrorist, left area will protect for offside, if player is CT, right area will protect for ofside. In this way players can't catch offside.
tepegoz 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 06:52.


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