Skip to content
Nexius edited this page Aug 14, 2021 · 8 revisions

RconCommand (packetid: 201)

Destination:
Incoming/Outgoing

Description:
Called when a command is sent via the in-game "/rcon command".

Parameters (for incoming packet):

Value type Parameter Short description
PR_UINT8 packetId The ID of the packet
PR_STRING32 command A string containing the command that was typed, as well as any passed parameters

Related SA-MP callbacks:

  • OnRconCommand (if it's in-game command) or OnRconLoginAttempt (when the player is not logged in as RCON admin and typed '/rcon login')

Example (as incoming packet):

const RCON_COMMAND_SYNC = 201;

IPacket:RCON_COMMAND_SYNC(playerid, BitStream:bs)
{
    new rconCommand[PR_RconCommand];

    BS_IgnoreBits(bs, 8);
    BS_ReadRconCommand(bs, rconCommand);

    //Anything you want to see here

    return 1;
}