gta.createVehicle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Removed 'addToWorld()' function invoke as the webpage for 'addToWorld()' (https://wiki.gtaconnected.com/addToWorld) states that it no longer needs to be invoked.) |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 14: | Line 14: | ||
|bcName = game.createVehicle | |bcName = game.createVehicle | ||
|notes = Use the [[addToWorld|addToWorld]] function afterwards to add the vehicle to the players games. | |notes = Use the [[addToWorld|addToWorld]] function afterwards to add the vehicle to the players games. | ||
|exampleJSSS = addCommandHandler("vehicle", function(command, parameters, client) { | |||
var model = parseInt(parameters); | |||
var vehicle = gta.createVehicle(model, client.player.position); | |||
}); | |||
|exampleJSCS = addCommandHandler("vehicle", function(command, parameters) { | |||
var model = parseInt(parameters); | |||
var vehicle = gta.createVehicle(model, localPlayer.position); | |||
}); | |||
}} | }} | ||
Latest revision as of 02:20, 9 April 2025
gta.createVehicle
Signature: Vehicle The vehicle handle. gta.createVehicle()
Usage: add a vehicle
Parameters
- int model The vehicle model ID.
- Vec3 position optional Vec3(0.0, 0.0, 0.0) The position for the vehicle.
Return
Vehicle The vehicle handle.
On failure: null n/a