-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
36 lines (25 loc) · 1.32 KB
/
client.lua
File metadata and controls
36 lines (25 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- 17Tools/client.lua
local currentId = 1
RegisterCommand("gcords", function()
local playerPed = PlayerId()
local x, y, z = table.unpack(GetEntityCoords(PlayerPedId()))
local heading = GetEntityHeading(PlayerPedId())
local coordsString = string.format("[%d] = { coords = vector4(%.2f, %.2f, %.2f, %.2f) },", currentId, x, y, z, heading)
TriggerServerEvent("saveCoords", coordsString)
TriggerEvent("chatMessage", "SYSTEM", {255, 0, 0}, "Coordinates saved with ID " .. currentId)
currentId = currentId + 1
end, false)
RegisterCommand("tcords", function()
local playerPed = PlayerId()
local x, y, z = table.unpack(GetEntityCoords(PlayerPedId()))
local coordsString = string.format("vector3(%.2f, %.2f, %.2f),", x, y, z)
TriggerServerEvent("saveTreeCoords", coordsString)
TriggerEvent("chatMessage", "SYSTEM", {255, 0, 0}, "Tree coordinates saved.")
end, false)
RegisterCommand("dcords", function()
local playerPed = PlayerId()
local x, y, z = table.unpack(GetEntityCoords(PlayerPedId()))
local coordsString = string.format("vector3(%.2f, %.2f, %.2f),", x, y, z)
TriggerServerEvent("saveDelivererCoords", coordsString)
TriggerEvent("chatMessage", "SYSTEM", {255, 0, 0}, "Deliverer coordinates saved.")
end, false)