24.05.2014, 19:58
Good night , how can i check if inputtext = the password of account ? what i do :
The problem there is : if my password is APPLE and i type BLABLA is logged me ! i don't want that !
Where's the fault ? i want to check the string if is the password ... ( i followed this tutorial https://sampforum.blast.hk/showthread.php?tid=273088 but i removed udb function )
pawn Код:
INI_ParseFile(UserPath(playerid), "Load_%s", .bExtra = true, .extra = playerid);
new pass[24];
pass = PlayerInfo[playerid][Parola];
if(!strcmp(pass,inputtext, false)) ( if is correct) { blabla working ok }
pawn Код:
if(dialogid == LOGIN_DIALOG)
{
if ( !response ) return Kick ( playerid );
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, " ", "{99CCFF}Bine ai revenit pe server , te rugam sa introduci parola in chenar pentru logare!", "Login", "Cancel");
if( response )
{
INI_ParseFile(UserPath(playerid), "Incarcare_%s", .bExtra = true, .extra = playerid);
new pass[24];
pass = PlayerInfo[playerid][Parola];
if(!strcmp(pass,inputtext, false))
{
INI_ParseFile(UserPath(playerid), "Incarcare_%s", .bExtra = true, .extra = playerid);
if(PlayerInfo[playerid][pStagiuTut] == 0)
{
ClearChat(playerid);
InterpolateCameraPos(playerid, 1383.6500, -1578.4200, 30.8600, 860.1893, -1584.8966, 29.7883, 10000, CAMERA_MOVE);
ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, " ", "{FFFFFF}- Jucator , ce sex are personajul ?\n\n{FFF1AF}[Va rugam sa raspundeti cu mare grija la intrebarile despre personajul dvs.]", "Barbat", "Femeie");
return 1;
}
else
{
if(PlayerInfo[playerid][pSpawnChoose] == 1)
{
new rand = random(sizeof(SpawnPointuri));
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin],SpawnPointuri[rand][0], SpawnPointuri[rand][1],SpawnPointuri[rand][2],SpawnPointuri[rand][3], 0, 0, 0, 0, 0, 0);
}
if(PlayerInfo[playerid][pSpawnChoose] == 2)
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ],PlayerInfo[playerid][pAngle], 0, 0, 0, 0, 0, 0);
}
}
return 1;
}
}