CreateVehicle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">vehicle createVehicle ( model, x, y, z, [rx, ry, rz] )</syntaxhighlight> | <syntaxhighlight lang="lua">vehicle createVehicle ( model, x, y, z, [rx, ry, rz, string numberplate] )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 16: | Line 16: | ||
* '''ry''': A floating point number representing the rotation about the Y axis in Radians. | * '''ry''': A floating point number representing the rotation about the Y axis in Radians. | ||
* '''rz''': A floating point number representing the rotation about the Z axis in Radians. | * '''rz''': A floating point number representing the rotation about the Z axis in Radians. | ||
* '''numberplate''': A string that will go on the number plate of the car (max 8 letters) | |||
{{UsingRadians}} | {{UsingRadians}} | ||
Line 22: | Line 23: | ||
if ( strtok ( chat, 1, 32 ) == "!createhydra" ) then | if ( strtok ( chat, 1, 32 ) == "!createhydra" ) then | ||
x, y, z = getPlayerPosition ( player ) | x, y, z = getPlayerPosition ( player ) | ||
createVehicle ( 520, x + 5, y, z ) | createVehicle ( 520, x + 5, y, z, 0, 0, 0, "Lollerz" ) | ||
outputChatBox ( "You got a hydra", player ) | outputChatBox ( "You got a hydra", player ) | ||
end | end |
Revision as of 20:07, 8 July 2006
This function creates a vehicle and returns a handle to the created vehicle. If it fails, it will return false. This can happen if you exceed the upper vehicle limit at 65535 or due to an another unspecified future reason.
Syntax
vehicle createVehicle ( model, x, y, z, [rx, ry, rz, string numberplate] )
Required Arguments
- model: The Vehicle IDs|vehicle ID of the vehicle being created.
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- rx: A floating point number representing the rotation about the X axis in Radians.
- ry: A floating point number representing the rotation about the Y axis in Radians.
- rz: A floating point number representing the rotation about the Z axis in Radians.
- numberplate: A string that will go on the number plate of the car (max 8 letters)
Example
function onPlayerChat ( player, chat ) if ( strtok ( chat, 1, 32 ) == "!createhydra" ) then x, y, z = getPlayerPosition ( player ) createVehicle ( 520, x + 5, y, z, 0, 0, 0, "Lollerz" ) outputChatBox ( "You got a hydra", player ) end end
See Also
GTASA IDs (vehicles, weapons, weathers, characters, colors): http://info.vces.net/ (Special thanks to Brophy and Ratt for making these lists)
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates