SA-MP Forums Archive
Registering special characters - 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: Registering special characters (/showthread.php?tid=94650)



Registering special characters - Rizard - 31.08.2009

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


Re: Registering special characters - dice7 - 31.08.2009

Maybe the hash mehanism is faulty. Try without it.


Re: Registering special characters - Rizard - 31.08.2009

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