SA-MP MOBİLE LOGİN KİCK BAN SERVER OWNER

Started by Matite, Jun 30, 2024, 12:42 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Matite



#include <a_samp>

native SendClientCheck(playerid, type, arg, offset, size);
forward OnClientCheckResponse(playerid, type, arg, response);

#pragma warning disable 239

#define IsPlayerAndroid(%0)                 GetPVarInt(%0, "NotAndroid") == 0

public OnFilterScriptInit()
{
    print("Android check has been successfully loaded.");
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Android check filterscript unloaded");
    print("--------------------------------------\n");
}

public OnPlayerConnect(playerid)
{

    SendClientCheck(playerid, 0x48, 0, 0, 2);
    return 1;
}

public OnClientCheckResponse(playerid, type, arg, response)
{
    switch(type)
    {       
        case 0x48:
        {
            SetPVarInt(playerid, "NotAndroid", 1);
        }
    }
    return 1;
}

// SendClientCheck example script by evgen1137
// thanks to MTA devs for structs

IsPlayerAndroid
Check if a player is using android

Installation
Load the filterscript
Put the define in your gamemode to make it easier
#define IsPlayerAndroid(%0)                 GetPVarInt(%0, "NotAndroid") == 0Usage
public OnPlayerSpawn( playerid )
{
 if ( IsPlayerAndroid(playerid) )
  SendClientMessage(playerid, "You're connected from android");
 return 1;
}
Note
You may use it in another callback, but not OnPlayerConnect! SendClientCheck and OnClientCheckResponse only works with filterscript, please see Zeex/sampgdk#124