You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: elements/Matrix/Matrix.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ name: 'matrix'
2
2
description: |
3
3
Matrices are one of the most powerful features of MTA [OOP](/OOP_Introduction). We did have a presence of Matrices before with [getElementMatrix](/getElementMatrix), but we were given an ugly disgusting table to play with. Now, with the new Matrix class, we can make and magically manipulate Matrices.
4
4
5
-
oop_methods:
5
+
oop_only_methods:
6
6
- name: create
7
7
description: |
8
8
Default constructor for the Matrix class. Returns a Matrix object.
Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only.
7
+
- type: 'info'
8
+
content: |
9
+
Due to how GTA works, creating a lot of vehicles in the same place will cause lag. The more geometries and unique textures has model the bigger the lag is. Even a lot of default vehicles will cause lag if in the same place.
10
+
- type: 'important'
11
+
content: |
12
+
It's worth nothing that the position of the vehicle is the center point of the vehicle, not its base. As such, you need to ensure that the z value (vertical axis) is some height above the ground. You can find the exact height using the client side function [getElementDistanceFromCentreOfMassToBaseOfModel](/getElementDistanceFromCentreOfMassToBaseOfModel), or you can estimate it yourself and just spawn the vehicle so it drops to the ground.
13
+
oop:
14
+
entity: vehicle
15
+
constructorclass: Vehicle
16
+
description: |
17
+
This function creates a [vehicle](/vehicle) at the specified location.
18
+
parameters:
19
+
- name: 'model'
20
+
type: 'int'
21
+
description: "The [vehicle ID](/Vehicle_IDs) of the vehicle being created."
22
+
- name: 'x'
23
+
type: 'float'
24
+
description: "A floating point number representing the X coordinate on the map."
25
+
- name: 'y'
26
+
type: 'float'
27
+
description: "A floating point number representing the Y coordinate on the map."
28
+
- name: 'z'
29
+
type: 'float'
30
+
description: "A floating point number representing the Z coordinate on the map."
31
+
- name: 'rx'
32
+
type: 'float'
33
+
default: '0'
34
+
description: "A floating point number representing the rotation about the X axis in degrees."
35
+
- name: 'ry'
36
+
type: 'float'
37
+
default: '0'
38
+
description: "A floating point number representing the rotation about the Y axis in degrees."
39
+
- name: 'rz'
40
+
type: 'float'
41
+
default: '0'
42
+
description: "A floating point number representing the rotation about the Z axis in degrees."
43
+
- name: 'numberplate'
44
+
type: 'string'
45
+
default: 'random'
46
+
description: "A string representing the vehicle's number plate. If not specified, the vehicle will have a random number plate."
47
+
- name: 'bDirection'
48
+
type: 'boolean'
49
+
default: 'false'
50
+
description: "*(Serverside only)*: Placeholder boolean which provides backward compatibility with some scripts. **It never had any effect, but it is read by the code.** It is recommended to ignore this argument, passing *false* or the next `variant1` argument in its place."
51
+
- name: 'variant1'
52
+
type: 'int'
53
+
default: 'random'
54
+
description: "An integer for the first vehicle variant. See [vehicle variants](/Vehicle_variants)."
55
+
- name: 'variant2'
56
+
type: 'int'
57
+
default: 'random'
58
+
description: "An integer for the second vehicle variant. See [vehicle variants](/Vehicle_variants)."
59
+
- name: 'synced'
60
+
type: 'boolean'
61
+
default: 'true'
62
+
description: "*(Serverside only)*: A boolean value representing whether or not the vehicle will be synced. Disabling the sync might be useful for frozen or static vehicles to increase the server performance."
63
+
returns:
64
+
description: |
65
+
Returns the [vehicle](/vehicle) element that was created. Returns *false* if the arguments are incorrect, or if the vehicle limit of `65535` is exceeded.
This function changes the state of the sirens on the specified [vehicle](/vehicle).
10
+
parameters:
11
+
- name: 'theVehicle'
12
+
type: 'vehicle'
13
+
description: 'The [vehicle](/vehicle) that will have the sirens set.'
14
+
- name: 'sirensOn'
15
+
type: 'bool'
16
+
description: 'The state to set the sirens to (*true* for on, *false* for off).'
17
+
returns:
18
+
description: |
19
+
Returns *true* if the sirens are set for the specified vehicle, *false* if the sirens can't be set for the specified vehicle, if the vehicle doesn't have sirens or if invalid arguments are specified.
20
+
values:
21
+
- type: 'bool'
22
+
name: 'result'
23
+
24
+
server:
25
+
<<: *shared
26
+
examples:
27
+
- path: 'examples/setVehicleSirensOn-1.lua'
28
+
description: |
29
+
This example toggles siren state when a player enters a vehicle as a driver.
<code>{oop_constructor.oop.constructorclass}(...)</code> is the constructor method for the <code>{element_name}</code> class (<ahref={oop_constructor.link}>{oop_constructor.name}</a>).
32
+
</p>
33
+
</section>
34
+
)}
35
+
36
+
{Object.keys(oop_variables_by_var).length>0&& (
37
+
<sectionclass="oop-variables-section">
38
+
<h4><ahref="/OOP_Introduction">OOP</a> Variables and Methods</h4>
0 commit comments