PHP код:
if (dialogid == REGISTER)
{
if (!response) return Kick(playerid);
if (response)
{
if (!strlen(inputtext))
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, ""RED">> "PREMIUM"Account Register", ""WHITE"Welcome to "RED"X1treme Stunting Freeroam"WHITE"!\n"WHITE"This account is "RED"not "WHITE"registered.\n\n"YELLOW"» Please enter a password below to register.", "Register", "Quit");
return 1;
}
new hashpass[129], date[20], year, month, day, str[200];
new random_color = ( 16777216 * random( 256 ) ) + ( 65536 * random( 256 ) ) + ( 256 * random( 256 ) ) + 255;
WP_Hash(hashpass, sizeof(hashpass), inputtext);
getdate(year, month, day);
format(date, sizeof(date), "%d/%d/%d", day, month, year);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "Player's Data");
INI_WriteString(File, "Password", hashpass);
INI_WriteString(File, "Registered_On", date);
INI_WriteInt(File,"Admin", 0);
INI_WriteInt(File,"VIP", 0);
INI_WriteInt(File,"Cash", 0);
INI_WriteInt(File,"Score", 0);
INI_WriteInt(File,"Kills", 0);
INI_WriteInt(File,"Deaths", 0);
INI_WriteInt(File, "Hours", 0);
INI_WriteInt(File, "Minutes", 0);
INI_Close(File);
gTotalRegisters++;
GivePlayerMoney(playerid, 5000);
PlayerInfo[playerid][Hours] = 0;
PlayerInfo[playerid][Minutes] = 0;
PlayerInfo[playerid][Helmet] = 1;
SendClientMessage(playerid, COLOR_PINK, ""PREMIUM"*** "LIGHTBLUE"Thank you for registering your account!");
PlayerInfo[playerid][RegOn] = date;
SpawnPlayer(playerid);
format(str, sizeof(str), ""RED"[XS] {%06x}%s(%d) {2BD9F8}has registered, making the server have total {008FFB}%d {2BD9F8}players registered.", random_color >>> 8, GetName(playerid), playerid, gTotalRegisters);
SetPlayerColor(playerid, random_color);
SendClientMessageToAll(0x2BD9F8FF, str);
new INI:FILE_SERVER_STATS = INI_Open(ServerStats);
INI_SetTag(FILE_SERVER_STATS, "Server_Statistics");
INI_WriteInt(FILE_SERVER_STATS, "Total_Registered_Users", gTotalRegisters);
INI_Close(FILE_SERVER_STATS);
PlayerInfo[playerid][Spawned] = 1;
PlayerInfo[playerid][LoggedIn] = 1;
return 1;
}
}