18.02.2015, 01:24
The server wont move onto OnAccountCreate, stops right there.
pawn Код:
public OnCheckEmail(playerid, username[],email[],password[]) {
new rows, fields, msg[256];
query[0] = 0;//[256];
cache_get_data(rows, fields);
if(rows < 1) {
format(query,sizeof(query),"INSERT INTO `accounts` (`username`,`email`,`password`) VALUES(\"%s\",\"%s\",md5(\"%s\"));",username,email,password);
mysql_function_query(g_mysql_handle, query, true, "onAccountCreate", "dd", playerid, mysql_insert_id());
format(msg,sizeof(msg),"Registered2: %d | %s | %s | %s",playerid,username, email, password);
printf(msg);
} else {
ShowPlayerDialog(playerid, _:EAccountDialog_EnterEmail, DIALOG_STYLE_INPUT, "Enter your email address", "Enter your email address.\n{FF0000}Notice{FFFFFF}: Make sure this is valid, or else you might not be able to reset your email!\n{FF0000}This email is in use! Enter another email!","Ok","Cancel");
}
}
pawn Код:
public onAccountCreate(playerid, last_insert_id) {
new msg[256], id = mysql_insert_id();
if(id == 0 || id == last_insert_id) {
SendClientMessage(playerid, X11_RED, "There was an error creating your account.");
//TODO: LOG ERRORS
Kick(playerid);
return 0;
}
SetPVarInt(playerid,"AccountID",id);
format(msg,sizeof(msg),"Registered2: %d | %d",playerid, id);
printf(msg);
#if debug
new dbgmsg[128];
format(dbgmsg,sizeof(dbgmsg),"[DBG]: Account ID: %d",id);
SendClientMessage(playerid, X11_RED,dbgmsg);
#endif
ShowCharacterDialog(playerid);
return 1;
}