Skip to content

插件 Manifest

.splug 根目录必须包含 manifest.json

字段必需说明
schemaVersion1.0 使用包格式 1
id稳定的反向域名 ID,例如 com.example.speedometer
name用户可见名称。
version数字语义版本,例如 1.0.0
apiVersion精确 1.0 或兼容范围 ^1.0
entry指向 .lua 的安全相对路径。
description用户可见说明。
activationModeimmediaterestart-required,后者为默认值。
permissions去重后的公开权限名。
contextssingleplayermultiplayer,省略表示两者都支持。
author包含作者 name 的对象。

插件 ID 一旦发布就不应改变;改变 ID 会产生独立的插件、权限、版本与存储空间。

"1.0" 只接受 API 1.0;"^1.0" 接受当前主版本内不低于要求的次版本。可选能力应使用 samp.api.has() 查询。

json
{
  "schemaVersion": 1,
  "id": "com.example.hello",
  "name": "Hello Plugin",
  "version": "1.0.0",
  "apiVersion": "^1.0",
  "entry": "main.lua",
  "description": "A minimal SA-MP Android plugin.",
  "activationMode": "immediate",
  "permissions": [],
  "contexts": ["multiplayer"],
  "author": {
    "name": "Your Name"
  }
}