Add function to return player's current vehicle if available
This commit is contained in:
@@ -55,6 +55,15 @@ function GET_PLAYER_PED_OFFSET(offset_x, offset_y, offset_z)
|
|||||||
return GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player_ped, offset_x, offset_y, offset_z)
|
return GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player_ped, offset_x, offset_y, offset_z)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function RETURN_PLAYER_VEHICLE()
|
||||||
|
local player_ped = PLAYER_PED_ID()
|
||||||
|
if IS_PED_IN_ANY_VEHICLE(player_ped, false) then
|
||||||
|
local vehicle = GET_VEHICLE_PED_IS_IN(player_ped, false)
|
||||||
|
return vehicle
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
function GET_PLAYER_PED_HEADING()
|
function GET_PLAYER_PED_HEADING()
|
||||||
local player_ped = PLAYER_PED_ID()
|
local player_ped = PLAYER_PED_ID()
|
||||||
return GET_ENTITY_HEADING(player_ped)
|
return GET_ENTITY_HEADING(player_ped)
|
||||||
|
|||||||
Reference in New Issue
Block a user