Player becomes admin when registers(MYSQL)
#9

Quote:
Originally Posted by FunnyBear
Посмотреть сообщение
Hey,

I have a MySQL system and I found out that there was something wrong. When a new player joins, they become an Admin. I think its when someone joins with the same ID as the previous player, they get the same info or something. But it seems to only happen when they register, I think its fine when you have already registered and are logging in.

Is there a way to fix this?
in addition to clearing the variables on OnPlayerDisconnect(..) you should also make the register part write a set of default values into the database.

Perhaps, do something like this:
"INSERT INTO `table` (level, name, money, etc..) VALUES (0, name, 0, etc..)"
.. where you directly write level as 0 and all other values/integers as 0.
Then you will make sure to avoid the incorrect values, at least when registering.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)