dini creating the wrong password
#4

Try this - you were using sscanf incorrectly:

pawn Код:
CMD:register(playerid, params[])
{
    new
        file[40],
        string[128],
        pname[MAX_PLAYER_NAME];
   
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "Users/%s.ini", pname);
   
    if (isnull(params))
        return SendClientMessage(playerid, RED, "Use /register password");
   
    if (!fexist(file))
    {
        dini_Create(file);
        dini_Set(file, "Password", params);
        dini_IntSet(file, "Level", 0);
        dini_IntSet(file, "Score", GetPlayerScore(playerid));
        dini_IntSet(file, "Money", GetPlayerMoney(playerid));
        dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
       
        format(string, sizeof(string), "[SYSTEM] You have been sucessfully registered! You password is: {FF1E00}%s", params);
        SendClientMessage(playerid, GREEN, string);

        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        PlayerInfo[playerid][logged] = 1;
    }
    else
    {
        SendClientMessage(playerid, RED, "You are already registered.");
    }
    return 1;
}
You shouldn't really use dini, but that's entirely up to you. Also, hash your passwords please!
Reply


Messages In This Thread
dini creating the wrong password - by Sawalha - 08.12.2013, 12:45
Re : dini creating the wrong password - by FilesMAker - 08.12.2013, 12:50
Re: dini creating the wrong password - by Voxel - 08.12.2013, 13:00
Re: dini creating the wrong password - by Emmet_ - 08.12.2013, 13:07
Re: dini creating the wrong password - by Sawalha - 08.12.2013, 16:38
Re: dini creating the wrong password - by SilentSoul - 08.12.2013, 16:44
Re: dini creating the wrong password - by Voxel - 08.12.2013, 20:21
Re: dini creating the wrong password - by Sawalha - 09.12.2013, 11:16

Forum Jump:


Users browsing this thread: 2 Guest(s)