OnRconLoginAttempt
Description:
Callback OnRconLoginAttempt is called when someone attempts to log in to RCON in-game; successful or not.
Callback OnRconLoginAttempt was added in 0.3a and will not work in earlier versions! |
|
Parameters:
(ip[], password[], success)
string | ip | The IP of the player that tried to log in to RCON. |
string | password | The password used to login with. |
bool | success | 0 if the password was incorrect or 1 if it was correct. |
Return Values:
This callback does not handle returns.
- It is always called first in filterscripts.
Examples:
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 pip[16]; for(new i = GetPlayerPoolSize(); i != -1; --i) //Loop through all players { GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login { SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message Kick(i); //They are now kicked. } } } return 1; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnRconCommand: Called when an RCON command is sent.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- IsPlayerAdmin: Checks if a player is logged into RCON.
- SendRconCommand: Sends an RCON command via the script.