ReSA MultiplayerDownload
For server owners

Know who plays with ReSA

Add one include to your SA-MP or open.mp server and your script knows which players play with ReSA, and with which app: ReSA's own app or a community's own branded app.

Download resa.incOne Pawn include, no plugin. It works in a gamemode or a filterscript.

How it works

  • While a player is on a server, their ReSA app tells resa-mp.com which server that is and the player's nickname. That is how ReSA players see each other's badge on the scoreboard.
  • When a player joins your server, the include asks resa-mp.com whether that nickname plays with ReSA there. Nothing changes in how the game talks to your server.
  • The answer comes a few seconds after the player joins. OnPlayerResaCheck is then called once, and IsPlayerUsingAlynReSA gives the answer from then on.

Install it

  1. 1Put resa.inc in your include folder (qawno/include or pawno/include).
  2. 2Include it after <open.mp> or <a_samp>.
  3. 3Compile. The include hooks OnPlayerConnect and OnPlayerDisconnect itself, so your own callbacks stay as they are.
#include <open.mp>
#include <resa>

Functions

  • IsPlayerUsingAlynReSA(playerid)true once resa-mp.com said the player plays with ReSA, with any ReSA app.
  • IsPlayerResaChecked(playerid)true once the answer is final, yes or no.
  • GetPlayerResaApp(playerid, app[], size = sizeof app)Copies the player's app into app[]: "resa" for ReSA's own app, the community's short name for a community's own app, and "" when the player is not on ReSA.
  • public OnPlayerResaCheck(playerid, bool:usingResa, const app[])Called once for every player who joins, as soon as the answer is final.
  • IsPlayerUsingOwnApp(playerid)Community copy only: true when the player plays with that community's own app.
  • IsPlayerUsing<Name>(playerid)Community copy only: the same, named after the community, for example IsPlayerUsingLunarRP.

Until the answer is final, IsPlayerUsingAlynReSA is false. The include asks 1.5 seconds after a player joins and, while the answer is not yes, again after 2.5, 4, 7 and 15 seconds. NPCs are not checked.

Copy-paste examples

Welcome ReSA players
#include <open.mp>
#include <resa>

public OnPlayerResaCheck(playerid, bool:usingResa, const app[])
{
    if (usingResa)
    {
        SendClientMessage(playerid, 0x33CCFFFF, "Welcome! You are playing with ReSA.");
    }
    return 1;
}
Let only your own app in

Needs your community's own copy of the include. The message goes first and the kick half a second later, so the player can read why.

#include <open.mp>
#include <resa_yourcommunity>

forward KickLater(playerid);
public KickLater(playerid)
{
    Kick(playerid);
    return 1;
}

public OnPlayerResaCheck(playerid, bool:usingResa, const app[])
{
    if (!IsPlayerUsingOwnApp(playerid))
    {
        SendClientMessage(playerid, 0xFF6347FF, "This server only lets in players who use our own app.");
        SetTimerEx("KickLater", 500, false, "i", playerid);
    }
    return 1;
}

open.mp and SA-MP 0.3.7

  • On open.mp the include asks https://resa-mp.com.
  • SA-MP 0.3.7 can only make plain http requests, so there the include asks http://resa-mp.com.

It is the same file for both: it picks the right address when you compile.

Options

Define them before the include.

  • #define RESA_SERVER_IP "1.2.3.4"Your server's public IP address, the one players join. With it resa-mp.com answers for your server exactly. Set it when your server lets only its own app in, and when the machine connects out to the internet from another address than the one players join.
  • #define RESA_CHECK_NPCSCheck NPCs too.

What is sent

Your server's port, the player's nickname, and RESA_SERVER_IP when you set it. Nothing else. The answer is what every ReSA player on your server already sees as the scoreboard badge, plus which app.

What players share, and for how long: Privacy policy

Only your own app

Does your community have its own branded app? Its own copy of the include adds IsPlayerUsingOwnApp and a function named after your community. Download it from your community's Branded app tab in Studio.

Open Studio