Player coordinates in subtilte

hello
i have a server and i am searching for a scripte writes player coordinates by text online somthing like this

X= 2669.716, Y= 3517.079, Z= 51.981, A= 0

any help please

2 Likes

with something so easy why don’t you try to script it ?
try at least , if you are block on something i can help you.

What exactly are you trying to do?

You can do it like that, you just have to modify the position on line 5 - 6 - 7 - 8

Citizen.CreateThread(function()
    while true do
    	Citizen.Wait(0) 
    	pos = GetEntityCoords(GetPlayerPed(-1))
        heading = GetEntityHeading(GetPlayerPed(-1))
    	WriteCoords("x : " .. tostring(pos.x), 0.8, 0.49)
    	WriteCoords("y : " .. tostring(pos.y), 0.8, 0.51)
    	WriteCoords("z : " .. tostring(pos.z), 0.8, 0.53)    	
    	WriteCoords("a : " .. tostring(heading), 0.8, 0.55)
    end
end)

function WriteCoords(txt, x, y)
	SetTextFont(0)
	SetTextProportional(0)
	SetTextScale(0.4, 0.4)
	SetTextColour(255, 255, 255, 255)
	SetTextEntry("STRING")
	AddTextComponentString(txt)
	DrawText(x, y)
end
1 Like

Here you go, just add this to your resources, and add the following to your server.cfg and you’re good to go! :wink:

Show Coords

showcoords.zip (3.0 KB)

start showcoords
6 Likes

thank you all for your help

"x : " .. tostring(pos.x)

Lua already set pox.x as strign while you’re using … concatener

i did it with secretcars plugin but the car dont spown in right positon in the parking any help

CreateVehicle(modelHash, x, y, z, heading, isNetwork, p6)

the car spawn where you tell it to spawn.

thank you Izio_Romain

how to make cars spawn just one time ?

Just call the function once ^^

cant load resource showcoords?