SA-MP Forums Archive
User registration/Login glitch - 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: User registration/Login glitch (/showthread.php?tid=171604)



User registration/Login glitch - 666 - 27.08.2010

I've got a pretty big problem with the script I'm using. My server is running on a LARP edit, and some people get that problem. They register an account, everything works etc, but when they come back, instead of login, they have to register again. Actually their stats are saved and user.ini file is in /users, but it acts like the user wouldn't be there. /login works at that point, but that still is a very bad bug.
Quote:

format(string, sizeof(string), "users/%s.ini", plname);
SendClientMessage(playerid, COLOR_YELLOW2, "Loading users from DataBase! Please Wait!");
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
//return 1;
}
else
{
gPlayerAccount[playerid] = 0;
//return 1;
}

This is the thing which should sort out new users from registered ones. But it sometimes malfunctions. It doesn't happen very often, but about every 10th user gets that error.

And please don't tell me to ask this in the LARP thread, because nobody ever answers.


Re: User registration/Login glitch - 666 - 27.08.2010

Any help please? :S


Re: User registration/Login glitch - Kyosaur - 27.08.2010

Quote:
Originally Posted by 666
Посмотреть сообщение
Any help please? :S
We need more code than that lol. Post the entire thing?


Re: User registration/Login glitch - 666 - 27.08.2010

Here goes.
http://pastebin.com/uBpaSb3Z

OnPlayerConnect, OnPlayerRequestClass, OnDialogResponse, OnPlayerLogin and OnPlayerRegister. Everything that has to do with this account thing. I still don't think it's a matter of script though. The server sometimes can and sometimes can't read that userfile.ini.

Really would like to solve this, huge problem for me.

Note that sometimes you can /login manually, sometimes it won't let you do that either and you have to register again, even though the userfile.ini is still in the scriptfiles/users folder.
Sometimes that error doesn't occurr at all.

I'd like to remind you that it's LARP we're dealing with, I also read there was other people with this problem, no solution though.


Re: User registration/Login glitch - Kyosaur - 27.08.2010

Quote:
Originally Posted by 666
Посмотреть сообщение
Here goes.
http://pastebin.com/uBpaSb3Z

OnPlayerConnect, OnPlayerRequestClass, OnDialogResponse, OnPlayerLogin and OnPlayerRegister. Everything that has to do with this account thing. I still don't think it's a matter of script though. The server sometimes can and sometimes can't read that userfile.ini.

Really would like to solve this, huge problem for me.

Note that sometimes you can /login manually, sometimes it won't let you do that either and you have to register again, even though the userfile.ini is still in the scriptfiles/users folder.
Sometimes that error doesn't occurr at all.

I'd like to remind you that it's LARP we're dealing with, I also read there was other people with this problem, no solution though.
Ohh wow thats ...a big mess. If al gore saw this code, he'd give you a hour long lecture about how you need to start recycling some of your variables!

before i even ATTEMPT to make this code out, im going to give you this:

https://sampforum.blast.hk/showthread.php?tid=38965&page=98

Scroll down to GetRolePlayName and IsRolePlayName. The way your checking and handling the names is very bad, i suggest you at least take a look at these functions :P.


Re: User registration/Login glitch - Claude - 27.08.2010

Give us the place where you store the user data, that might cause the problem


Re: User registration/Login glitch - 666 - 27.08.2010

Quote:
Originally Posted by Claude
Посмотреть сообщение
Give us the place where you store the user data, that might cause the problem
What do you mean? User data is stored in root/scriptfiles/users as in default LARP. As for the previous poster mentioning the mess, it's pretty much basic LARP at these parts.


Re: User registration/Login glitch - 666 - 29.08.2010

Bump.....