getVehicleDummyPosition | Multi Theft Auto: Wiki Skip to content

getVehicleDummyPosition

Client-side
Server-side
Shared
Needs checking

This function was partially migrated from the old wiki. Please review manually:

  • Missing section: Allowed Dummies

Pair: setVehicleDummyPosition

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns the position of the dummy for the given vehicle.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getDummyPosition(...)

Syntax

float,​ float,​ float getVehicleDummyPosition ( vehicle theVehicle, string dummy )
Required Arguments
  • theVehicle: The vehicle you want to get the dummy positions from.
  • dummy: The dummy whose position you want to get.

Returns

  • float: x
  • float: y
  • float: z

Returns 3 floats indicating the position X, Y and Z of the vehicle's dummy. It returns false otherwise.

Code Examples

shared

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

Vehicle Functions