Files
2026-06-01 12:46:52 +02:00

28 lines
627 B
Lua

function map_position()
--Define Map Length (always 16128)
maplen = 16128
--Define In-Game Coords
igX = gv("x")
igY = gv("y")
--Divide In-Game Coords by Map Length
--This gives us the map name m00X_00Y
mpX = igX / maplen
mpY = igY / maplen
--Multiple map_part x/y by maplen
trX = mpX * maplen
trY = mpY * maplen
--Subtract trX/Y from in-game coords
qpfX = igX - trX
qpfY = igY - trY
--Send to client
message(sconv("<B>[IN-GAME] Map Position: ".. gv("x") ..","..gv("y")..""))
message(sconv("<B>[CLIENT] Map Name: M0".. mpX .."_0".. mpY ..""))
message(sconv("<B>[QPF] Position: ".. qpfX ..",".. qpfY .." "))
end