samp.directory
← Scripts y librerías

kavnnn/SA-Mobile-Component

A lightweight include for SA:MP / open.mp servers to detect and read data from players using the SA Mobile client.

Filterscript★ 4actualizado ago 2026MITPawn
Abrir en GitHub

README.md

SA Mobile Integration

A lightweight include for SA:MP / open.mp servers to detect and read data from players using the SA Mobile client.

This include communicates with the SA Mobile Integration filterscript via CallRemoteFunction. No source code is shared, only the compiled filterscript (samobile.amx) and this include (samobile.inc) are required.


Requirements

  • The samobile.amx filterscript must be loaded on your server (via server.cfg / config.json).
  • If the filterscript is not loaded, all functions safely return 0 / false — no errors, no problem at all.

Installation

  1. Place samobile.inc in your server's pawno/include (or qawno/include) folder.
  2. Place samobile.amx in your server's filterscripts folder.
  3. Add samobile to your filterscripts line in server.cfg, or your filterscripts array in config.json.
  4. In your gamemode or filterscript:
#include <samobile>

Functions

FunctionReturn TypeDescription
SAMobile_GetVersion(playerid)intClient version (e.g. 12 = v1.2). Returns 0 if unavailable.
SAMobile_GetNetworkVersion(playerid)E_SAMOBILE_NETWORKNetwork version. See enum below.
SAMobile_GetNetworkVersionName(playerid, dest[], size)-Writes the network version as a readable string into dest.
SAMobile_HasMonetLoader(playerid)booltrue if MonetLoader is enabled.
SAMobile_HasAML(playerid)booltrue if AML (Android Mod Loader) is enabled.
SAMobile_HasCleo(playerid)booltrue if CLEO is enabled.

E_SAMOBILE_NETWORK enum

enum E_SAMOBILE_NETWORK
{
	SAMOBILE_NETWORK_UNKNOWN,
	SAMOBILE_NETWORK_LEGACY,   // 0.3.7
	SAMOBILE_NETWORK_ADVANCE   // 0.3.DL
}

Example

#include <samobile>

public OnPlayerSpawn(playerid)
{
	new version = SAMobile_GetVersion(playerid);

	if (version > 0)
	{
		new major = version / 10;
		new minor = version % 10;

		new szNetVer[16];
		SAMobile_GetNetworkVersionName(playerid, szNetVer);

		new szMsg[128];
		format(szMsg, sizeof(szMsg), "Detected client v%d.%d (Network: %s)", major, minor, szNetVer);
		SendClientMessage(playerid, -1, szMsg);

		if (SAMobile_HasCleo(playerid))
		{
			SendClientMessage(playerid, 0xFF0000FF, "Warning: CLEO detected.");
		}

		if (SAMobile_HasMonetLoader(playerid))
		{
			SendClientMessage(playerid, 0xFF0000FF, "Warning: MonetLoader detected.");
		}

        if (SAMobile_HasAML(playerid))
		{
			SendClientMessage(playerid, 0xFF0000FF, "Warning: AML detected.");
		}
	}
	else
	{
		SendClientMessage(playerid, -1, "Player is not using SA Mobile, or data isn't available yet.");
	}
	return 1;
}

Notes

  • Detection happens automatically when a player connects (OnPlayerConnect in the filterscript). Data may take a moment to arrive after connecting, a version of 0 simply means it isn't available (yet, or at all).
  • These functions work regardless of whether the calling script is the gamemode or another filterscript, as long as samobile.amx is loaded somewhere on the server.

Esta página se genera con lo que GitHub publica sobre el repositorio. samp.directory no aloja el código. Informar de un problema con esta ficha

kavnnn/SA-Mobile-Component: Filterscript de SA-MP | samp.directory