07.09.2012, 01:56
Hey guys, i have Register system but it got some problems, First it is with Dialogs second when you type your pass to Register, Nothing happen...i will show you the codes..All of it
Dialogs:
I have my MYsql , it is updated {LATEST VERSION}
So??
pawn Код:
public OnPlayerRegister(playerid, password[])
{
FuncLog("OnPlayerRegister");
if(IsPlayerConnected(playerid))
{
MySQLCheckConnection();
new playername[MAX_PLAYER_NAME];
new playername3[MAX_PLAYER_NAME];
new newpass[64];
GetPlayerName(playerid, playername3, sizeof(playername3));
mysql_real_escape_string(playername3, playername);
mysql_real_escape_string(password, newpass);
new query[128];//PASSWORD
format(query, sizeof(query), "INSERT INTO `userinfo` (UserName) VALUES ('%s');", playername);
mysql_query(query);
new newaccountsqlid = MySQLCheckAccount(playername3);
if (newaccountsqlid != 0)
{
format(query, sizeof(query), "INSERT INTO `uservehicles` (ID, UserName) VALUES (%d, '%s');", newaccountsqlid, playername);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO `userstrings` (ID, UserName, Password) VALUES (%d, '%s', '%s');", newaccountsqlid, playername, newpass);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO `userlocker` (ID, Username) VALUES (%d, '%s');", newaccountsqlid, playername);
mysql_query(query);
PlayerInfo[playerid][pSQLID] = newaccountsqlid;
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 127);
SendClientMessage(playerid, COLOR_YELLOW, "Account registered, you can now login.");
ShowPlayerDialog(playerid, 115, DIALOG_STYLE_INPUT, "{00BFFF}NewTown Roleplay", "This account is Registered!\nPlease enter your Password!", "Login", "Exit");
gPlayerAccount[playerid] = 1;
OnPlayerLogin(playerid, password);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "There was an error creating your account. You will be disconnected now1.");
return 0;
}
}
return 0;
}
pawn Код:
if(dialogid == 115)//Register
{
if(response)
{
if(strlen(inputtext) < 5)
{
SendClientMessage(playerid, COLOR_GRAD1, "Your password needs to be at least 5 Characters long!");
ShowPlayerDialog(playerid, 116, DIALOG_STYLE_INPUT, "{00BFFF}NewTown Roleplay", "Your password needs to be at least 5 characters long!\nThis account is not registered!\nPlease enter your Password!", "Register", "Quit");
return 1;
}
else if(strlen(inputtext) > 60)
{
SendClientMessage(playerid, COLOR_GRAD1, "Your password can't be longer than 63 Characters!");
ShowPlayerDialog(playerid, 116, DIALOG_STYLE_INPUT, "{00BFFF}NewTown Roleplay", "Your password can't be longer than 60 characters!\nThis account is not registered!\nPlease enter your Password!", "Register", "Quit");
return 1;
}
//strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
OnPlayerRegister(playerid,inputtext);
return 1;
}
else
{
Kick(playerid);
return 1;
}
}
So??