AlliedModders

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

tepegoz 07-14-2022 06:19

detect area
 
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?
https://i.hizliresim.com/oqty3d1.jpg

Natsheh 07-14-2022 06:31

Re: detect area
 
Explain what do you want to do, it will be much easier to understand.

lexzor 07-14-2022 07:44

Re: detect area
 
you can preset that 4 corners on the map and detect if player is between them using get_user_origin

Natsheh 07-14-2022 08:48

Re: detect area
 
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.

tepegoz 07-14-2022 16:51

Re: detect area
 
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.

jimaway 07-14-2022 20:49

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

tepegoz 10-14-2022 08:01

Re: detect area
 
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.


All times are GMT -4. The time now is 15:33.

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