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



Login special characters - Crosshair - 30.03.2009


Hello.
I have Windows Server 2003 if it helps.
The accounts are registred in mysql.

When someone types for example /login passwordѓ? the server crashes.

How can i solve this ?


Re: Login special characters - Sandra18[NL] - 30.03.2009

I made this function for you:

Код:
stock IsValidPassword(pass[])
{
  for(new i; i<strlen(pass); i++)
  {
    if((pass[i] < 48) || (pass[i] > 57 && pass[i] < 67) || (pass[i] > 90 && pass[i]< 97) || (pass[i] > 122)) return 0;
  }
  return 1;
}
Just before you write the password to the file, use

Код:
if(IsValidPassword(EnteredPassword))
{
   //password is valid  (only 0-9 or Aa-Zz used)
}
else
{
  SendClientMessage(playerid, 0xFF0000AA, "Invalid password! Please do not use special characters!");
}



Re: Login special characters - Crosshair - 30.03.2009

Thx very much