drawBox
DRAW_BOX0xD3A9971CADAC7252The GTA V native DRAW_BOX of the GRAPHICS namespace, as LS:MP client scripts call it: the global function drawBox, in JavaScript and in Lua.
drawBox(
x1: number,
y1: number,
z1: number,
x2: number,
y2: number,
z2: number,
red: number,
green: number,
blue: number,
alpha: number
): voiddrawBox(
x1: number,
y1: number,
z1: number,
x2: number,
y2: number,
z2: number,
red: integer,
green: integer,
blue: integer,
alpha: integer
)Usage
drawBox(x1, y1, z1, x2, y2, z2, red, green, blue, alpha);drawBox(x1, y1, z1, x2, y2, z2, red, green, blue, alpha)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
drawBox(pos1, pos2, red, green, blue, alpha);drawBox(pos1, pos2, red, green, blue, alpha)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
x1 | float | number | number |
y1 | float | number | number |
z1 | float | number | number |
x2 | float | number | number |
y2 | float | number | number |
z2 | float | number | number |
red | int | number | integer |
green | int | number | integer |
blue | int | number | integer |
alpha | int | number | integer |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
x,y,z = start pos
x2,y2,z2 = end pos
Draw's a 3D Box between the two x,y,z coords.
Keep in mind that the edges of the box do only align to the worlds base-vectors. Therefore something like rotation cannot be applied. That means this function is pretty much useless, unless you want a static unicolor box somewhere.
I recommend using a predefined function to call this.
[VB.NET]
Public Sub DrawBox(a As Vector3, b As Vector3, col As Color)
[Function].Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A)
End Sub[C#]
public void DrawBox(Vector3 a, Vector3 b, Color col)
{
Function.Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A);
}Reference
- Namespace
- Graphics GRAPHICS
- In the game
void DRAW_BOX(float x1, float y1, float z1, float x2, float y2, float z2, int red, int green, int blue, int alpha)- Hash
0xD3A9971CADAC7252