22.04.2012, 13:53
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
how can i avoid that?
and one question?
How do i saved PlayerName with INI_WriteString?
like
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
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;
}
How do i saved PlayerName with INI_WriteString?
like
Код:
MarryTo = Manuel_Smith