What's wrong ? -
anonimus2222222 - 19.06.2016
Everything works perfectly but when I connect I want to say that is wrong password. What is wrong with the script?
Код HTML:
if(dialogid == REGISTER)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "{FFFF00}Inregistrare", "{FF0000}Trebuie sa va inregistrati", "Register", "Inchide");
if(!response) return Kick(playerid);
if(response)
{
new INI:File = INI_Open(User(playerid));
INI_WriteInt(File, "Password", udb_hash(inputtext));
INI_Close(File);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0x00FF00FF, "Te-ai inregistrat cu succes !");
new String[256], Name[MAX_PLAYER_NAME], dd, mm, yy, h, m;
GetPlayerName(playerid, Name, sizeof(Name));
getdate(yy, mm, dd);
gettime(h, m);
format(String, sizeof(String), "{FFFFFF}Nume: {FFFF00}%s\n{FFFFFF}Data: {FFFF00}%02d/%02d/%02d\n{FFFFFF}Ora: {00FF00}%02d:%02d\n{FFFFFF}Parola: {FFFF00}%s\n{00773C}Apasa butonul 'F8' pentru a face o captura a ecranului.", Name, dd, mm, yy, h, m, inputtext);
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{00FF00}Informatii inregistrare.", String, "Ok", "");
DestroyRegistrationMenu(playerid);
}
}
Re: What's wrong ? -
SyS - 19.06.2016
what? i dont understood your english i think you are refering to login system not the register thing and your password is not checking correctly right? show your login dialog
Re: What's wrong ? -
anonimus2222222 - 29.06.2016
PHP код:
if(dialogid == LOGIN)
{
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{FF0000}Conectare", "{FF0000}Trebuie sa te conectezi.", "Connect", "Iesire");
if(response)
{
INI_ParseFile(User(playerid), "PlayerData_%s", .bExtra = true, .extra = playerid);
if(udb_hash(inputtext) == pInfo[playerid][Pass])
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, pInfo[playerid][x], pInfo[playerid][y], pInfo[playerid][z]);
SetPlayerFacingAngle(playerid, pInfo[playerid][a]);
GivePlayerMoney(playerid, pInfo[playerid][Cash]);
SetPlayerScore(playerid, pInfo[playerid][Score]);
pInfo[playerid][Kills] = pInfo[playerid][Kills];
pInfo[playerid][Deaths] = pInfo[playerid][Deaths];
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0x00FF00FF, "Ai fost conectat pe server cu succes.");
DestroyRegistrationMenu(playerid);
}
else
{
if(Attempts[playerid] <= 2)
{
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
Attempts[playerid] ++;
new String[128];
format(String, sizeof(String), "{FF0000}Parola gresita {FFFF00}%d/3 {FFFFFF}incercari.", Attempts[playerid]);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{FF0000}Conectare", String, "Connect", "Iesire");
}
if(Attempts[playerid] == 3)
{
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{FF0000}Conectare epuizata", "{FF0000}Ai fost dat afara pentru ca ai gresit parola de conectare de 3 ori.", "Am inteles.", "");
SetTimerEx("KickForBadLogin", 500, false, "i", playerid);
DestroyRegistrationMenu(playerid);
}
}
}
}
Re: What's wrong ? -
SyS - 29.06.2016
can u show the loading function something with PlayerData_blahblah
Re: What's wrong ? -
anonimus2222222 - 29.06.2016
PHP код:
forward PlayerData_Data(playerid, name[], value[]);
public PlayerData_Data(playerid, name[], value[])
{
INI_Int("Password", pInfo[playerid][Pass]);
INI_Float("X", pInfo[playerid][x]);
INI_Float("Y", pInfo[playerid][y]);
INI_Float("Z", pInfo[playerid][z]);
INI_Float("A", pInfo[playerid][a]);
INI_Int("Cash", pInfo[playerid][Cash]);
INI_Int("Score", pInfo[playerid][Score]);
INI_Int("Kills", pInfo[playerid][Kills]);
INI_Int("Deaths", pInfo[playerid][Deaths]);
return 1;
}
Re: What's wrong ? -
SyS - 29.06.2016
PHP код:
if(dialogid == LOGIN)
{
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{FF0000}Conectare", "{FF0000}Trebuie sa te conectezi.", "Connect", "Iesire");
if(response)
{
INI_ParseFile(User(playerid), "PlayerData_Data", .bExtra = true, .extra = playerid);
if(udb_hash(inputtext) == pInfo[playerid][Pass])
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, pInfo[playerid][x], pInfo[playerid][y], pInfo[playerid][z]);
SetPlayerFacingAngle(playerid, pInfo[playerid][a]);
GivePlayerMoney(playerid, pInfo[playerid][Cash]);
SetPlayerScore(playerid, pInfo[playerid][Score]);
pInfo[playerid][Kills] = pInfo[playerid][Kills];
pInfo[playerid][Deaths] = pInfo[playerid][Deaths];
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0x00FF00FF, "Ai fost conectat pe server cu succes.");
DestroyRegistrationMenu(playerid);
}
else
{
if(Attempts[playerid] <= 2)
{
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
Attempts[playerid] ++;
new String[128];
format(String, sizeof(String), "{FF0000}Parola gresita {FFFF00}%d/3 {FFFFFF}incercari.", Attempts[playerid]);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{FF0000}Conectare", String, "Connect", "Iesire");
}
if(Attempts[playerid] == 3)
{
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{FF0000}Conectare epuizata", "{FF0000}Ai fost dat afara pentru ca ai gresit parola de conectare de 3 ori.", "Am inteles.", "");
SetTimerEx("KickForBadLogin", 500, false, "i", playerid);
DestroyRegistrationMenu(playerid);
}
}
}
}
try above code i just changed
PHP код:
INI_ParseFile(User(playerid), "PlayerData_%s", .bExtra = true, .extra = playerid);
to
PHP код:
INI_ParseFile(User(playerid), "PlayerData_Data", .bExtra = true, .extra = playerid);
Re: What's wrong ? -
anonimus2222222 - 29.06.2016
Thank you man. Rep !