Cleanup and placeable_object replacement
Added cleaned up and improved functionality for placeable object. Example is in unit tests. Cleanup whitespace and removed accessibility as not used/not documented and doesnt appear to be useful with our current work flow
This commit is contained in:
1 parent
b5dd8c018c
commit
3fa933fab1
24 files changed
+698
-903
No files matched your search
@@ -0,0 +1,29 @@
|
||||
local isPlacing = false
|
||||
RegisterCommand('startplacer', function(source, args, rawCommand)
|
||||
if Bridge.PlaceableObject.IsPlacing() then
|
||||
print("Already placing an object.")
|
||||
return
|
||||
end
|
||||
|
||||
local model = args[1] or 'prop_barrel_01a' -- Default model if none provided
|
||||
local position = GetEntityCoords(PlayerPedId())
|
||||
local result = Bridge.PlaceableObject.Create(model, {
|
||||
allowMovement = true, -- Enable movement mode
|
||||
allowNormal = true, -- Enable normal mode
|
||||
allowVertical = false, -- Allow vertical movement in normal mode
|
||||
startMode = 'normal', -- Start in normal mode
|
||||
depthMin = 2.0,
|
||||
depthMax = 15.0,
|
||||
heightStep = 0.2, -- Height adjustment step
|
||||
boundary = {min = vector3(position.x - 5, position.y - 5, position.z - 1.5), max = vector3(position.x + 5, position.y + 5, position.z + 10)},
|
||||
showInstructionalButtons = true, -- Show instructional buttons
|
||||
})
|
||||
|
||||
if result then
|
||||
print("Object placed!")
|
||||
print("Position:", result.position)
|
||||
print("Heading:", result.heading)
|
||||
else
|
||||
print("Placement cancelled")
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user