[Duvida]Loops
#1

Tenho uma duvida meu gm tem entre cerca de 48 loops como posso evitar esses loops para naum lagar o servidor;
@Edit

Anti-Flood com settimer pode lagar o servidor ?
Reply
#2

Se forem mto necessarios, otimize-os,
Usa foreach
Reply
#3

Um Exemplo:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
Textdraw4[i] = TextDrawCreate(*********, "_");
TextDrawBackgroundColor(Textdraw4[i], 255);
TextDrawFont(Textdraw4[i], 2);
TextDrawLetterSize(Textdraw4[i], *******, *******);
TextDrawColor(Textdraw4[i], *******);
TextDrawSetOutline(Textdraw4[i], 0);
TextDrawSetProportional(Textdraw4[i], 1);
TextDrawSetShadow(Textdraw4[i], 0);
}
como uso o foreach nesse /\
Reply
#4

pawn Код:
foreach(Player,i)
{
    Textdraw4[i] = TextDrawCreate(*********, "_");
    TextDrawBackgroundColor(Textdraw4[i], 255);
    TextDrawFont(Textdraw4[i], 2);
    TextDrawLetterSize(Textdraw4[i], *******, *******);
    TextDrawColor(Textdraw4[i], *******);
    TextDrawSetOutline(Textdraw4[i], 0);
    TextDrawSetProportional(Textdraw4[i], 1);
    TextDrawSetShadow(Textdraw4[i], 0);
}
Reply
#5

Quote:
Originally Posted by |_MeGaTroN_|
Посмотреть сообщение
Um Exemplo:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
Textdraw4[i] = TextDrawCreate(*********, "_");
TextDrawBackgroundColor(Textdraw4[i], 255);
TextDrawFont(Textdraw4[i], 2);
TextDrawLetterSize(Textdraw4[i], *******, *******);
TextDrawColor(Textdraw4[i], *******);
TextDrawSetOutline(Textdraw4[i], 0);
TextDrawSetProportional(Textdraw4[i], 1);
TextDrawSetShadow(Textdraw4[i], 0);
}
como uso o foreach nesse /\
Coloca na public OnPlayerConnect, nгo й necessбrio criб-lo na OGMI
Reply
#6

mais na onplayerconnect naum causara lag ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)