[Problem] Lags when send message to all players
#1

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...
Reply
#2

why not use SendClientMessageToAll(); ? that loop wouldn't freeze the server, it'd be something in the loop
Reply
#3

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 :\
Reply
#4

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.
Reply
#5

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 :]
Reply
#6

Also use foreach by ******, so you don't have to send a message 500 times ( if you have it defined as that )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)