{"id":38422803,"url":"https://github.com/openmultiplayer/open.mp-capi","last_synced_at":"2026-01-17T04:16:48.357Z","repository":{"id":319501839,"uuid":"1072229952","full_name":"openmultiplayer/open.mp-capi","owner":"openmultiplayer","description":"C-API SDK for open.mp","archived":false,"fork":false,"pushed_at":"2025-12-22T10:40:37.000Z","size":62,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-23T21:50:41.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openmultiplayer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-10-08T12:41:16.000Z","updated_at":"2025-12-22T10:40:41.000Z","dependencies_parsed_at":"2025-10-19T09:34:36.835Z","dependency_job_id":null,"html_url":"https://github.com/openmultiplayer/open.mp-capi","commit_stats":null,"previous_names":["openmultiplayer/open.mp-capi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openmultiplayer/open.mp-capi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openmultiplayer%2Fopen.mp-capi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openmultiplayer%2Fopen.mp-capi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openmultiplayer%2Fopen.mp-capi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openmultiplayer%2Fopen.mp-capi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openmultiplayer","download_url":"https://codeload.github.com/openmultiplayer/open.mp-capi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openmultiplayer%2Fopen.mp-capi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28494645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-17T04:16:48.251Z","updated_at":"2026-01-17T04:16:48.330Z","avatar_url":"https://github.com/openmultiplayer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open.mp C API\n\nA single-header C API for [open.mp](https://www.open.mp/) (Open Multiplayer), providing a comprehensive interface to create open.mp components and interact with the server.\n\n## Overview\n\nThis library provides a complete C API for open.mp server functionality, allowing you to create components in C or any language that supports C FFI (Foreign Function Interface). The API covers all major aspects of the open.mp server including:\n\n- **Players**: Player management, properties, actions, and state\n- **Vehicles**: Vehicle creation, control, and modification\n- **Objects**: Static and player-attached objects\n- **Actors**: NPC actors with animations and properties\n- **Checkpoints**: Race checkpoints and regular checkpoints\n- **TextDraws**: 2D text drawing for HUD elements\n- **TextLabels**: 3D text labels in the game world\n- **Pickups**: Collectible items in the world\n- **GangZones**: Territory marking and management\n- **Menus**: Interactive menu systems\n- **Dialogs**: Player dialog interfaces\n- **Classes**: Player class/spawn configurations\n- **Custom Models**: Custom model management\n- **Events**: Event system for hooking into server events\n- **Configuration**: Server configuration access\n- **Core**: Core server functionality and utilities\n\n## Features\n\n- **Header-only**: Single header file with complete API definitions\n- **Cross-platform**: Supports Windows and Unix-like systems (Linux, macOS, etc.)\n- **FFI-friendly**: Can be used from any language supporting C FFI (Python, Rust, Go, etc.)\n- **Complete API coverage**: Provides access to all open.mp server functionality\n- **Dynamic loading**: Built-in support for dynamic library loading on both Windows and Unix\n\n## Usage\n\n### Basic Setup\n\n1. Include the header file in your C/C++ project:\n\n```c\n#include \"ompcapi.h\"\n```\n\n2. Initialize the API by creating an `OMPAPI_t` instance and calling `omp_initialize_capi`:\n\n```c\n#include \"ompcapi.h\"\n\nstruct OMPAPI_t api;\n\nint main() \n{\n    // Initialize the API - this loads the $CAPI library and all functions\n    if (!omp_initialize_capi(\u0026api))\n    {\n        // Initialization failed - library not found or functions couldn't be loaded\n        printf(\"Failed to initialize open.mp C API\\n\");\n        return 1;\n    }\n\n    // Now you can use the API\n    // Example: Create an actor\n    int actor_id;\n    void* actor = api.Actor.Create(123, 0.0f, 0.0f, 3.0f, 0.0f, \u0026actor_id);\n\n    return 0;\n}\n```\n\nThe `omp_initialize_capi` function:\n- Returns `true` if initialization succeeds\n- Returns `false` if the library cannot be loaded or if API functions cannot be found\n- Automatically loads the appropriate library (`$CAPI.dll` on Windows, `$CAPI.so` on Unix)\n- Populates the `OMPAPI_t` structure with all available API functions\n\n### Using with CMake\n\nAdd this repository as a subdirectory:\n\n```cmake\nadd_subdirectory(open.mp-capi)\ntarget_link_libraries(your_component PRIVATE ompcapi)\n```\n\n## API Documentation\n\nThe complete API documentation is available in the `apidocs/` directory:\n- `api.json`: Complete JSON specification of all API functions\n- `events.json`: Event system documentation\n\n## Project Structure\n\n```\nopen.mp-capi/\n├── include/\n│   └── ompcapi.h       # Main header file with complete API\n├── apidocs/\n│   ├── api.json        # API function specifications\n│   └── events.json     # Event system specifications\n├── CMakeLists.txt      # CMake configuration\n├── LICENSE.md          # Mozilla Public License 2.0\n└── README.md           # This file\n```\n\n## License\n\nThis project is licensed under the Mozilla Public License Version 2.0. See [LICENSE.md](LICENSE.md) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmultiplayer%2Fopen.mp-capi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenmultiplayer%2Fopen.mp-capi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmultiplayer%2Fopen.mp-capi/lists"}