SA-MP Forums Archive
When I login it says Wrong Password.. WTH is the problem? Help.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: When I login it says Wrong Password.. WTH is the problem? Help.. (/showthread.php?tid=91967)



When I login it says Wrong Password.. WTH is the problem? Help.. - RyDeR` - 17.08.2009

When I login it says Wrong Password.. WTH is the problem? Help..


pawn Код:
dcmd_gir(playerid, params[])
{
    new pass[128]; new oyunism[128], Isim[MAX_PLAYER_NAME], control[265];
    GetPlayerName(playerid, Isim, MAX_PLAYER_NAME);
    format(oyunism, sizeof(oyunism), "/RAdmin/Hesaplar/%s.ini",Isim);
    if(Girilmis[playerid] == 1)
    {
      SendClientMessage(playerid, COLOR_RED, "Zaten giris yapilmis");
    }
    if(sscanf(params, "s", pass)) SendClientMessage(playerid, COLOR_YELLOW, "[Kullanim] /gir <sifre>");
    else
    {
        if(dini_Exists(oyunism))
        {
        control = dini_Get(oyunism, "Sifre");
        if(control[playerid] != pass[playerid])
        {
            SendClientMessage(playerid, COLOR_RED, "Wrong Password!"); // And I gave a good password :S And it says Wrong pass.
        }
        else
        {
            Girilmis[playerid] = 1;
            Para[playerid] = dini_Int(oyunism, "Para");
            Score[playerid] = dini_Int(oyunism, "Score");
            Adminlik[playerid] = dini_Int(oyunism, "Adminlik");
      SendClientMessage(playerid, COLOR_LIGHTGREEN, "Basari ile giris yaptiniz!");
    }
    }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "Bu hesap daha kayitli degil! /kayit <sifre> yazarak bir hesap olusturunz.");
        }
}
return 1;
}
My Login system..


Re: When I login it says Wrong Password.. WTH is the problem? Help.. - dice7 - 17.08.2009

Use strcmp for comparing strings.
And use control[MAX_PLAYERS][256] so you can then compare like control[playerid]


Re: When I login it says Wrong Password.. WTH is the problem? Help.. - RyDeR` - 17.08.2009

Quote:
Originally Posted by dice7
Use strcmp for comparing strings.
And use control[MAX_PLAYERS][256] so you can then compare like control[playerid]
Is this right?

if(control[playerid] != pass[playerid])