SA-MP and open.mp
The FluteSampConnect filterscript for SA-MP and open.mp: install with pawn-requests, link to the site, players by nickname, bans, reports, the menu and the gamemode integration.
Your SA-MP or open.mp server is integrated with the site through the GameLink filterscript, which keeps the server and the site in sync. The site sees who is online, bans by nickname, takes reports and shows its menu in dialogs. Money, VIP and items are handed out by your gamemode; the filterscript passes the site's commands on to it.
| Platform | Archive | Setup command | Site module |
|---|---|---|---|
| SA-MP / open.mp | flute-samp-filterscript-<VERSION>.zip | flute_setup <site url> <token> | SampKit |
Releases are on GitHub. The server page in the admin also offers the latest build with a "Download" button.
What you get
The filterscript tells the site who is online with ping, score, kills and time on the server, plus the host name, version, map and tick rate. The site answers with commands: kick, message, ban, block chat, and everything else goes to the gamemode. Each command runs at most once, even after a restart.
| In the game | What the site needs |
|---|---|
| players by nickname, linking, sign-in link, balance, menu, online players | the SampKit module |
| bans and chat blocks | the Sentinel module |
| player statistics | the Stats module, though it does not count nicknames yet, see below |
/report reports | the Reports module |
| online players on the monitoring page | the Monitoring module |
| groups, money, items | actions your gamemode declares, and a module that sends them (GiveCore, Rewards rewards) |
Without SampKit the site does not know SA-MP players: SA-MP has no Steam, so the site knows a player by nickname.
Requirements
SA-MP 0.3.7 or 0.3.DL, or open.mp; CR:MP servers work too. You need the pawn-requests 0.11.1 plugin: the Linux build is in the release archive, on Windows take the stock requests.dll. The filterscript has been tested on open.mp 1.6.7 on Linux.
Install
Unpack the archive into the server folder. It holds:
filterscripts/
├── flute_link.amx
└── flute_link.pwn
include/
└── flute_link.inc for the gamemode integration
plugins/
├── requests.so
└── requests-LICENSE.txt
src/flute/ sourcesUse the requests.so from the archive, not the one from the pawn-requests release. The stock file brings the server down on the first failed request (site down, certificate refused); the archive's copy logs the error and retries.
Load the plugin and the filterscript:
plugins requests.so
filterscripts flute_linkOn Windows plugins takes requests.
On the first start the filterscript writes scriptfiles/flute_link.ini with every key and a comment, and prints [Flute] Not connected to a site yet: flute_setup <site url> <server token> in the server console.
Link to the site
Issue a token
Open AdminServers, then your server and its "Plugins" tab. Click "Issue token" and copy the command from the window. The step is covered in detail in connecting a server.
Run the command in the server console
flute_setup https://<YOUR_DOMAIN> <SERVER_TOKEN>Type it in the server console or over remote RCON. While a player in the game is logged in as an RCON admin, the filterscript refuses it: the server does not tell a script where a command came from.
Pick the player check
Open "For power users: security, command queue, in-game menu" and, under "Security", set "Player authentication". If the gamemode asks for a password on join and tells the filterscript about the login, pick "Offline with a password login". Otherwise pick "Offline". In the default "Licensed" mode the site refuses nicknames.

Check the link
The console shows [Flute] Connected to https://<YOUR_DOMAIN> (server #N). and the "Plugins" tab shows "Connected". flute_status shows the address, the last sync, the last error, the realm and the actions the gamemode declared at any time.
The address and token are saved to scriptfiles/flute_link.ini. The token is never printed, but the console log keeps the command you typed. If other people read that log, write url and token into the file and run reloadfs flute_link.
The server sent players its player check turns away
The admin shows this line on the "Plugins" tab while the player check is set to "Licensed". The site does not see those players, and purchases do not reach them. Pick "Offline" or "Offline with a password login" under "Security".
Players and nicknames
The site knows a player as <realm>:<nickname> in lower case, for example main:john_smith. The realm is set in the config and is main by default. Servers sharing one account base use the same realm; servers with separate bases use different ones, and the same nickname on them counts as two players.
A nickname is 3 to 24 characters of letters, digits and [ ] _ $ = ( ) @ .. With any other nickname the player sees "The site does not accept this nickname, so site features are off for you." A player who renames on the server is a new player for the site.
The server cannot prove a nickname belongs to a person. So in "Offline" mode a player can link the nickname but cannot sign in to the site from the game or pay with the balance. To open everything, the gamemode must check a password and report the login with FluteLink_PlayerLoggedIn, and the site must be set to "Offline with a password login".
The player gets a code on the site in "Profile → Settings → Linked accounts", with the "Get code" button, types /link CODE in game and confirms the link on the site.
What each feature does
Bans and chat blocks
Needs the Sentinel module. A ban or chat block from the site goes into the filterscript's own list by nickname, with a duration. The ban is checked on join, and the player sees "You are banned on this server until … Reason: …". If your admin system bans and mutes on the server, the gamemode reports that to the site with FluteLink_ReportSanction. There is no voice mute unless the gamemode declares one (with SampVoice, for example).
Statistics
The Stats module counts SA-MP events when the player check is "Offline with a password login": Stats takes a nickname confirmed by a password as the player's account. In "Offline" mode the /stats table stays empty for the server, even though the filterscript sends the events. Deaths go to the site right away, and once a minute a player.stats event follows: shots, hits, damage to players, suicides, team kills (same SetPlayerTeam team) and NPCs killed. Shots and hits come from OnPlayerWeaponShot, which needs lag compensation. While the site is down the counters wait in memory. The killer and weapon are reported by the victim's client, so a modified client can name anyone.
Reports
Needs the Reports module. /report opens a list of players, then the reasons. /report name or /report id jumps straight to the reasons. The site gets the target's kills, deaths and score and up to 10 of their chat lines from the last 5 minutes. One report on the same player per 5 minutes, at most three per 10 minutes from one nickname.
In-game menu
/site opens the site menu in dialogs, /sitesettings its settings. The menu is built in AdminServersIn-game menu (In-game menu). In SA-MP it is text in dialogs: no images, descriptions, QR codes or text input. Text is converted to the server's code page, ₽ becomes RUB and emoji are dropped. The game cannot open a link, so it arrives in chat and in a dialog.
Money, VIP and items
The filterscript delivers nothing itself: it passes the action to the gamemode. The gamemode declares what it can do, economy.deposit and group.add for example, and runs them in FluteLink_OnAction. The site sees that list and sells only what the server will deliver. On the site money is the "Server credits" reward, and a group is the "Server group by name" reward or a GiveCore privilege. Any console command can go out as the "Server command" reward when the config has allow_raw = 1.
Gamemode integration
Include include/flute_link.inc in the gamemode. The calls go through CallRemoteFunction, so the gamemode runs the same without the filterscript loaded.
#include <flute_link>
public FluteLink_OnReady()
{
FluteLink_UseLogin();
FluteLink_DeclareAction("economy.deposit");
return 1;
}
// after the password check
FluteLink_PlayerLoggedIn(playerid);
public FluteLink_OnAction(commandid, playerid, const action[], const nick[], const args[])
{
if (!strcmp(action, "economy.deposit"))
{
new cents = FluteLink_ArgCents(args, "amount");
if (cents <= 0) return FLUTE_INVALID;
// add cents / 100 to the account of nick
return FLUTE_DONE;
}
return FLUTE_UNSUPPORTED;
}playerid is INVALID_PLAYER_ID when the player is offline. Give everything in one call: a command that failed halfway is delivered again. A repeat of a command that already ran is answered by the filterscript and never reaches the gamemode.
| Function | What it does |
|---|---|
FluteLink_UseLogin() | a player reaches the site only after FluteLink_PlayerLoggedIn |
FluteLink_PlayerLoggedIn(playerid), FluteLink_PlayerLoggedOut(playerid) | login and logout in the gamemode's account |
FluteLink_DeclareAction(name) | an action the gamemode runs. Call it in FluteLink_OnReady |
FluteLink_OnAction(...) | return FLUTE_DONE, FLUTE_FAILED, FLUTE_INVALID, FLUTE_UNSUPPORTED, FLUTE_DEFER_OFFLINE, FLUTE_DEFER_DEAD, FLUTE_DEFER_FULL or FLUTE_PENDING |
FluteLink_Complete(commandid, status, reason[]) | the outcome of a pending action, within 4 minutes |
FluteLink_ReportSanction(...) | a ban, mute or chat block your admin system issued or lifted |
FluteLink_SendEvent(playerid, type, data) | your own event for site modules; data is a JSON object |
FluteLink_ArgString, FluteLink_ArgInt, FluteLink_ArgBool, FluteLink_ArgCents | read arguments. ArgCents turns "12.50" into 1250 without floats |
Commands and permissions
| Command | Who | What it does |
|---|---|---|
flute_setup <url> <token> | server console, remote RCON | saves the address and token and connects |
flute_status | server console, RCON | link state, queue, gamemode actions |
reloadfs flute_link | server console, RCON | rereads flute_link.ini |
/link CODE | player | links the nickname to the site account |
/sitelogin | player | one-time sign-in link |
/sitebalance | player | site balance |
/site, /sitesettings | player | site menu and its settings |
/report [name or id] | player | reports a player |
The commands carry a site prefix because a filterscript sees commands before the gamemode, and many gamemodes already have their own /login, /balance and /menu. /report is taken over: if the gamemode has its own, rename cmd_report or leave it empty.
Config
scriptfiles/flute_link.ini; run reloadfs flute_link after editing. Values go without quotes.
url = https://<YOUR_DOMAIN>
token = <SERVER_TOKEN>
realm = main
language = en
codepage = 1252| Key | Default | What it changes |
|---|---|---|
url, token | empty | site address (a sub-folder works) and the token |
allow_http | 0 | allow an http:// address, only for a site on the same machine |
realm | main | nickname name space on the site, a-z 0-9 _ -, up to 32 characters |
language | en | player messages: en, ru, uk |
codepage | 1251 | client code page: 1251 (Cyrillic) or 1252 (Western European) |
allow_raw | 0 | allow console commands from the site |
raw_blacklist | rcon_password, password, rcon, exit, gmx, changemode, loadfs, unloadfs, reloadfs, loadplugin, exec, flute_setup | first words the site may never run. Some of them, plus bind, alias and flute_*, are always refused |
report_deaths, report_stats | 1 | send deaths and player.stats |
cmd_link, cmd_login, cmd_balance, cmd_menu, cmd_settings | link, sitelogin, sitebalance, site, sitesettings | commands without the /; an empty value switches one off |
cmd_report | report | the report command; empty switches reports off |
report_reasons | cheat, abuse, grief, other | comma-separated reasons, optionally with a label: rp:Breaking RP rules. Up to 12 |
report_same_target_seconds | 300 | pause between reports on the same player |
report_max, report_window_seconds | 3, 600 | reports from one nickname per window |
report_chat_lines | 10 | how many of the target's chat lines go with a report, 0–10 |
dialog_id | 32700 | dialog id of the menu; change it if the gamemode uses it |
chat_prefix | empty | message prefix; empty takes [Site] in the player's language |
platform_software | empty | what the site shows as the server software. Set CR:MP on a CR:MP server |
State (commands run in the last day, unsent events, the ban and block lists) lives in scriptfiles/flute_link.db.
Troubleshooting
For any other message, use the error lookup.
flute_setup refused: an RCON admin is logged in in the game
Someone in the game is logged in as an RCON admin. Run the command in the server console while nobody like that is in, or write the address and token into flute_link.ini and run reloadfs flute_link.
| Console message | What to do |
|---|---|
The token must start with flute_srv_ | copy the token again from the window on the "Plugins" tab |
The site address must start with https:// | the address has no scheme or is in quotes. Write https://… without quotes |
http:// is refused | use an https:// address. For a site on the same machine set allow_http = 1 |
The site rejected the key | the token was reset or revoked. Issue a new one and run flute_setup again |
Sync failed: … | the reason follows the colon. For invalid_signature check the server clock (NTP) |
realm "…" is not a-z 0-9 _ - (1-32 chars) | fix realm; the filterscript kept the old one |
dialog_id must be 1-32767 | set dialog_id within that range |
pawn-requests refused the site address. | check url, and on Linux that the requests.so from the archive is loaded |
If a purchase did not reach the player, open AdminServersSent to servers (Sent to servers). On SA-MP "The server plugin cannot do this. Update the plugin" usually means the gamemode has not declared that action. While the filterscript is connected the site does not send such a command at all, so it never shows up there: check the Actions from the gamemode line of flute_status.
| Action | On the server |
|---|---|
raw | a console command when allow_raw = 1. The first word of every part is checked against raw_blacklist |
player.kick | kick with the reason in chat |
message.player, message.broadcast | chat message |
message.title, notify.player | on-screen text; notify.player also writes it to chat |
ban.apply, ban.lift | its own ban list by nickname, with a duration |
comms.gag, comms.unblock | its own chat block by nickname |
menu.refresh | drops the cached menu |
group.add, economy.deposit, samp.* and others | only when the gamemode declares them |
If the gamemode declares a built-in name such as ban.apply, the gamemode runs that action.
The token never travels over the network. A request carries an X-Flute-Key header with the key id, a fresh nonce and an HMAC-SHA256 signature, and the site signs its answer. The filterscript runs nothing from an answer without a valid signature and tries again later. After a 429 it waits a minute, after a 5xx from 5 seconds up to 2 minutes.