警告
此回调是在SA-MP 0.3a中添加的,在早期版本中不起作用!
描述
当有人尝试在游戏中登录 RCON 时会调用此回调;成功与否。
| 姓名 |
描述 |
| ip[] |
尝试登录RCON的玩家的IP。 |
| password[] |
用于登录的密码。 |
| success |
如果密码不正确则为 0,如果正确则为 1。 |
返回
它总是在过滤器脚本中首先被调用。
例子
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;}
笔记
提示
仅当游戏中使用 /rcon 登录时才会调用此回调。仅当玩家尚未登录时才会调用此回调。当玩家登录时,则会调用 OnRconCommand。