{"id":19982052,"url":"https://github.com/pycckue-bnepeg/samp-rs","last_synced_at":"2025-05-04T05:32:14.862Z","repository":{"id":53963170,"uuid":"121442466","full_name":"Pycckue-Bnepeg/samp-rs","owner":"Pycckue-Bnepeg","description":"SA:MP SDK written in Rust","archived":false,"fork":false,"pushed_at":"2024-04-16T07:17:17.000Z","size":1338,"stargazers_count":49,"open_issues_count":3,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T23:45:08.333Z","etag":null,"topics":["amx","bindings","plugin","plugins","rust","samp","samp-plugin","samp-sdk","sdk"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pycckue-Bnepeg.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-13T22:09:35.000Z","updated_at":"2025-02-05T13:42:34.000Z","dependencies_parsed_at":"2022-08-13T05:20:40.886Z","dependency_job_id":null,"html_url":"https://github.com/Pycckue-Bnepeg/samp-rs","commit_stats":null,"previous_names":["zottce/samp-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycckue-Bnepeg%2Fsamp-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycckue-Bnepeg%2Fsamp-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycckue-Bnepeg%2Fsamp-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pycckue-Bnepeg%2Fsamp-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pycckue-Bnepeg","download_url":"https://codeload.github.com/Pycckue-Bnepeg/samp-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252293082,"owners_count":21724960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["amx","bindings","plugin","plugins","rust","samp","samp-plugin","samp-sdk","sdk"],"created_at":"2024-11-13T04:08:54.431Z","updated_at":"2025-05-04T05:32:13.713Z","avatar_url":"https://github.com/Pycckue-Bnepeg.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docs](https://docs.rs/samp/badge.svg)](https://docs.rs/samp)\n[![Crates](https://img.shields.io/crates/v/samp.svg)](https://crates.io/crates/samp)\n# samp-rs\nsamp-rs is a tool to develop plugins for [samp](http://sa-mp.com) servers written in rust.\n\n# documentation\nit's [here](https://zottce.github.io/samp-rs/samp/index.html)! need to find a way to fix docs.rs ...\n\n# project structure\n* `samp` is a glue between crates described below (that's what you need).\n* `samp-codegen` generates raw `extern \"C\"` functions and does whole nasty job.\n* `samp-sdk` contains all types to work with amx.\n\n# usage\n* [install](https://rustup.rs) rust compiler (supports only `i686` os versions because of samp server arch).\n* add in your `Cargo.toml` this:\n```toml\n[lib]\ncrate-type = [\"cdylib\"] # or dylib\n\n[dependencies]\nsamp = \"0.1.2\"\n```\n* write your first plugin\n\n# migration from old versions\n* check out [the guide](migration.md)\n\n# examples\n* simple memcache plugin in `plugin-example` folder.\n* your `lib.rs` file\n```rust\nuse samp::prelude::*; // export most useful types\nuse samp::{native, initialize_plugin}; // codegen macros\n\nstruct Plugin;\n\nimpl SampPlugin for Plugin {\n    // this function executed when samp server loads your plugin\n    fn on_load(\u0026mut self) {\n        println!(\"Plugin is loaded.\");\n    }\n}\n\nimpl Plugin {\n    #[native(name = \"TestNative\")]\n    fn my_native(\u0026mut self, _amx: \u0026Amx, text: AmxString) -\u003e AmxResult\u003cbool\u003e {\n        let text = text.to_string(); // convert amx string into rust string\n        println!(\"rust plugin: {}\", text);\n\n        Ok(true)\n    }\n}\n\ninitialize_plugin!(\n    natives: [Plugin::my_native],\n    {\n        let plugin = Plugin; // create a plugin object\n        return plugin; // return the plugin into runtime\n    }\n)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycckue-bnepeg%2Fsamp-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycckue-bnepeg%2Fsamp-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycckue-bnepeg%2Fsamp-rs/lists"}