[Problem] Lags when send message to all players - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Problem] Lags when send message to all players (
/showthread.php?tid=190852)
[Problem] Lags when send message to all players -
XePloiT - 16.11.2010
well... when i using something which suppose to send something to all the player (mainly messages)
then the chat stuck for some time (10~30 secs)...
when i use:
Код:
for(new i=0;i<MAX_PLAYERS;i++)
hm I'm started to use Mysql... most of the INCLUDES are in an inc file (also the sql commands and functions)
i don't know if it matters...
Re: [Problem] Lags when send message to all players -
cessil - 17.11.2010
why not use SendClientMessageToAll(); ? that loop wouldn't freeze the server, it'd be something in the loop
Re: [Problem] Lags when send message to all players -
XePloiT - 17.11.2010
sure its made it better thanks...
but the problem not solved i still have to use for(new i=0;i<MAX_PLAYERS;i++)
cuz i need to send messages only to admin and give to all players cash
and stuff like that..
i have to mention that this is started after i started using mysql :\
Re: [Problem] Lags when send message to all players -
Scenario - 17.11.2010
Quote:
Originally Posted by XePloiT
sure its made it better thanks...
but the problem not solved i still have to use for(new i=0;i<MAX_PLAYERS;i++)
cuz i need to send messages only to admin and give to all players cash
and stuff like that..
i have to mention that this is started after i started using mysql :\
|
If you are logging the string into the MySQL database you are most likely going to end up with a small amount of lag, but that truly matters on the string size and the speed at which it connects to the database.
Re: [Problem] Lags when send message to all players -
XePloiT - 17.11.2010
i took care of it...just did at OnPlayerConnect...
PlayerInfo[MAX_PLAYERS][pInfo]=.....SQL......;
so when the player connects its takes the data and then i just use it and this is not lag :]
Re: [Problem] Lags when send message to all players - [L3th4l] - 17.11.2010
Also use foreach by ******, so you don't have to send a message 500 times ( if you have it defined as that )