[HELP] Register/Login
#1

What wrong here:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
        	if (!response) return Kick(playerid);
        	if(response)
            {
                //if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""BELA"Registracija...",""CRVENA"Ukucali ste pogresnu sifru.\n"BELA"Ukucajte sifru da registrujete svoj nalog.","Registruj","Izlaz");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Sifra",udb_hash(inputtext));
                INI_WriteInt(File,"Novac",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Ubistva",0);
                INI_WriteInt(File,"Smrti",0);
                INI_WriteInt(File,"Kuca",0);
                INI_WriteInt(File,"Spawn",0);
                INI_WriteInt(File,"Rent",0);
                INI_WriteInt(File,"Level",0);
                INI_WriteInt(File,"Exp",0);
                INI_WriteInt(File,"Skin",0);
                INI_WriteInt(File,"GM",0);
                INI_WriteInt(File,"Banovan",0);
                INI_WriteInt(File,"TuT",0);
                INI_WriteInt(File,"Reg",0);
                INI_WriteInt(File,"Pol",0);
                INI_WriteInt(File,"Godine",0);
                INI_WriteInt(File,"Drzava",0);
                PlayerInfo[playerid][pReg] = 0;
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Dobrodosli","uspjesno ste se registrovali\nUkucajte sifru kako bi se logovali!","Prijavi se","Izadji");
                INI_Close(File);
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pSifra])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    if(PlayerInfo[playerid][pReg] == 0)
                    {
                    PlayerInfo[playerid][pSpawn] = 0; PlayerInfo[playerid][pKuca] = -1; PlayerInfo[playerid][pRent] = -1; LociranjeKuce[playerid] = 0; Chat[playerid] = 0; PlayerInfo[playerid][pSmrti] = 0;
					PlayerInfo[playerid][pNovac] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pUbistva] = 0; Registracija[playerid] = 0; Ulogovan[playerid] = 0; PlayerInfo[playerid][pLevel] = 0;
					PlayerInfo[playerid][pExp] = 0; PlayerInfo[playerid][pSkin] = 0; PlayerInfo[playerid][pGM] = 0; PlayerInfo[playerid][pBanovan] = 0; PlayerInfo[playerid][pTuT] = 0; PlayerInfo[playerid][pReg] = 0;
					PlayerInfo[playerid][pPol] = 0; PlayerInfo[playerid][pGodine] = 0; PlayerInfo[playerid][pDrzava] = 0;
                    Ulogovan[playerid] = 0;
                    }
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
                    SetSpawnInfo( playerid, -1, -1, -1,-1,-1, 1.0, -1, -1, -1, -1, -1, -1 );
                    Ulogovan[playerid] =1;
					SpawnPlayer(playerid);
					SetPlayerSpawn(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""BELA"Login",""CRVENA"Ukucali ste pogresnu sifru.\n"BELA"Ukucajte sifru kako bi se logovali.","Login","Izlaz");
                }
                return 1;
            }
        }
    	}
when i register account it show me dialog for login:
Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Dobrodosli","uspjesno ste se registrovali\nUkucajte sifru kako bi se logovali!","Prijavi se","Izadji");
but when i type password it says password is wrong.. Can u help me what wrong?

Sorry for my bad english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)