Dialog problem..
#1

Hi, I have a problem using dialog which I can't fix. When I connect to my home server and type a password in dialog.. Dialog just dissapears and nothing happens.
Here's the code: (someone please help)

pawn Код:
case 1:
{
    if ( !response ) return Kick ( playerid );
    if( response )
    {
        if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
            PlayerLogged[playerid] = 1;
            SpawnPlayer(playerid);
            format(string, sizeof(string), "~w~Welcome ~n~~y~   %s", sendername);
            GameTextForPlayer(playerid, string, 5000, 1);
        }
        else
        {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
        }
        return 1;
    }
}
Reply
#2

pawn Код:
case 1:
{
    if ( !response ) return Kick ( playerid );
    if( response )
    {
        if(strmatch(udb_hash(inputtext), PlayerInfo[playerid][pPass]))
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
            PlayerLogged[playerid] = 1;
            SpawnPlayer(playerid);
            format(string, sizeof(string), "~w~Welcome ~n~~y~   %s", sendername);
            GameTextForPlayer(playerid, string, 5000, 1);
        }
        else
        {
            SendClientMessage(playerid, 0x0, "Wrong password typed!");
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
        }
        return 1;
    }
}

stock strmatch(const String1[], const String2[])
{
    if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
    {
        return true;
    }
    else
    {
        return false;
    }
}
Reply
#3

Error:
pawn Код:
error 035: argument type mismatch (argument 1)
Line:
pawn Код:
if(strmatch(udb_hash(inputtext), PlayerInfo[playerid][pPass]))
Reply
#4

udb_hash only ever returns integer values. This function is terribly outdated though, and far from safe. I myself have never used Y_Ini before, so I have no clue what these parameters are or what the problem might be.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)