27.03.2011, 13:06
Ok, my server has completed its MySql system thanks to someone whos name i wont state because i dont think he would want me to.
The only issue is, when you relog, and try to Login, it says "* Wrong Password" every single time, even if the password is right. It does this for every player.
We use GstyleZzZ MySql Plugin R5 - https://sampforum.blast.hk/showthread.php?tid=56564
Here is the code:
(( Please ignore that it is non-indented on the forum, i dont know why. ))
And if it helps, heres the player info:
Thank you, if you can fix this
The only issue is, when you relog, and try to Login, it says "* Wrong Password" every single time, even if the password is right. It does this for every player.
We use GstyleZzZ MySql Plugin R5 - https://sampforum.blast.hk/showthread.php?tid=56564
Here is the code:
(( Please ignore that it is non-indented on the forum, i dont know why. ))
Код:
if(dialogid == 1400) // login dialog
{
if(response)
{
if(!strlen(inputtext))
{
//ShowPlayerDialog(playerid, 1400, DIALOG_STYLE_INPUT , "Login", "Insert your password below to log in!", "OK", "Cancel");
SendClientMessage(playerid, c_red, "* You have to login to be able to play!");
new str2[152];
format(str2, sizeof(str2), "Welcome to Battlefield 1943:\n\n{FF0000}%s,\n\n{FFFFFF}That name is registered. Please enter your password below.", plnamed);
ShowPlayerDialog(playerid, 1400, DIALOG_STYLE_INPUT, "Login",str2,"Login", "Cancel");
}
new str2[152], query[100];
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(query, sizeof(query), "SELECT * FROM `users` WHERE name='%s'", pname);
mysql_store_result();
mysql_fetch_row_format(query, "|");
sscanf(query, "e<p<|>{s[32]}i{s[32]}i{i}iiiii>", PlayerInfo[playerid]);
new pas = udb_hash(inputtext);
new upas = PlayerInfo[playerid][hashpw];
if(pas != upas)
{
SendClientMessage(playerid, c_red, "* Wrong Password.");
format(str2, sizeof(str2), "Welcome to Battlefield 1943:\n\n{FF0000}%s,\n\n{FFFFFF}That name is registered. Please enter your password below.", plnamed);
ShowPlayerDialog(playerid, 1400, DIALOG_STYLE_INPUT, "Login",str2,"Login", "Cancel");
}
else
{
logged[playerid] = 1;/*
PlayerInfo[playerid][Admin] = dini_Int(file, "Admin");
SetPlayerScore(playerid, dini_Int(file, "score"));
PlayerInfo[playerid][deaths] = dini_Int(file, "deaths");
PlayerInfo[playerid][EasterEgg] = dini_Int(file, "EasterEgg");
PlayerInfo[playerid][Warns] = dini_Int(file, "Warns");*/
SendClientMessage(playerid, c_green, "* You have logged in!");
format(string,sizeof(string),"* %s has logged in!", pname);
SendClientMessageToAll(c_green, string);
SendClientMessage(playerid, c_blue, "* If you don't spawn automatically, click on the 'Spawn' button!");
UpdateTag(playerid);
LoginPlayer(playerid);
}
}
else
{
new str2[152];
format(str2, sizeof(str2), "Welcome to Battlefield 1943:\n\n{FF0000}%s,\n\n{FFFFFF}That name is registered. Please enter your password below.", plnamed);
ShowPlayerDialog(playerid, 1400, DIALOG_STYLE_INPUT, "Login",str2,"Login", "Cancel");
SendClientMessage(playerid, c_red, "* You have to login to be able to play!");
}
}
Код:
// Playerinfo
enum pInfo
{
//Basic
namevar[32],
hashpw,
Admin,
deaths,
EasterEgg,
Warns,
Premium,
PremiumChat,
team,
class,
spawn,
smember,
sleader,
}
new PlayerInfo[MAX_PLAYERS][pInfo];


