GetVehicleDummyPosition: Difference between revisions
Jump to navigation
Jump to search
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{Added feature/item|1.5.9|1.5.8|20797|This function returns the position of the dummy for the given [[vehicle]].}} | |||
{{ | |||
This function returns the position of the dummy for the given vehicle.}} | |||
==Syntax== | ==Syntax== | ||
Line 12: | Line 10: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The [[vehicle]] you want to get the dummy positions from | *'''theVehicle:''' The [[vehicle]] you want to get the dummy positions from. | ||
*'''dummy:''' The dummy whose position you want to get | *'''dummy:''' The dummy whose position you want to get. | ||
==Allowed | ===Allowed Dummies=== | ||
{{VehicleDummies}} | {{VehicleDummies}} | ||
===Returns=== | ===Returns=== | ||
Returns | Returns 3 [[Float|floats]] indicating the position X, Y and Z of the vehicle's dummy. It returns ''false'' otherwise. | ||
==Example== | |||
This is a command to get the position of the player's vehicle dummy position specified as an argument. | This is a command to get the position of the player's vehicle dummy position specified as an argument. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function getDummyPosition( | function getDummyPosition (commandName, dummy) | ||
if | if not dummy then | ||
return false | return false | ||
end | end | ||
local veh = getPedOccupiedVehicle(localPlayer) | local veh = getPedOccupiedVehicle (localPlayer) | ||
if | |||
outputChatBox("You should be in a vehicle to use this command", 255, 25, 25) | if not veh then | ||
outputChatBox ("You should be in a vehicle to use this command", 255, 25, 25) | |||
return false | return false | ||
end | end | ||
local x, y, z = getVehicleDummyPosition(veh, dummy) | |||
outputChatBox("X: "..x..", Y: "..y..", Z: "..z, 0, 255, 0) | local x, y, z = getVehicleDummyPosition (veh, dummy) | ||
outputChatBox ("X: "..x..", Y: "..y..", Z: "..z, 0, 255, 0) | |||
end | end | ||
addCommandHandler("getdummy", getDummyPosition) | |||
addCommandHandler ("getdummy", getDummyPosition) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client vehicle functions}} | {{Client vehicle functions}} |
Latest revision as of 17:32, 7 November 2024
This function returns the position of the dummy for the given vehicle.
Syntax
float, float, float getVehicleDummyPosition ( vehicle theVehicle, string dummy )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getDummyPosition(...)
- Counterpart: setVehicleDummyPosition
Required Arguments
- theVehicle: The vehicle you want to get the dummy positions from.
- dummy: The dummy whose position you want to get.
Allowed Dummies
- light_front_main: Primary front lights position.
- light_rear_main: Primary rear lights position.
- light_front_second: Secondary front lights position.
- light_rear_second: Secondary rear lights position.
- seat_front: Front seat position.
- seat_rear: Rear seat position.
- exhaust: Exhaust fumes start position.
- engine: Engine smoke start position.
- gas_cap: Vehicle gas cap position (shooting it will explode vehicle).
- trailer_attach: Point at which trailers will be attached to vehicle.
- hand_rest: Point at which the steer of a bike is held.
- exhaust_second: Secondary exhaust position (for example in NRG-500)
- wing_airtrail: Point from which air trail will show in airplanes, visible while in sharp turns.
- veh_gun: Vehicle gun position (ex. Rustler).
Returns
Returns 3 floats indicating the position X, Y and Z of the vehicle's dummy. It returns false otherwise.
Example
This is a command to get the position of the player's vehicle dummy position specified as an argument.
function getDummyPosition (commandName, dummy) if not dummy then return false end local veh = getPedOccupiedVehicle (localPlayer) if not veh then outputChatBox ("You should be in a vehicle to use this command", 255, 25, 25) return false end local x, y, z = getVehicleDummyPosition (veh, dummy) outputChatBox ("X: "..x..", Y: "..y..", Z: "..z, 0, 255, 0) end addCommandHandler ("getdummy", getDummyPosition)
See Also
- areVehicleLightsOn
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getVehicleAdjustableProperty
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleCurrentGear
- getVehicleDummyPosition
- getVehicleGravity
- getVehicleLandingGearDown
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelWheelSize
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleWheelFrictionState
- getVehicleWheelScale
- isTrainChainEngine
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleWheelOnGround
- isVehicleWindowOpen
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setVehicleAdjustableProperty
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDummyPosition
- setVehicleGravity
- setVehicleLandingGearDown
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleWheelScale
- setVehicleWheelStates
- setVehicleWindowOpen
- Shared
- 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