---
title: "OnRconLoginAttempt | open.mp"
description: "This callback is called when someone attempts to log in to RCON in-game, regardless of whether this attempt is successful or not."
canonical: https://omp.itsneufox.com/hu/docs/scripting/callbacks/OnRconLoginAttempt
language: hu
---

# OnRconLoginAttempt

## Description

This callback is called when someone attempts to log in to RCON in-game, regardless of whether this attempt is successful or not.

| Name | Description |
| --- | --- |
| ip\[\] | The IP address of the player who attempted to log in to RCON. |
| password\[\] | The password used in the login attempt. |
| success | 0 if the password was incorrect, or 1 if it was correct. |

## Returns

This callback is always called first in filterscripts.

## Examples

```c
public OnRconLoginAttempt(ip[], password[], success)
{
    if (!success) // If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s", ip, password);

        new ipAddress[16];

        for (new i = 0; i < MAX_PLAYERS; i++) // Loop through all players
        {
            if (!IsPlayerConnected(i))
            {
                continue;
            }

            GetPlayerIp(i, ipAddress, sizeof(ipAddress));

            if (!strcmp(ip, ipAddress, true)) // If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); // Send a message
                Kick(i); // Kick the player
                break;
            }
        }
    }
    return 1;
}
```

## Notes

megjegyzés

-   This callback is only called when /rcon login is used in-game.
-   This callback is only called when the player is not yet logged in. When the player is logged in, [OnRconCommand](https://omp.itsneufox.com/hu/docs/scripting/callbacks/OnRconCommand) is called instead.

## Related Callbacks

The following callbacks might be useful, as they're related to this callback in one way or another.

-   [OnRconCommand](https://omp.itsneufox.com/hu/docs/scripting/callbacks/OnRconCommand): This callback is called when an RCON command is sent.

## Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

-   [IsPlayerAdmin](https://omp.itsneufox.com/hu/docs/scripting/functions/IsPlayerAdmin): Checks if a player is logged into RCON.
-   [SetPlayerAdmin](https://omp.itsneufox.com/hu/docs/scripting/functions/SetPlayerAdmin): Sets the player as an RCON admin.
-   [SendRconCommand](https://omp.itsneufox.com/hu/docs/scripting/functions/SendRconCommand): Sends an RCON command via the script.
