ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getPedAttachedVehicle

Function

getPedAttachedVehicle

ServerPedsTrilogy Hub only

Returns the vehicle the ped is riding on, plus its offset and rotation.

Syntax

vehicle, float, float, float, float getPedAttachedVehicle(ped ped)

Arguments

pedped
An NPC or a player.

Returns

The vehicle, x, y, z, rotation; false if the ped is not riding.

Example

local veh = getPedAttachedVehicle(player)
if veh then outputChatBox("Jedziesz na " .. getVehicleName(veh), player) end

See also