Flaws while reading from a string
#8

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Why? Your saving the code then reloading it when they login unless they get a new code each time then there would be no need to save it.
Well, I just checked and now it gives me a new code every time I reconnect.

pawn Код:
/* -------------------------------------------------------------------------- */
Dialog:Register(playerid, response, listitem, inputtext[])
{
    if(!response) Kick(playerid);
    else
    {
        if(!strlen(inputtext))
        {
// dialog stuff
        }
        if(INI_Open(getINI(playerid)))
        {
            INI_WriteString("Password", inputtext);
            INI_WriteInt("Money",       5000);
            INI_WriteInt("AdminLevel",  0);
            INI_WriteInt("Code",        random(500));
            INI_Save();
            INI_Close();
            SetSpawnInfo(playerid, 0, 6, 1772.3214, -1908.2968, 13.5531, 271.5665, 0, 0, 0, 0, 0, 0);
            SpawnPlayer(playerid);
            PlayerPlaySound(playerid, 1057 ,0.0, 0.0, 0.0);
        }
    }
    return 1;
}
/* -------------------------------------------------------------------------- */
Dialog:Login(playerid, response, listitem, inputtext[])
{
    if (!response) Kick(playerid);
    else
    {
        if(!strlen(inputtext))
        {
// dialog stuff
        }
        if(INI_Open(getINI(playerid)))
        {
            INI_ReadString(PlayerInfo[playerid][pPassword], "Password", 20);
            if(strcmp(inputtext, PlayerInfo[playerid][pPassword], false))
            {
// dialog stuff
            }
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid, INI_ReadInt("Money"));
            PlayerInfo[playerid][pAdminLevel] = INI_ReadInt("AdminLevel");
            PlayerInfo[playerid][pCode] = random(500);
            INI_WriteInt("Code", PlayerInfo[playerid][pCode]);
            INI_Close();
            SetSpawnInfo(playerid, 0, 6, 1772.3214, -1908.2968, 13.5531, 271.5665, 0, 0, 0, 0, 0, 0);
            SpawnPlayer(playerid);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Flaws while reading from a string - by rhds - 10.04.2013, 19:37
Re: Flaws while reading from a string - by rhds - 11.04.2013, 12:00
Re: Flaws while reading from a string - by Pottus - 11.04.2013, 12:08
Re: Flaws while reading from a string - by rhds - 11.04.2013, 12:21
Re: Flaws while reading from a string - by Pottus - 11.04.2013, 12:24
Re: Flaws while reading from a string - by rhds - 11.04.2013, 12:30
Re: Flaws while reading from a string - by Pottus - 11.04.2013, 12:33
Re: Flaws while reading from a string - by rhds - 11.04.2013, 12:38
Re: Flaws while reading from a string - by DanLore - 11.04.2013, 12:58
Re: Flaws while reading from a string - by rhds - 11.04.2013, 13:34

Forum Jump:


Users browsing this thread: 2 Guest(s)