22.01.2013, 09:07
Okay, I made a registration system.
one part when he enters a password and it does this.
then it moves to:
Dialog response:
And finally:
first insert works good, but when it comes to email, it makes another line ...
like this:
I need help thanks.
one part when he enters a password and it does this.
Код:
stock CreatePlayerAccount(playerid, password[]) { new escapename[MAX_PLAYER_NAME], query[256], IP[100]; mysql_real_escape_string(GetName(playerid), escapename); GetPlayerIp(playerid, IP, sizeof(IP)); format(query, sizeof(query), "INSERT INTO `users` (name, password, registered, cash, bank, level, exp, hours, admin, helper, playerIP) VALUES ('%s', '%s', 0, 5000, 10000, 1, 0, 0, 0, 0, '%s')",escapename,password,IP); mysql_function_query(dbHandle, query, true, "OnPlayerCreateAccount", "d", playerid); return 1; }
Код:
public OnPlayerCreateAccount(playerid) { ShowDialog(playerid, Show:<Email>, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"LS:RP Registration"EMBED_WHITE"", ""EMBED_WHITE"To be able to play you'll have to enter your EMAIL address, in case you will lose your password.\n("EMBED_BLUE"If you will enter an invalid adress you won't be able to get your password"EMBED_WHITE")", "Continue", "Quit"); return 1; }
Код:
Dialog:Email(playerid, response, listitem, inputtext[]) { new str[256], escemail[100]; if (response) { if(!strlen(inputtext)) { ShowDialog(playerid, Show:<Email>, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"LS:RP Registration"EMBED_WHITE"", ""EMBED_WHITE"To be able to play you'll have to enter your EMAIL address, in case you will lose your password.\n("EMBED_BLUE"If you will enter an invalid adress you won't be able to get your password"EMBED_WHITE")", "Continue", "Quit"); return 1; } mysql_real_escape_string(inputtext, escemail); InsertPlayerEmail(playerid, escemail); } else { } return 1; }
Код:
stock InsertPlayerEmail(playerid, email[]) { new query[256]; format(query, sizeof(query), "INSERT INTO `users` (email) VALUES ('%s')", email); mysql_function_query(dbHandle, query, true, "", ""); return 1; }
like this:
I need help thanks.