Garry's Mod Wiki


boolean Vector:WithinAABox( Vector boxStart, Vector boxEnd )


Returns whenever the given vector is in a box created by the 2 other vectors.


1 Vector boxStart
The first vector.
2 Vector boxEnd
The second vector.


1 boolean
Is the vector in the box or not


Checks if player is within a certain area on the map.

-- Position to test, we get the position of first player on the server local testPos = Entity( 1 ):GetPos() -- Positions to test, in this case we test if the player is in spawn area of gm_construct local pos1 = Vector( 1119, 895, 63 ) local pos2 = Vector( 656, -896, -144 ) -- This will return true if the player is within the tested area print( testPos:WithinAABox( pos1, pos2 ) )

Page Links

Special Pages



Render Time: 79ms

DB GetPage 39
Generate Html 10
SaveChanges (1) 11
Render Body 0
Render Sidebar 16