Jump to content

Something like onRadarAreaElementEnter


Gordon_G

Recommended Posts

Hello, I know the event "onRadarAreaElementEnter" do not exist but, I would like to have something like this.

In my script I've some radar area but I cant use any colshape (because I've some negatives lenghts) or zone because my areas are not the same than the zone.

 

Could someone find a way to have an event like "onRadarAreaElementEnter" ? Thanks a lot !

Link to comment

I took my motivation and I did something like this to make easily colRectangle :

col_rect = {}

function colrect(source)
x,y,z = getElementPosition(source)

if col_rect.un == nil then
table_ = {x,y}
col_rect.un = table_
outputChatBox("1")
elseif col_rect.deux == nil then
table_ = {x,y}
outputChatBox("2")
col_rect.deux = table_
elseif col_rect.trois == nil then
table_ = {x,y}
outputChatBox("3")
col_rect.trois = table_
local a = getDistanceBetweenPoints2D(col_rect.un[1],col_rect.un[2],col_rect.trois[1],col_rect.trois[2])
local b = getDistanceBetweenPoints2D(col_rect.un[1],col_rect.un[2],col_rect.deux[1],col_rect.deux[2])
local x,y = col_rect.un[1],col_rect.un[2]
local w = a
local h = math.sqrt(a^2-b^2)

rect__ = createColRectangle(x,y,w,h)
print(x..","..y..","..w..","..h)
col_rect = {}
end 
end
addCommandHandler("rect",colrect)

 

Thanks to everyone.

Edited by Gordon_G
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...