Перейти к содержанию

LoginPlayer

Материал из RAGE MP Wiki Archive
Версия от 18:16, 28 ноября 2019; imported>Xabi
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Logs a player into ACL.


LoginResult NAPI.ACL.LoginPlayer(Client player, string password);

Parameters

  • player: parameter input should be in Client type
  • password: parameter input should be in string type


Example

<syntaxhighlight lang="csharp"> [Command(ACLRequired = true, SensitiveInfo = true)] public void AdminLogin(Client client, string password) {

   string reason;
   var result = NAPI.ACL.LoginPlayer(client, password);
   switch (result)
   {
       case LoginResult.NoAccountFound:
           reason = "~r~ERROR: No account found.";
           break;
       case LoginResult.LoginSuccessfulNoPassword:
       case LoginResult.LoginSuccessful:
           reason = "~g~SUCCESS: You have successfully logged in.";
           break;
       case LoginResult.WrongPassword:
           reason = "~r~ERROR: Wrong password.";
           break;
       case LoginResult.AlreadyLoggedIn:
           reason = "~r~ERROR: You're already logged in.";
           break;
       case LoginResult.ACLDisabled:
           reason = "~r~ERROR: ACL is disabled.";
           break;
   }
   client.SendChatMessage(reason);

} </syntaxhighlight>