function main()
sampRegisterChatCommand("toplayer", function(id)
_, ped = sampGetCharHandleBySampPlayerId(id)
if _ then
h = getCharHeading(ped)
x, y, z = getCharCoordinates(ped)
setCharCoordinates(1, x + 0.5 * math.sin(-math.rad(h)), y + 0.5 * math.cos(-math.rad(h)), z)
end
end)
wait(-1)
end