Код:
switch(dialogid)
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FFC800}Toxic{00FF00}Freeroam","{FF4600}Написахте невалидна парола!.\n{00C3FF}Напишете паролата с която искате да се регистрирате.","Регистрация","Отказ");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
SpawnPlayer(playerid);
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "You register account with the name: %s, password: %s", pName, inputtext);
}
}
In this case your inputtext is the password you typed in while registering.
As for the date, you can get the date as following:
Код:
new Day, Month, Year, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
And then print it.
As for last login time, you save it in player data upon connecting in OnPlayerConnect callback, then you save it in the file and format it later on, e.g. that's how I do welcoming message myself (note that there's little problem with formatting I was too lazy to fix, you might want to consider that some of the numbers there must be two digits, see to SAMP wiki to consult in regards to the issue)
Код:
format(str, sizeof(str), "Welcome back, %s. Your last login was on %d/%d/%d at %d:%d:%d.", GetPName(playerid), PlayerInfo[playerid][pLLYear], PlayerInfo[playerid][pLLMonth], PlayerInfo[playerid][pLLDay], PlayerInfo[playerid][pLLHour], PlayerInfo[playerid][pLLMin], PlayerInfo[playerid][pLLSec]);
Where LL stands for Last Login here. (GetPName is a custom function, let's say you have a formatted string with a name in it there).