16.03.2016, 20:37
Hey guys, i have a problem. I have a problem, where i scan through all the players on the database and they added up to 13k... Now when i scan through the database it takes a while for it to scan and it lags up the whole server, other players show up AFK. example:
query
public:
This produces lag on the whole server. Is there a way around lag, other than deleting the players? Thank you.
query
Код:
mysql_tquery(mysql, "SELECT Vardas,Specialybe,Siandien,Dispejimai FROM vartotojai ORDER BY XP", "darbuotojai", "i", playerid);
Код:
public darbuotojai(playerid)
{
new PRAZAIDZIAUX;
new PLAYERANMESAVEq[ MAX_PLAYER_NAME ];
new PLAYERSPECIALYBE;
new SAVESTRINGtqx5[ 3000 ];
new PLAYERSTATUSqq[ 40 ];
new ISPEJIMAIDKASD;
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
for(new i=0; i<rows; i++)
{
cache_get_field_content(i, "Vardas", PLAYERANMESAVEq, mysql, 25);
PLAYERSPECIALYBE = cache_get_field_content_int(i, "Specialybe");
PRAZAIDZIAUX = cache_get_field_content_int(i, "Siandien");
ISPEJIMAIDKASD = cache_get_field_content_int(i, "Dispejimai");
if(GETPLAYERJOBFROMFACTION( playerid ) == PLAYERSPECIALYBE )
{
if( GetPlayerIdFromNameEx( playerid, PLAYERANMESAVEq) == INVALID_PLAYER_ID )PLAYERSTATUSqq = "{FF0000}neprisijunges";
else
{
PLAYERSTATUSqq = "{00FF00}prisijunges";
}
format( SAVESTRINGtqx5,3000,"%s{AECEB3}%s {B4C877}(%s{B4C877}) (siandien zaide: {AECEB3}%d {B4C877}min.) ({AECEB3}%d {B4C877}ispejimu(-as))\n",SAVESTRINGtqx5,PLAYERANMESAVEq,PLAYERSTATUSqq,PRAZAIDZIAUX,ISPEJIMAIDKASD );
}
}
strcat( SAVESTRINGtqx5,"\n\nIsmesti darbuotoja irasykite jo pilna varda:");
ShowPlayerDialog(playerid,1879,DIALOG_STYLE_INPUT,"{A3E4FF}Darbuotojai",SAVESTRINGtqx5,"Gerai","Iseiti");
}
return 1;
}


