function main()
repeat wait(0) until isSampAvailable()
while true do wait(0)
if isKeyJustPressed(75) and not sampIsDialogActive(-1) and not sampIsChatInputActive() then
result, posX, posY, posZ = getTargetBlipCoordinates()
if result then
sampSendRequestSpawn()
sampSpawnPlayer()
z = getGroundZFor3dCoord(posX, posY, 999)
setCharCoordinates(PLAYER_PED, posX, posY, z)
else
sampAddChatMessage('Метки нет', -1)
end
end
end
end