hide the password
#5

this is my dialog

The GM:
Quote:

// This callback gets called when a player interacts with a dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// Select the proper dialog to process
switch (dialogid)
{
case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog

The include dialog:
Quote:

Dialog_Register(playerid, response, inputtext[])
{
new file[100], Name[MAX_PLAYER_NAME]; // Setup local variables
GetPlayerName(playerid, Name, sizeof(Name)); // Get the playername
format(file, sizeof(file), PlayerFile, Name); // Construct the complete filename for this player's account

switch (response) // Check which button was clicked
{
case 1: // Player clicked "Register"
{
// Check if the player entered a password
if(strlen(inputtext)>0)
{
// Store the password
format(APlayerData[playerid][PlayerPassword], 50, "%s", inputtext);

// Create the file and save default data to it, then reload it (so all data is put into the correct place)
PlayerFile_Create(playerid);
PlayerFile_Load(playerid);

// Send a message to the client to inform him that his account has been registered
SendClientMessage(playerid, 0xFFFFFFFF, TXT_AccountRegistered);
APlayerData[playerid][LoggedIn] = true; // The player has logged in properly
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
Kick(playerid);
}
}
case 0: // Player clicked "Cancel"
{
// Show a message that the player must be registered to play on this server
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerMustRegister);
// Kick the player
Kick(playerid);
}
}

return 1;
}

Reply


Messages In This Thread
hide the password - by $mooth - 23.07.2012, 14:20
Re: hide the password - by Matz - 23.07.2012, 14:25
Re: hide the password - by LaGrande - 23.07.2012, 14:27
Re: hide the password - by $mooth - 23.07.2012, 14:28
Re: hide the password - by $mooth - 23.07.2012, 14:34
Re: hide the password - by Rudy_ - 23.07.2012, 14:57
Re: hide the password - by nickdodd25 - 23.07.2012, 15:12
Re: hide the password - by TheArcher - 23.07.2012, 15:42
Re: hide the password - by Pinguinn - 23.07.2012, 15:46

Forum Jump:


Users browsing this thread: 1 Guest(s)