Input Dialog Freezes - 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)
+--- Thread: Input Dialog Freezes (
/showthread.php?tid=512631)
Input Dialog Freezes -
austin070 - 11.05.2014
My account system seems like it should be working 100%. It does register players and log them in how it's supposed to, but when a player is in game and the server is restarted, the dialog freezes when the player reconnects (meaning no text can be entered and you have to ctrl+alt+del to exit). Additionally, if the server has been sitting for a while, the dialog does not show up at all. If you connect normally when the server is fresh, it works just as it should.
pawn Код:
public OnPlayerConnect(playerid)
{
new query[256];
format(query, sizeof(query), "SELECT `user` FROM `playerdata` WHERE user = '%s'", GetPName(playerid));
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
if(rows != 0)
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""Blue"Please log-in", ""White"Welcome back to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to log-in!\n\n"White"Please insert "Red"your"White" password below:", "Login", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""Blue"Please register",""White"Welcome to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to register!\n\n"White"Please insert a password below:", "Register", "Cancel");
}
return 1;
}
AW: Input Dialog Freezes -
Macronix - 11.05.2014
Have you tried it without these color words (for example "Blue") ?
Re: AW: Input Dialog Freezes -
austin070 - 11.05.2014
Quote:
Originally Posted by Macronix
Have you tried it without these color words (for example "Blue") ?
|
I was thinking that could be it but I don't see how that would freeze it. I can try it without them.
EDIT: It wasn't the problem.
Re: Input Dialog Freezes -
austin070 - 11.05.2014
Quote:
Originally Posted by Ralfie
Restarted as gmx? or a crash?
if as for gmx
i suggest kicking all player under OnGameModeExit...
|
That's a way to avoid the problem. I'm trying to fix it.
Re: Input Dialog Freezes -
austin070 - 11.05.2014
Quote:
Originally Posted by Ralfie
Well i know, but i believe the problem isn't with the dialog!
Its with loading mysql data from OnGameModeInt... then calling OnPlayerConnect as for fetching the information at the same moment when the player connects... which will cause the player to freeze/crash...
Try delaying the dialog display time, or displaying the dialog under OnPlayerRequestClass to give time for the information to load.
|
I'm not sure that's the issue because when I rescripted it on a test script it didn't do this. The problem with that is I don't know what the difference is between the two scripts.
EDIT: something has to be conflicting with it. I put a fully working one in and it does the same thing.