Registering special characters
#1

Hi,

pawn Код:
dcmd_register(playerid,params[])
{

  if(!strlen(params)) { new string[256]; format(string,256,"Syntax Error: \"/REGISTER <PASSWORD>\" [Password must be %d+].",Config[MinimumPasswordLength]); return SendClientMessage(playerid,red,string); }
    new index = 0,Password[256],string[256],PlayerFile[256]; Password = strtok(params,index); PlayerFile = GetPlayerFile(playerid);
    if(!(Variables[playerid][Registered] || Variables[playerid][LoggedIn]))
    {
      if(strlen(Password) >= Config[MinimumPasswordLength] )
        {
        format(string,sizeof(string),"You have registered your account with the password \"%s\" and automatically been logged in.",Password);
            SetUserInt(playerid,"Password",udb_hash(Password));
      SetUserInt(playerid,"Registered",1);
      SetUserInt(playerid,"LoggedIn",1);
        Variables[playerid][LoggedIn] = true, Variables[playerid][Registered] = true;
        SendClientMessage(playerid,blue,string);
        SendClientMessage(playerid,blue,"Here is a little bonus for registering ;)");
        GivePlayerMoney(playerid,10000);
        new tmp3[100]; GetPlayerIp(playerid,tmp3,100); SetUserString(playerid,"IP",tmp3); OnPlayerRegister(playerid);
      }
        else SendClientMessage(playerid,red,"Syntax Error: \"/REGISTER <PASSWORD>\" [Password must be 6(+)]");
    }
    else SendClientMessage(playerid,red,"Error: Make sure this account is not already registered and you're not logged in.");
    return 1;
}
That's my registering command.... when anyone with special characters registers, the server crashes, anyone (Maybe XTreme) who can solve this?
I know you can use 'IsValidLoginName'... but I'd realy like to have users with special characters registered as well.


Grts Riz
Reply
#2

Maybe the hash mehanism is faulty. Try without it.
Reply
#3

Hi,

thnx for the quick reply,

If I leave the udb_hash option, pawno returns an argument error about the 'Password' (probably because it's not a digit anymore?)

Grts Riz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)