CreateEntityByName("game_text"); * 30 человек = var 50+

Banana

Участник
Сообщения
892
Реакции
113
PHP:
SPrintToHUD_temp(client, format , "78939", "200 0 150", "255 255 255", "0", "0.1", "0.1", "0.0", "1.0", "0", "0.01", "0.91"); //Функция вызывается каждую секунду в таймере для каждого игрока на сервере (показывает кредиты на экране).

void SPrintToHUD_temp(int client, char message[196], char channel[32], char color1[16], char color2[16], char effect[5], char fadein[12], char fadeout[12], char fxtime[12], char holdtime[12], char spawnflags[5], char x[12], char y[12])
{
    int ent = CreateEntityByName("game_text");
    DispatchKeyValue(ent, "channel", channel);
    DispatchKeyValue(ent, "color", color1);
    DispatchKeyValue(ent, "color2", color2);
    DispatchKeyValue(ent, "effect", effect);
    DispatchKeyValue(ent, "fadein", fadein);
    DispatchKeyValue(ent, "fadeout", fadeout);
    DispatchKeyValue(ent, "fxtime", fxtime);  
    DispatchKeyValue(ent, "holdtime", holdtime);
    DispatchKeyValue(ent, "message", ("%s", message));
    DispatchKeyValue(ent, "spawnflags", spawnflags);
    DispatchKeyValue(ent, "x", x);
    DispatchKeyValue(ent, "y", y);
    DispatchSpawn(ent);
    SetVariantString("!activator");
    AcceptEntityInput(ent,"display",client);
    AcceptEntityInput(ent, "Kill");
}

CreateEntityByName("game_text"); * 30 человек = var 50+

Кто сталкивался с этим? это фиксится? (SourceMod Version: 1.10.0.6502)
 

Wend4r

I'm Source Engine masochist
Сообщения
107
Реакции
432
* 30 человек = var 50+
Предполагаю, что слишком много game_text(ов) спавнится, вот и сервер барахлит.
Оффтоп
C:
void SPrintToHUD_temp(int client, char message[196], char channel[32], char color1[16], char color2[16], char effect[5], char fadein[12], char fadeout[12], char fxtime[12], char holdtime[12], char spawnflags[5] = NULL_STRING, char x[12], char y[12])
{
    int iColor[4], iColor2[4];

    StringToColor(color1, iColor);
    StringToColor(color2, iColor2);

    SetHudTextParamsEx(StringToFloat(x), StringToFloat(y), StringToFloat(holdtime), iColor, iColor2, StringToInt(effect), StringToFloat(fxtime), StringToFloat(fadein), StringToFloat(fadeout));
    ShowHudText(client, StringToInt(channel), "%s", message);
}

bool StringToColor(const char[] sColorStr, int iColor[4])
{
    char sSplitter[4][4];

    if(ExplodeString(sColorStr, " ", sSplitter, sizeof(sSplitter), sizeof(sSplitter[])) == 4)
    {
        iColor[0] = StringToInt(sSplitter[0]);
        iColor[1] = StringToInt(sSplitter[1]);
        iColor[2] = StringToInt(sSplitter[2]);
        iColor[3] = StringToInt(sSplitter[3]);

        return true;
    }

    return false;
}
 
Последнее редактирование:
Сверху Снизу