Server doesnt let more than 10 players to log in (mysql bug) - 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: Server doesnt let more than 10 players to log in (mysql bug) (
/showthread.php?tid=645754)
Server doesnt let more than 10 players to log in (mysql bug) -
AlexMSK - 03.12.2017
Hi all, i'm trying to make a event point system, /winers based in mysql.
So yea heres the command.
PHP код:
CMD:winers(playerid, parmas[])
{
mysql_tquery(sql_connect, "SELECT * FROM `users` ORDER BY `eventpoints` DESC LIMIT 10", "OnQueryFinishup", "ii", THREAD_EVENTWINER, playerid);
return 1;
}
case THREAD_EVENTWINER:
{
new username[MAX_PLAYER_NAME], eventpoints[24];
SendClientMessage(extraid, COLOR_GREEN, "---- Event Winners ----");
for(new i = 0; i < rows; i ++)
{
cache_get_field_content(i, "username", username);
cache_get_field_content(i, "eventpoints", eventpoints);
SendClientMessageEx(extraid, COLOR_GREY2, "%s - Event points: %d", username, eventpoints);
}
}
Now everything runs fine, there's no mysql error given i cant get more than 10 players in the server, it start crashing the others for some reason, probably i missed up something?
Re: Server doesnt let more than 10 players to log in (mysql bug) -
doreto - 03.12.2017
What
OnPlayerConnect with MySQL has to do with this command ?
Either your title is misleading or you have posted wrong code.
Re: Server doesnt let more than 10 players to log in (mysql bug) -
AlexMSK - 03.12.2017
Nothing man i just created this command right now
case THREAD_EVENTWINER: is under OnQueryFinishup
Re: Server doesnt let more than 10 players to log in (mysql bug) -
Hunud - 03.12.2017
What about this and number 10 in it ?
Код:
mysql_tquery(sql_connect, "SELECT * FROM `users` ORDER BY `eventpoints` DESC LIMIT 10", "OnQueryFinishup", "ii", THREAD_EVENTWINER, playerid);
Re: Server doesnt let more than 10 players to log in (mysql bug) -
Banana_Ghost - 04.12.2017
Quote:
Originally Posted by Hunud
What about this and number 10 in it ?
Код:
mysql_tquery(sql_connect, "SELECT * FROM `users` ORDER BY `eventpoints` DESC LIMIT 10", "OnQueryFinishup", "ii", THREAD_EVENTWINER, playerid);
|
All the LIMIT 10 does is it finds the first 10 results from your query and thats it.