{"id":33901104,"url":"https://github.com/freddiecrew/gps-nav","last_synced_at":"2026-03-11T03:02:37.488Z","repository":{"id":328074153,"uuid":"1114123587","full_name":"FreddieCrew/gps-nav","owner":"FreddieCrew","description":"open.mp GPS library","archived":false,"fork":false,"pushed_at":"2025-12-12T21:36:50.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T01:59:42.897Z","etag":null,"topics":["gps","gtasa","openmultiplayer","pawn","pawn-package","sa-mp","sa-mp-library","samp"],"latest_commit_sha":null,"homepage":"","language":"Pawn","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreddieCrew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-10T23:51:22.000Z","updated_at":"2025-12-12T21:36:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FreddieCrew/gps-nav","commit_stats":null,"previous_names":["freddiecrew/gps-nav"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FreddieCrew/gps-nav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreddieCrew%2Fgps-nav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreddieCrew%2Fgps-nav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreddieCrew%2Fgps-nav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreddieCrew%2Fgps-nav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreddieCrew","download_url":"https://codeload.github.com/FreddieCrew/gps-nav/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreddieCrew%2Fgps-nav/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30368563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gps","gtasa","openmultiplayer","pawn","pawn-package","sa-mp","sa-mp-library","samp"],"created_at":"2025-12-11T23:46:33.315Z","updated_at":"2026-03-11T03:02:37.482Z","avatar_url":"https://github.com/FreddieCrew.png","language":"Pawn","readme":"# gps-nav\n\nA lightweight, circular-buffer based GPS navigation system for open.mp.\n\n## How it works\n\nDrawing a line from LS to LV takes way more than the 1024 gangzones SA-MP gives us per player. Most scripts just hit the limit and break.\n\nIt simply bumps the pointer. When the buffer is full (default `600`), it pauses rendering the path ahead until you move forward and free up slots in the tail. It essentially \"streams\" the path to the client.\n\n## Dependencies\n\nYou need the pathfinding plugin to calculate the nodes This library just handles the rendering logic.\n\n- **[open.mp](https://github.com/openmultiplayer/open.mp)**\n- **[omp-stdlib](https://github.com/openmultiplayer/omp-stdlib)**\n- **[samp-gps-plugin](https://github.com/AmyrAhmady/samp-gps-plugin)** (Handles the A* math on a separate thread so the server doesn't choke)\n\n\nIt should *theoretically* also work with SA-MP's standard library/server, but you will need [YSF](https://github.com/IS4Code/YSF) for player gangzones. \n\nI haven't tested it myself, so you're on your own. If you run into any SA-MP issues while testing, feel free to [open an issue](https://github.com/FreddieCrew/gps-nav/issues) or [submit a PR](https://github.com/FreddieCrew/gps-nav/pulls), and I'll surely have a look.\n\n---\n\n# READ THIS IF YOU'RE USING OPEN.MP\n\n## The issue:\nIf you are using the latest **open.mp** includes, you are going to get a compiler error that looks like this: `GPS.inc(12) : error 020: invalid symbol name \"\"`\n The `GPS` plugin include defines a constant named [`INVALID_PATH_ID`](https://github.com/AmyrAhmady/samp-gps-plugin/blob/master/GPS.inc#L12).\n\nThe latest open.mp standard library *also* introduced a constant named [`INVALID_PATH_ID`](https://github.com/openmultiplayer/omp-stdlib/blob/f86393d50e6c242a99e2153c398cce13949ef6f0/omp_npc.inc#L52) (for the NPC component). Since Pawn has a global namespace, they conflict.\n\n## How to fix it:\nOpen your `GPS.inc` file (from the plugin), find the definition, and rename it to avoid the collision:\n\n```pawn\n// Inside GPS.inc (line 10)\n// Change this line:\n#define INVALID_PATH_ID (0)\n\n// To this:\n#define INVALID_GPS_PATH_ID (0)\n```\n\nThis library (`gps-nav`) expects the path ID to be passed around anyway, so just make sure your plugin include doesn't conflict with the stdlib.\n\n---\n\n## Configuration\n\nYou can tweak the settings at the top of your script before including the file.\n\n```pawn\n// 600 is a good sweetspot. Sufficient for buffer, saves memory.\n// Going higher than 800 risks hitting the per-player gangzone limit if you use zones elsewhere.\n#define MAX_GPS_ZONES 600 \n\n#define GPS_LINE_WIDTH 15.0\n#define GPS_COLOR 0xA850E6FF\n#define GPS_UPDATE_INTERVAL 400 // Milliseconds\n```\n\n## Usage\n\nIt's plug-and-play.\n\n```pawn\n#include \u003cgps-nav\u003e\n\n// Start navigation\n// Returns 1 if path found, 0 if failed.\nGPS_Start(playerid, targetX, targetY, targetZ);\n\n// Stop navigation\nGPS_Stop(playerid);\n\n// Check if active\nif(GPS_IsActive(playerid)) {\n    // ...\n}\n```\n\n## Callbacks\n\nThese are useful events to handle UI elements (like setting the map marker).\n\n### `OnPlayerGPSActivate`\nCalled immediately when `GPS_Start` is initialized.\n\nExample:\n\n```pawn\npublic OnPlayerGPSActivate(playerid, Float:X, Float:Y, Float:Z) {\n    // Set a global waypoint icon (ID 0) so they can see where they are going\n    SetPlayerMapIcon(playerid, 0, X, Y, Z, 41, 0, MAPICON_GLOBAL); \n    return 1;\n}\n```\n\n### `OnPlayerGPSArrival`\nCalled when the player is within range of the destination.\n\nExample:\n```pawn\npublic OnPlayerGPSArrival(playerid) {\n    RemovePlayerMapIcon(playerid, 0); \n    GameTextForPlayer(playerid, \"~g~Arrived\", 3000, 3);\n    return 1;\n}\n```\n\n## Notes\n\u003e [!NOTE]\n\u003e The pathfinding happens on a separate thread (thanks to the plugin), but the rendering happens in the update tick. The circular buffer keeps it cheap, as long as you don't set `GPS_UPDATE_INTERVAL` to something like 10ms.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreddiecrew%2Fgps-nav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreddiecrew%2Fgps-nav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreddiecrew%2Fgps-nav/lists"}