Random players have corrupted data.
#1

Hi guys

I'm facing a very annoying bug that occurs occasionally.
Whenever a player connects to my server, the server will reset his data. For example:

pawn Код:
PlayerInfo[playerid][AdminLevel] = 0;
PlayerInfo[playerid][Level] = 0;
Now occasionally, this resetted data will be applied on a player when he connects/logs in/registers.

Does anyone know how to fix this? Because I ran out of possibilities.
If you are in need of some code, let me know which part.
Reply
#2

Maybe your meant to put it under your own such as ; Savechar or something, you may of put it under when a player spawns or connects!
Reply
#3

Quote:
Originally Posted by MrCallum
Посмотреть сообщение
Maybe your meant to put it under your own such as ; Savechar or something, you may of put it under when a player spawns or connects!
Not sure what you mean.
The player's data gets resetted under OnPlayerConnect.
The player's data gets loaded under OnPlayerRequestSpawn (When his file exists, login dialog) and in the login dialog itself.
Reply
#4

You can reset the data after know if he is registered or not :P
Reply
#5

You should reset player data OnPlayerConnect, and load everything at the moment they log in. (The moment they type to correct password)
Reply
#6

Quote:
Originally Posted by Threshold
Посмотреть сообщение
You should reset player data OnPlayerConnect, and load everything at the moment they log in. (The moment they type to correct password)
This results in me being able to log in with every string I type in.

Quote:
Originally Posted by rodrijose2009
Посмотреть сообщение
You can reset the data after know if he is registered or not :P
I could try that when my current idea doesn't work.

I made a timer so the loading of the player's data gets delayed a bit, giving the resetting enough time to execute.
I hope that works.
Reply
#7

OnPlayerConnect: Reset variables, load user password ONLY.
OnPlayerLogin: Load all user statistics.

Simple..
Reply
#8

Quote:
Originally Posted by Threshold
Посмотреть сообщение
OnPlayerConnect: Reset variables, load user password ONLY.
OnPlayerLogin: Load all user statistics.

Simple..
Sorry, didn't quite understand you the previous time.
It works now, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)