SA-MP Forums Archive
/Changename Bug (Hashed Passwords) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /Changename Bug (Hashed Passwords) (/showthread.php?tid=269967)



/Changename Bug (Hashed Passwords) - dillo1000 - 18.07.2011

Ok so when someone changes there name and logs on after as the other name because the passwords are hashed it doesnt change the password to there password it should be....

pawn Код:
if(strcmp("/changename", cmd, true) == 0)
        {
    if(Spawned[playerid] == 0) return SendClientMessage(playerid,COLOR_ORED,"Please Spawn First!");
    if(isLogged[playerid] == 0) return SendClientMessage(playerid,COLOR_ORED,"Please Login First!");
    new tmp[256], cmdid;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /changename [new name]");
    new file[128];
    new name[256];
    new file2[256];
        GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),SERVER_USER_FILE,name);
    format(file2,sizeof(file2),SERVER_USER_FILE,tmp);
    if(fexist(file2)) return SendClientMessage(playerid,COLOR_ORED,"The name is already in use!");
    new str[256];
    format(str,sizeof(str),"* %s has changed his/her name to %s.",name,tmp);
    SetPlayerName(playerid,tmp);
    dini_Create(file2);
    dini_Remove(file);
    SendClientMessageToAll(COLOR_LIGHTGREEN,str);
             return 1;
        }



Re: /Changename Bug (Hashed Passwords) - dillo1000 - 18.07.2011

Can I just add it shows all the details of the player in a new file apart from "Password=*******"


Re: /Changename Bug (Hashed Passwords) - dillo1000 - 18.07.2011

I need help quick!!


Re: /Changename Bug (Hashed Passwords) - dillo1000 - 20.07.2011

*Bump*


Re: /Changename Bug (Hashed Passwords) - dillo1000 - 22.07.2011

*bump* srs need help


Re: /Changename Bug (Hashed Passwords) - TouR - 22.07.2011

Explain batter. I cannot understand what your are trying to fix


Re: /Changename Bug (Hashed Passwords) - dillo1000 - 22.07.2011

The server passwords are hashed.
When someone uses /changename the server sorts it out but when they log in with there new name it tells them incorrect password unless they use /changepass after they have used /changename


Re: /Changename Bug (Hashed Passwords) - MadeMan - 22.07.2011

Show your /register command.


Re: /Changename Bug (Hashed Passwords) - dillo1000 - 22.07.2011

pawn Код:
if(strcmp(cmd, "/register", true) == 0)
    {
      new name[MAX_PLAYER_NAME];
      tmp = strtok(cmdtext, idx);
      GetPlayerName(playerid, name, sizeof(name));
      if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
      format(file,sizeof(file),SERVER_USER_FILE,name);
      if(!fexist(file))
            {
              dini_Create(file);
              dini_IntSet(file, "Password");
              dini_IntSet(file,"AdminLevel", 0);
              dini_IntSet(file,"Money", 25000);
               dini_IntSet(file,"Score", 0);
               dini_IntSet(file,"DrivingLic",0);
              SendClientMessage(playerid, COLOR_LIGHTBLUE, "You account has been created! Please /login to proceed.");
              PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
              GetPlayerName(playerid, name, sizeof(name));
              printf("%s has registered a account!", name);
              justcome[playerid] = 1;
            }
            else
            {
              SendClientMessage(playerid, COLOR_RED, " This account is already registered.");
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
            }
        return 1;
    }



Re: /Changename Bug (Hashed Passwords) - MadeMan - 22.07.2011

pawn Код:
dini_IntSet(file, "Password");
This line compiles without errors?