警告
回调是在SA-MP 0.3a中添加的,在早期版本中不起作用!

描述

当有人尝试在游戏中登录 RCON 时会调用此回调;成功与否。
姓名 描述
ip[] 尝试登录RCON的玩家的IP。
password[] 用于登录的密码。
success 如果密码不正确则为 0,如果正确则为 1。

返回

它总是在过滤器脚本中首先被调用。

例子

  1. public OnRconLoginAttempt(ip[], password[], success)
  2. {
  3. if (!success) //If the password was incorrect
  4. {
  5. printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
  6. new pip[16];
  7. for(new i = GetPlayerPoolSize(); i != -1; --i) //Loop through all players
  8. {
  9. GetPlayerIp(i, pip, sizeof(pip));
  10. if (!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
  11. {
  12. SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
  13. Kick(i); //They are now kicked.
  14. }
  15. }
  16. }
  17. return 1;
  18. }

笔记

提示
仅当游戏中使用 /rcon 登录时才会调用此回调。仅当玩家尚未登录时才会调用此回调。当玩家登录时,则会调用 OnRconCommand。