mirror of
https://github.com/BeamMP/Docs.git
synced 2026-06-17 22:32:47 +00:00
continue GetPositionRaw error handling
This commit is contained in:
@@ -451,11 +451,15 @@ local player_id = 4
|
|||||||
local vehicle_id = 0
|
local vehicle_id = 0
|
||||||
|
|
||||||
local raw_pos, error = MP.GetPositionRaw(player_id, vehicle_id)
|
local raw_pos, error = MP.GetPositionRaw(player_id, vehicle_id)
|
||||||
|
if error = "" then
|
||||||
local x, y, z = table.unpack(raw_pos["pos"])
|
local x, y, z = table.unpack(raw_pos["pos"])
|
||||||
|
|
||||||
print("X:", x)
|
print("X:", x)
|
||||||
print("Y:", y)
|
print("Y:", y)
|
||||||
print("Z:", z)
|
print("Z:", z)
|
||||||
|
else
|
||||||
|
print(error)
|
||||||
|
end
|
||||||
```
|
```
|
||||||
Output:
|
Output:
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user