{"id":21583,"date":"2026-06-08T11:37:14","date_gmt":"2026-06-08T11:37:14","guid":{"rendered":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/"},"modified":"2026-06-08T11:37:14","modified_gmt":"2026-06-08T11:37:14","slug":"how-to-get-coordinates-fivem","status":"publish","type":"post","link":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/","title":{"rendered":"How to Get &#038; Use Coordinates (vector3) in FiveM"},"content":{"rendered":"<p>Coordinates are everywhere in FiveM scripting \u2014 spawns, markers, blips, job points, teleports and distance checks. Getting them and working with them efficiently saves a lot of time. This guide covers how to get and use coordinates (vector3) in FiveM.<\/p>\n<h2>Getting your current coordinates<\/h2>\n<p>The quickest way in-game is to print your position:<\/p>\n<pre><code>local coords = GetEntityCoords(PlayerPedId())\nprint(coords.x, coords.y, coords.z)\n-- heading:\nprint(GetEntityHeading(PlayerPedId()))<\/code><\/pre>\n<p>Many servers add a <code>\/coords<\/code> command that copies this to your clipboard for placing props, blips and markers.<\/p>\n<h2>vector3 and vector4<\/h2>\n<p>FiveM uses <code>vector3(x, y, z)<\/code> for positions and <code>vector4(x, y, z, w)<\/code> when you also need a heading (w). Natives like <code>SetEntityCoords<\/code>, <code>AddBlipForCoord<\/code> and <code>CreateObject<\/code> take these. You can index them with <code>.x<\/code>, <code>.y<\/code>, <code>.z<\/code> or do vector maths directly (e.g. <code>#(coordsA - coordsB)<\/code> for distance).<\/p>\n<h2>Distance and heading<\/h2>\n<p>Common needs: the distance between a player and a point (for an interaction range), and the heading to face from one point to another (for spawns). You can compute these with vector subtraction and <code>atan2<\/code>, or skip the maths entirely with our free <a href=\"https:\/\/xgamingserver.com\/tools\/fivem\/vector3\">Vector3 \/ coordinates tool<\/a> \u2014 paste two coordinates and get the 3D\/2D distance, heading and midpoint, plus conversion between vector3, vector4, Lua table, JSON and C# formats.<\/p>\n<h2>Converting formats<\/h2>\n<p>Coordinates show up in many formats \u2014 a raw <code>x, y, z<\/code> from a map editor, a Lua table from a config, JSON from an API. The Vector3 tool auto-detects any format you paste and outputs all of them, ready to drop into your script.<\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>How do I get my coordinates in FiveM?<\/h3>\n<p>Use <code>GetEntityCoords(PlayerPedId())<\/code> and print x, y, z (and <code>GetEntityHeading<\/code> for the facing). Many servers bind this to a <code>\/coords<\/code> command.<\/p>\n<h3>What&#8217;s the difference between vector3 and vector4 in FiveM?<\/h3>\n<p>vector3 is a position (x, y, z); vector4 adds a heading (w). Use vector4 when you need the entity to face a direction, like a spawn point.<\/p>\n<h3>How do I get the distance between two coordinates?<\/h3>\n<p>Subtract the vectors and take the magnitude (<code>#(a - b)<\/code>), or use our Vector3 tool to compute 3D\/2D distance instantly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to get and use coordinates in FiveM \u2014 GetEntityCoords, vector3 vs vector4, distance and heading, and converting formats.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gspb_post_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[142],"tags":[],"class_list":["post-21583","post","type-post","status-publish","format-standard","hentry","category-fivem"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Get &amp; Use Coordinates (vector3) in FiveM - XGamingServer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Get &amp; Use Coordinates (vector3) in FiveM\" \/>\n<meta property=\"og:description\" content=\"How to get and use coordinates in FiveM \u2014 GetEntityCoords, vector3 vs vector4, distance and heading, and converting formats.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\" \/>\n<meta property=\"og:site_name\" content=\"XGamingServer\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/xgamingserver69\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-08T11:37:14+00:00\" \/>\n<meta name=\"author\" content=\"Hectar Carson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@xgamingserver\" \/>\n<meta name=\"twitter:site\" content=\"@xgamingserver\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hectar Carson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\"},\"author\":{\"name\":\"Hectar Carson\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/561042c617869348e75abfe16a269f8d\"},\"headline\":\"How to Get &#038; Use Coordinates (vector3) in FiveM\",\"datePublished\":\"2026-06-08T11:37:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\"},\"wordCount\":317,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\"},\"articleSection\":[\"FiveM\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\",\"url\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\",\"name\":\"How to Get & Use Coordinates (vector3) in FiveM - XGamingServer\",\"isPartOf\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#website\"},\"datePublished\":\"2026-06-08T11:37:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/xgamingserver.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FiveM\",\"item\":\"https:\/\/xgamingserver.com\/blog\/category\/fivem\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Get &#038; Use Coordinates (vector3) in FiveM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#website\",\"url\":\"https:\/\/xgamingserver.com\/blog\/\",\"name\":\"XGamingServer\",\"description\":\"Dedicated Game Server Hosting\",\"publisher\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/xgamingserver.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\",\"name\":\"XGamingServer\",\"url\":\"https:\/\/xgamingserver.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg\",\"contentUrl\":\"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"XGamingServer\"},\"image\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/web.facebook.com\/xgamingserver69\/\",\"https:\/\/x.com\/xgamingserver\",\"https:\/\/www.instagram.com\/xgamingserver\/\",\"https:\/\/www.linkedin.com\/company\/xgamingserver\/\",\"https:\/\/www.pinterest.com\/xgamingserver\/\",\"https:\/\/www.youtube.com\/channel\/UCHnOtWxpzaL2r3jM9Jm40EQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/561042c617869348e75abfe16a269f8d\",\"name\":\"Hectar Carson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1cbcd42dac6c5f21cb52dd64f03fd442250a15f7bb1ade04e23002eb5b384de5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1cbcd42dac6c5f21cb52dd64f03fd442250a15f7bb1ade04e23002eb5b384de5?s=96&d=mm&r=g\",\"caption\":\"Hectar Carson\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Get & Use Coordinates (vector3) in FiveM - XGamingServer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/","og_locale":"en_US","og_type":"article","og_title":"How to Get & Use Coordinates (vector3) in FiveM","og_description":"How to get and use coordinates in FiveM \u2014 GetEntityCoords, vector3 vs vector4, distance and heading, and converting formats.","og_url":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/","og_site_name":"XGamingServer","article_publisher":"https:\/\/web.facebook.com\/xgamingserver69\/","article_published_time":"2026-06-08T11:37:14+00:00","author":"Hectar Carson","twitter_card":"summary_large_image","twitter_creator":"@xgamingserver","twitter_site":"@xgamingserver","twitter_misc":{"Written by":"Hectar Carson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#article","isPartOf":{"@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/"},"author":{"name":"Hectar Carson","@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/561042c617869348e75abfe16a269f8d"},"headline":"How to Get &#038; Use Coordinates (vector3) in FiveM","datePublished":"2026-06-08T11:37:14+00:00","mainEntityOfPage":{"@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/"},"wordCount":317,"commentCount":0,"publisher":{"@id":"https:\/\/xgamingserver.com\/blog\/#organization"},"articleSection":["FiveM"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/","url":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/","name":"How to Get & Use Coordinates (vector3) in FiveM - XGamingServer","isPartOf":{"@id":"https:\/\/xgamingserver.com\/blog\/#website"},"datePublished":"2026-06-08T11:37:14+00:00","breadcrumb":{"@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/xgamingserver.com\/blog\/how-to-get-coordinates-fivem\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/xgamingserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FiveM","item":"https:\/\/xgamingserver.com\/blog\/category\/fivem\/"},{"@type":"ListItem","position":3,"name":"How to Get &#038; Use Coordinates (vector3) in FiveM"}]},{"@type":"WebSite","@id":"https:\/\/xgamingserver.com\/blog\/#website","url":"https:\/\/xgamingserver.com\/blog\/","name":"XGamingServer","description":"Dedicated Game Server Hosting","publisher":{"@id":"https:\/\/xgamingserver.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/xgamingserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/xgamingserver.com\/blog\/#organization","name":"XGamingServer","url":"https:\/\/xgamingserver.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg","contentUrl":"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg","width":"1024","height":"1024","caption":"XGamingServer"},"image":{"@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.facebook.com\/xgamingserver69\/","https:\/\/x.com\/xgamingserver","https:\/\/www.instagram.com\/xgamingserver\/","https:\/\/www.linkedin.com\/company\/xgamingserver\/","https:\/\/www.pinterest.com\/xgamingserver\/","https:\/\/www.youtube.com\/channel\/UCHnOtWxpzaL2r3jM9Jm40EQ"]},{"@type":"Person","@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/561042c617869348e75abfe16a269f8d","name":"Hectar Carson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1cbcd42dac6c5f21cb52dd64f03fd442250a15f7bb1ade04e23002eb5b384de5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1cbcd42dac6c5f21cb52dd64f03fd442250a15f7bb1ade04e23002eb5b384de5?s=96&d=mm&r=g","caption":"Hectar Carson"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts\/21583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/comments?post=21583"}],"version-history":[{"count":0,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts\/21583\/revisions"}],"wp:attachment":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/media?parent=21583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/categories?post=21583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/tags?post=21583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}