All Projects → ZOTTCE → samp-rs

ZOTTCE / samp-rs

Licence: other
SA:MP SDK written in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to samp-rs

samp-ptl
SA:MP Plugin Template Library (C++17)
Stars: ✭ 16 (-55.56%)
Mutual labels:  samp, amx
Layui Excel
简单快捷的导出插件,导出仅需一句话
Stars: ✭ 239 (+563.89%)
Mutual labels:  plugins
Slate Plugins
A set of my personal Slate editor plugins, in a monorepo.
Stars: ✭ 191 (+430.56%)
Mutual labels:  plugins
.tmux
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Stars: ✭ 15,594 (+43216.67%)
Mutual labels:  plugins
Browser Base
Modern and feature-rich web browser base based on Electron
Stars: ✭ 2,417 (+6613.89%)
Mutual labels:  plugins
Android Upload Service
Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.
Stars: ✭ 2,593 (+7102.78%)
Mutual labels:  plugins
Awesome Intellij Idea
用爬虫在全网范围内检索 Intellij IDEA 的优秀文章,聚合在此。平台包括 「CSDN」「掘金」「简书」「知乎」「SegmentFault」「博客园」「开源中国」「慕课手记」,相信无论你对 Intellij IDEA 目前了解到什么程度,这个项目都能帮到你。
Stars: ✭ 2,704 (+7411.11%)
Mutual labels:  plugins
Webpack
A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Stars: ✭ 60,034 (+166661.11%)
Mutual labels:  plugins
Unified
☔️ interface for parsing, inspecting, transforming, and serializing content through syntax trees
Stars: ✭ 3,036 (+8333.33%)
Mutual labels:  plugins
Store.js
Cross-browser storage for all use cases, used across the web.
Stars: ✭ 13,656 (+37833.33%)
Mutual labels:  plugins
Numi
Beautiful calculator app for macOS
Stars: ✭ 3,258 (+8950%)
Mutual labels:  plugins
Wp User Frontend
A WordPress plugin that brings many backend functionality to the site frontend
Stars: ✭ 195 (+441.67%)
Mutual labels:  plugins
Griddle
Simple Grid Component written in React
Stars: ✭ 2,494 (+6827.78%)
Mutual labels:  plugins
Proxenet
The ONLY hacker friendly proxy for webapp pentests.
Stars: ✭ 193 (+436.11%)
Mutual labels:  plugins
Popsicle
Simple HTTP requests for node and the browser
Stars: ✭ 238 (+561.11%)
Mutual labels:  plugins
Tslint Language Service
TypeScript 2.2.1 plugin for tslint
Stars: ✭ 190 (+427.78%)
Mutual labels:  plugins
Alfred Pwgen
Generate passwords with Alfred
Stars: ✭ 201 (+458.33%)
Mutual labels:  plugins
Lb6 Actions
A litter of LaunchBar 6 actions
Stars: ✭ 210 (+483.33%)
Mutual labels:  plugins
RubyGateway
Embed Ruby in Swift: load Gems, run scripts, call APIs seamlessly in both directions.
Stars: ✭ 108 (+200%)
Mutual labels:  bindings
H5 Editor
📕h5可视化编辑器,支持添加图片/文本/形状等,拥有图层/参考线/标尺/自动吸附对齐等功能
Stars: ✭ 224 (+522.22%)
Mutual labels:  plugins

Docs Crates

samp-rs

samp-rs is a tool to develop plugins for samp servers written in rust.

documentation

it's here! need to find a way to fix docs.rs ...

project structure

  • samp is a glue between crates described below (that's what you need).
  • samp-codegen generates raw extern "C" functions and does whole nasty job.
  • samp-sdk contains all types to work with amx.

usage

  • install rust compiler (supports only i686 os versions because of samp server arch).
  • add in your Cargo.toml this:
[lib]
crate-type = ["cdylib"] # or dylib

[dependencies]
samp = "0.1.2"
  • write your first plugin

migration from old versions

examples

  • simple memcache plugin in plugin-example folder.
  • your lib.rs file
use samp::prelude::*; // export most useful types
use samp::{native, initialize_plugin}; // codegen macros

struct Plugin;

impl SampPlugin for Plugin {
    // this function executed when samp server loads your plugin
    fn on_load(&mut self) {
        println!("Plugin is loaded.");
    }
}

impl Plugin {
    #[native(name = "TestNative")]
    fn my_native(&mut self, _amx: &Amx, text: AmxString) -> AmxResult<bool> {
        let text = text.to_string(); // convert amx string into rust string
        println!("rust plugin: {}", text);

        Ok(true)
    }
}

initialize_plugin!(
    natives: [Plugin::my_native],
    {
        let plugin = Plugin; // create a plugin object
        return plugin; // return the plugin into runtime
    }
)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].