19.08.2015, 04:39
Hello guys i coded a /changename command it works good and change my name ingame and in userpath but the problem is when i try to login it says wrong password this is my code:
And here is my useracc informations:
before change name
after changename
i also have another request i want a /changepassword command i know its pretty same as /changename so i am sure it wont be hard for you guys
PS my password is hashed and i use this system https://sampforum.blast.hk/showthread.php?tid=273088
thanks in advance
PHP код:
CMD:changename(playerid, params[])
{
new id, newname[10], oldname[10], string[128];
if(isnull(params)) return SendClientMessage(playerid, -1, "Changename [NewName]");
if(sscanf(params,"s[10]", newname)) return SendClientMessage(playerid, -1 , "/Changename [NewName]");
if(strlen(params) < 4) return SendClientMessage(playerid,-1,"Name shoulkd not be less than 4 characters.");
if(strlen(params) > 10) return SendClientMessage(playerid,-1,"Name must be 10 characters max.");
GetPlayerName(playerid, oldname, sizeof(oldname));
new file[64];
format(file, sizeof(file), "/Users/%s.ini", newname);
if (fexist(file)) return SendClientMessage(playerid, -1, "The name you entered is already being used by another player!");
fremove(UserPath(id));
SetPlayerName(id,newname);
format(string, sizeof(string), "%s Name changed to (%s).", oldname, newname);
SendClientMessageToAll( -1,string);
Kick(id);
return 1;
}
before change name
PHP код:
Password = 158794218
Cash = 0
AdminLevel = 0
Kills = 0
Deaths = 0
Score = 11
Minutes = 13
Hours = 5
Seconds = 3
PHP код:
Cash = 0
AdminLevel = 0
Kills = 0
Deaths = 0
Score = 11
Minutes = 13
Hours = 5
Seconds = 3
PS my password is hashed and i use this system https://sampforum.blast.hk/showthread.php?tid=273088
thanks in advance