Player Problem (MYSQL) - 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: Player Problem (MYSQL) (
/showthread.php?tid=467884)
Player Problem (MYSQL) -
NeroX98 - 05.10.2013
Hi guys.
I have server which has 30+ players but i've shutted down to make it MySQL... Now im trying to start it 2-3 times but everytime i fail. The problem is that when 30+ player join on the server, MySQL server for them doesn't work...
Example: I'm ID 1 and i've logged succsessfully and my stats will save.
Example: ID 30 doesn't have account and sometimes he doesnt get dialog to register (because MySQL doesn't check his account) or when he passes the register dialog, MySQL doesn't create table... I dont have mysql_log so there are no errors... MySQL works perfectly for 25 players, but from 25+ it messes up !
HELP (i use the newest mysql plugin r33)
Re: Player Problem (MYSQL) -
DanishHaq - 05.10.2013
Make sure you're using R33 effectively, and let's have a look at some code to see how your players are logging in / registering etc..
Re: Player Problem (MYSQL) -
NeroX98 - 05.10.2013
Okey
Checking players on OnPlayerConnect (After +30 players OnPlayerConnect doesn't even call):
pawn Code:
new szDestination[100];
format(szDestination,sizeof(szDestination), "SELECT * FROM `Igraci` WHERE pProfil = '%s'",plname);
mysql_function_query(1,szDestination,true,"CheckAccountExists","i",playerid);
pawn Code:
forward CheckAccountExists(playerid);
public CheckAccountExists(playerid)
{
if(!IsPlayerConnected(playerid)) return 1; // Ako igracot slucajno se isklucil za da ne ja poebe databazata
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
gPlayerAccount[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 2;
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
new query[264];
format(query,sizeof(query), "SELECT * FROM `Igraci` WHERE pProfil = '%s'", playername2);
mysql_function_query(1,query,true,"VcituvanjePodatoci","ds",playerid, playername2);
}
return 1;
}
pawn Code:
forward VcituvanjePodatoci(playerid, ime[]);
public VcituvanjePodatoci(playerid, ime[])
{
if(!IsPlayerConnected(playerid)) return 1; // Ako igracot slucajno se isklucil za da ne ja poebe databazata
new rows, fields;
cache_get_data(rows, fields);
new podatok[64];
cache_get_row(0, 0, podatok);
PlayerInfo[playerid][pIgracID] = strval(podatok);
//etc
return 1;
}
Re: Player Problem (MYSQL) -
NeroX98 - 06.10.2013
Bump...
After 30 player OnPlayerConnect isn't called... HELP !