Vehicle::Vehicle: Difference between revisions
MrPancakers (talk | contribs) (Created examples & changed layout) |
m (Replaced HTML with template) |
||
| Line 5: | Line 5: | ||
== Syntax == | == Syntax == | ||
< | <pre> | ||
mp.vehicles.new(model, position, | mp.vehicles.new(model, position, | ||
{ | { | ||
| Line 16: | Line 16: | ||
dimension: dimension | dimension: dimension | ||
}); | }); | ||
</ | </pre> | ||
=== Parameters === | === Parameters === | ||
| Line 33: | Line 33: | ||
An example of creating a red Turismo with the license plate ADMIN | An example of creating a red Turismo with the license plate ADMIN | ||
{{ClientsideCode| | |||
<pre> | |||
< | |||
mp.vehicles.new(mp.game.joaat("turismor"), new mp.Vector3(-421.88, 1136.86, 326), | mp.vehicles.new(mp.game.joaat("turismor"), new mp.Vector3(-421.88, 1136.86, 326), | ||
{ | { | ||
| Line 41: | Line 40: | ||
color: [[255, 0, 0],[255,0,0]] | color: [[255, 0, 0],[255,0,0]] | ||
}); | }); | ||
</ | </pre> | ||
}} | |||
Same example but creating a blue Turismo and using it server-side | Same example but creating a blue Turismo and using it server-side | ||
{{ServersideCode| | |||
<pre> | |||
< | |||
mp.vehicles.new(mp.joaat("turismor"), new mp.Vector3(-441.88, 1156.86, 326), | mp.vehicles.new(mp.joaat("turismor"), new mp.Vector3(-441.88, 1156.86, 326), | ||
{ | { | ||
| Line 53: | Line 51: | ||
color: [[0, 255, 0],[0, 255, 0]] | color: [[0, 255, 0],[0, 255, 0]] | ||
}); | }); | ||
</ | </pre> | ||
}} | |||
Revision as of 11:41, 26 October 2018
Shared
Creates a vehicle.
Syntax
mp.vehicles.new(model, position,
{
heading: heading,
numberPlate: numberPlate,
alpha: alpha,
color: color,
locked: locked,
engine: engine,
dimension: dimension
});
Parameters
- model: Hash (use mp.joaat) or String
- position: Vector3
- heading: Number [-180:180]
- numberPlate: String
- alpha: Number
- color: [[Number, Number, Number], [Number, Number, Number]]
- locked: Boolean
- engine: Boolean
- dimension: Number
Examples
An example of creating a red Turismo with the license plate ADMIN
Client-Side
mp.vehicles.new(mp.game.joaat("turismor"), new mp.Vector3(-421.88, 1136.86, 326),
{
numberPlate: "ADMIN",
color: [[255, 0, 0],[255,0,0]]
});
Same example but creating a blue Turismo and using it server-side
Server-Side
mp.vehicles.new(mp.joaat("turismor"), new mp.Vector3(-441.88, 1156.86, 326),
{
numberPlate: "ADMIN",
color: [[0, 255, 0],[0, 255, 0]]
});