05.08.2019, 16:27
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! |
Quote:
MySQL is not case sensitive lmao.. USERS and users and uSeRs are considered same. About login, Its nothing wrong. A lot of servers and even lots of websites asks for login after register. Doesnt directly logs them in. It depends on everyone's style hahah..
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. |
1> Fixed connection not closed and added saving data OnGameModeExit too.
2> Added Login check- Thanks to SiaReyes. I knew I was forgetting something.. thanks for reminding me..
3> Well yeah, about login thing... Its my way of showing Login dialog after registering. Everyone's way is different as GeorgeMcReary said..
4> Player name is saved in database for login purposes. I dont save them from database on a variable because it looks stupid to me. Again, everyone's way is different. Someone saves them into variable each time player logs in, someone uses GetPlayerName.. none methods are wrong.
No harm done. I always accept criticism, and take it positively.