Quick start
Plugin API 1.0 uses Lua 5.4.8. You only need a UTF-8 text editor, a ZIP tool that creates portable / entry names, and SA-MP Android for testing.
Create the files
Create an empty directory with these two files:
text
hello-plugin/
├─ manifest.json
└─ main.luamanifest.json:
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"
}
}main.lua:
lua
samp.log.info("loaded " .. samp.plugin.id)
samp.events.on("player.spawned", function(event)
samp.log.info(
"spawned in session " ..
samp.format.number(event.sessionId, 0)
)
end)Package the plugin
Archive the contents of hello-plugin, not the directory itself. Rename the resulting ZIP archive to hello-plugin.splug. Opening the archive must show manifest.json directly at its root.
TIP
You can also use the official Plugin Tools CLI. Run samp-plugin pack hello-plugin to validate and package your plugin automatically. The repository also contains example plugins for reference.
Install and test
- Open Resources → Plugins → Import.
- Select
hello-plugin.splug. - Review the plugin details and enable it.
- Start or join a multiplayer session.
- Check the plugin status or game log for the
loadedmessage.
Every change to an already installed package must use a new plugin version. The same ID and version cannot be replaced with different contents.
Next steps
- Learn the project structure.
- Add the exact permissions your plugin needs.
- Subscribe to events.
- Read the packaging checklist.