/Changename command & /Changepassword
#2

The problem is that you are not saving the player's password back again to the file, if you are using Y_INI you could:

PHP код:
CMD:changename(playeridparams[])
{
    new 
idnewname[10], oldname[10], string[128];
    if(
isnull(params)) return SendClientMessage(playerid, -1"Changename [NewName]");
    if(
sscanf(params,"s[10]"newname)) return SendClientMessage(playerid, -"/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(playeridoldnamesizeof(oldname));
    new 
file[64];
    
format(filesizeof(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);
    new 
INI:pfile INI_Open(file);
    
INI_WriteInt(pfile"Password"PlayerInfo[playerid][pPassword]);
    
INI_Close(pfile);
    
format(stringsizeof(string), "%s Name changed to (%s)."oldnamenewname);
    
SendClientMessageToAll( -1,string);
    
Kick(id);
    return 
1;

NOTE: The PlayerInfo[playerid][pPassword] is an example, you must put the variable where you store the player's password.
Reply


Messages In This Thread
/Changename command & /Changepassword - by SalmaN97 - 19.08.2015, 04:39
Re: /Changename command & /Changepassword - by ThePhenix - 19.08.2015, 04:45
Re: /Changename command & /Changepassword - by SalmaN97 - 19.08.2015, 05:31
Re: /Changename command & /Changepassword - by Mariciuc223 - 19.08.2015, 08:06
Re: /Changename command & /Changepassword - by Evocator - 19.08.2015, 08:23
Re: /Changename command & /Changepassword - by Mariciuc223 - 19.08.2015, 08:29
Re: /Changename command & /Changepassword - by SalmaN97 - 20.08.2015, 05:08
Re: /Changename command & /Changepassword - by Mariciuc223 - 20.08.2015, 06:53

Forum Jump:


Users browsing this thread: 2 Guest(s)