05.08.2019, 16:09
Quote:
Kane was right, if you had read the whole script, you could have spotted some issues.
Mysql connection wasn't close at OnGameModeExit. Player Name is stored in database but no idea why it was not used in script instead using GetPlayerName everytime! `Users` and `USERS` should be `users` in onplayerconnect and OnPlayerDisconnect callback! There is no need to login after the player register. It can be done by pawn Code:
When player disconnect, you should check if player logged in (after login/register) , so the data will be saved in mysql. What if a player logins with an another player name and exist the server (Calls OnPlayerDisconnect)? or what if a player mistype his password and kicked out? It will save the player's current position and will be stored into the database under the player name. So, that's why the script needs a login variable. Anyways Good work! |
About login variable, I agree with you.... There should be a Login Check variable so that there is no issue.
about closing connection, I think when server is not active, it will kill off the connection automatically... but doesnt hurt adding it there.