dialog login
#8

pawn Код:
new tryhard[MAX_PLAYERS];
// Process the login-dialog
Dialog_Login(playerid, response, inputtext[])
{
switch (response) // Check which button was clicked
{
   case 1: // Player clicked "Login"
{
// Check if the player entered a password
if (strlen(inputtext) > 0)
{
// Check if the entered password is the same as the password saved in the player's account
   if (strcmp(APlayerData[playerid][PlayerPassword], inputtext, false) == 0)
{
APlayerData[playerid][LoggedIn] = true; // The player has logged in properly
                  BankFile_Load(playerid); // Load your bank account (if it exists, the player will be notified about this)
SendClientMessage(playerid, 0xFFFFFFFF, TXT_LoggedIn); // Send a message to the client to inform him that he logged in properly
}
else
{
tryhard[playerid]++;
SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
if (tryhard[playerid] == 3) return tryhard(playerid) = 0, Kick(playerid);
}
}
else
{
tryhard[playerid]++;
SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
if (tryhard[playerid] == 3) return tryhard(playerid) = 0, Kick(playerid);
}
}
   case 0: // Player clicked "Cancel"
{
// Show a message that the player must be logged in to play on this server
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerMustLogin);
   // Kick the player
Kick(playerid);
}
}
return 1;
}
Reply


Messages In This Thread
dialog login - by RoJoK3R - 28.08.2013, 14:10
Re: dialog login - by Lorrden - 28.08.2013, 14:34
Re: dialog login - by RoJoK3R - 28.08.2013, 15:04
Re: dialog login - by IceBilizard - 28.08.2013, 15:40
Re: dialog login - by RoJoK3R - 28.08.2013, 16:17
Re: dialog login - by RedJohn - 28.08.2013, 16:28
Re: dialog login - by RoJoK3R - 28.08.2013, 19:06
Re: dialog login - by ProjectMan - 28.08.2013, 19:11
Re: dialog login - by RoJoK3R - 29.08.2013, 12:39
Re: dialog login - by DanishHaq - 29.08.2013, 12:44

Forum Jump:


Users browsing this thread: 1 Guest(s)