Y_INI (YSI)
#1

Last couple of days ago i need help about /changepass
now i successfully done creating now the problem is when i changepass
it is creating double line of Pass

so the result is

pawn Код:
Pass
[data]
Pass
how can i avoid that?

pawn Код:
CMD:changepass(playerid, params[])
{
    new newpass[50], oldpass[50], string[128];
    format(oldpass, 50, "%s", pInfo[playerid][Pass]);
    new INI:file = INI_Open(PlayerPath(playerid));
    if(sscanf(params, "s[50]s[50]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /changepass [oldpass] [newpass]");
    if(strval(pInfo[playerid][Pass]) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'oldpass' blank!");
    if(strval(newpass) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'newpass' blank!");
    if(udb_hash(oldpass) != pInfo[playerid][Pass]) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
    if(udb_hash(oldpass) == udb_hash(newpass)) return SendClientMessage(playerid, COLOR_GREY, "You are trying to set your old password to be new password!");
    INI_WriteInt(file, "Pass", udb_hash(newpass));
    INI_Close(file);
    format(string, sizeof(string), "Your password '%s' has been now replace with your new password '%s'", oldpass, newpass);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
}
and one question?

How do i saved PlayerName with INI_WriteString?

like

Код:
MarryTo = Manuel_Smith
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
There is no "INI_SetTag" in that code. I'm guessing there was first time (well, there had to be). "INI_SetTag" is used to separate different sets of data with possibly the same keys, so as far as y_ini is concerned, that is a different piece of data with the same name.
I had one when player register, INI_SetTag is called
Reply
#3

I will try to fix the problem with /changepass now the topic here is
How to make like this with INI_WriteString?

Код:
MarryTo = Firstname_Lastname
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)