Register Problem - 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)
+--- Thread: Register Problem (
/showthread.php?tid=516271)
Register Problem -
Blackazur - 30.05.2014
Hello, if a player register with the name for example "Dymbesh" all works but another player can register with the name "dymbesh". How to fix that, and what should i post that you can fix it?
Re: Register Problem -
R0 - 30.05.2014
You cant fix it,its a new feature since 0.3z,and it is better with it
AW: Register Problem -
Blackazur - 30.05.2014
Really?
Re: Register Problem -
Threshold - 30.05.2014
Lol, just ignore him. What you can do, is when a player registers, convert their entire name to lowercase letters. I believe there is a function 'StrToLower' bouncing around on SA-MP forums somewhere. Then this way, when a player tries to join as ThresHOLd, the file 'threshold' is loaded. If someone tries to join as thresHOLD, then 'threshold' is still loaded, meaning you cannot have multiple occurrences of a player's name.
Example:
pawn Код:
//When a player registers:
ConvertStringToLowercase(GetName(playerid), filename); //There are 2 made up functions, that you can create appropriately.
new INI:playerfile = INI_Open(filename); //'filename' would be the path of the user file.
//This creates the player's file with all lowercase letters. I used y_ini as a simple example.
//When a player logs in:
ConvertStringToLowercase(GetName(playerid), filetoload);
INI_ParseFile(filetoload, "LoadUser_%s", ...);
//Load user's file, etc.
EDIT: If this really does confuse you, feel free to send me a PM and I can alter your script for you.