22.03.2018, 19:08
Quote:
Make use of these following functions:
format SendClientMessage getdate GetPlayerName In the login function, fetch the last online date and format the message and send it. Save the date. In the register function, fetch the date, the account name and password. Do the same as the login one, format it and send it. Save the date. That's it. |
Код:
new name[25], string[100], day, month, year; GetPlayerName(playerid, name, sizeof(name)); getdate(year, month, day); format(string, 100,"Your registered account: <Name:%s><Password:%s>[Day:%d, Month:%d, Year:%d]", name,inputtext, day, month, year); SendClientMessage(playerid, COLOR_YOUWANT, string);
PHP код:
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 name[25], string[100], day, month, year;
GetPlayerName(playerid, name, sizeof(name));
getdate(year, month, day);
format(string, 100,"Your registered account: <Name:%s><Password:%s>[Day:%d, Month:%d, Year:%d]", name,inputtext, day, month, year);
SendClientMessage(playerid, COLOR_YOUWANT, string);
}
}