ziggi / rustext

Fix Russian text plugin for SA-MP: GameText's, TextDraw's and Menu's
MIT License
17 stars 3 forks source link

баг PlayerTextDrawSetString #10

Closed ghost closed 5 months ago

ghost commented 5 months ago

привет, ты же недавно релизнул его под опен.мп, так вот, обнаружил еще один баг, он почему то ругается в конфиге xt: Incorrect parameter count for "PlayerTextDrawSetString", 3 != 4

[2024-05-01T15:42:22+0300] [Info] * rustext: Incorrect parameter count for "PlayerTextDrawSetString", 3 != 4

обрати внимание, текст в центре, а текст должен быть внизу. image

ziggi commented 5 months ago

Попробуй использовать инклуды из SA-MP, а не из open.mp. А на положение текста эта функция никак не влияет.

ghost commented 5 months ago

Не понял совсем) Какие именно инклуды?

ziggi commented 5 months ago

Те, что находятся в папке pawno\include, ты поставил от open.mp, поставь от SA-MP.

ghost commented 5 months ago

Всё равно

ghost commented 5 months ago

Проще сейчас вам тестить и уже отписать потом.

ziggi commented 5 months ago

Я тестировал в 2016, с тех пор ничего не поменялось кроме того, что я уже написал. Так что сделай то, что я написал, за тебя это никто делать не будет.

ghost commented 5 months ago

Ну так если использовать инклуды SAMP, то как людям играть на опен.мп? Или это ничего не будет?

ziggi commented 5 months ago

open.mp нормально работает как со своими так и с SA-MP инклудами.

ghost commented 5 months ago

я поставил инклуды от SA-MP, все равно та же

ziggi commented 5 months ago

Скрипт перекомпилировал с ними? Я проверил, всё работает нормально.

ghost commented 5 months ago

да, перекомпилировал image

ziggi commented 5 months ago

И что на этом скриншоте не так?

ghost commented 5 months ago

Английский язык не совмещают с плагином rustext?

ghost commented 5 months ago

Дело в том что я делаю проект для русских и англичанов. Тут текстдравы багаются.

ziggi commented 5 months ago

Не понял, что багается? Если что, этот плагин не переводит английский текст на русский.

ghost commented 5 months ago

да я знаю что плагин не переводит англ яз на русский

сейчас тебе скину скрин и поймешь все

до заливки плагина image

после заливки плагина image

ziggi commented 5 months ago

Дак код этого текстдрава то скинь

ghost commented 5 months ago
ShowPlayerBox(playerid, type, text[], time = 0)
{
    KillTimer(g_boxTimer[playerid]);

    switch(type)
    {
        case 1: 
        {
            PlayerTextDrawSetString(playerid, ui_box[playerid], text);
            PlayerTextDrawShow(playerid, ui_box[playerid]);
        }
        case 2: 
        {
            PlayerTextDrawSetString(playerid, ui_text[playerid], text);
            PlayerTextDrawShow(playerid, ui_text[playerid]);
        }
    }

    if(time > 0) g_boxTimer[playerid] = SetTimerEx("HidePlayerBox", time, false, "i", playerid);
    return 1;
}

ui_text[playerid] = CreatePlayerTextDraw(playerid, 330.000000, 385.000000, "");
    PlayerTextDrawLetterSize(playerid, ui_text[playerid], 0.250000, 1.000000);
    PlayerTextDrawTextSize(playerid, ui_text[playerid], 0.000000, 500.000000);
    PlayerTextDrawAlignment(playerid, ui_text[playerid], 2);
    PlayerTextDrawColor(playerid, ui_text[playerid], 0xFFFFFFFF);
    PlayerTextDrawUseBox(playerid, ui_text[playerid], 0);
    PlayerTextDrawBoxColor(playerid, ui_text[playerid], 0x80808080);
    PlayerTextDrawSetShadow(playerid, ui_text[playerid], 0);
    PlayerTextDrawSetOutline(playerid, ui_text[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, ui_text[playerid], 0x000000FF);
    PlayerTextDrawFont(playerid, ui_text[playerid], 1);
    PlayerTextDrawSetProportional(playerid, ui_text[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ui_text[playerid], 0);

    ui_box[playerid] = CreatePlayerTextDraw(playerid, 15.000000, 200.000000, "");
    PlayerTextDrawLetterSize(playerid, ui_box[playerid], 0.380000, 1.570000);
    PlayerTextDrawTextSize(playerid, ui_box[playerid], 172.000000, -3.000000);
    PlayerTextDrawAlignment(playerid, ui_box[playerid], 0);
    PlayerTextDrawColor(playerid, ui_box[playerid], 0xCCCCCCFF);
    PlayerTextDrawUseBox(playerid, ui_box[playerid], 1);
    PlayerTextDrawBoxColor(playerid, ui_box[playerid], 0x000000AA);
    PlayerTextDrawSetShadow(playerid, ui_box[playerid], 2);
    PlayerTextDrawSetOutline(playerid, ui_box[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, ui_box[playerid], 0xFFFFFF00);
    PlayerTextDrawFont(playerid, ui_box[playerid], 1);
    PlayerTextDrawSetProportional(playerid, ui_box[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ui_box[playerid], 0);
ziggi commented 5 months ago

Вот что ты мне дал и оно так отображается вне зависимости от наличия плагина. image

Короче, разбирайся сам.

ghost commented 5 months ago

непонятно что за это фигня, можешь закрыть, исправил бы свой плагин. спасибо за подсказку, ладно

ziggi commented 5 months ago

Вот у меня так всё отображается с плагином и без: image

Вот код:

#include <a_samp>
#include "rustext"
#include "zcmd"

new PlayerText:ui_text[MAX_PLAYERS];
new PlayerText:ui_box[MAX_PLAYERS];

stock CreateTD(playerid)
{
    ui_text[playerid] = CreatePlayerTextDraw(playerid, 330.000000, 385.000000, "_");
    PlayerTextDrawLetterSize(playerid, ui_text[playerid], 0.250000, 1.000000);
    PlayerTextDrawTextSize(playerid, ui_text[playerid], 0.000000, 500.000000);
    PlayerTextDrawAlignment(playerid, ui_text[playerid], 2);
    PlayerTextDrawColor(playerid, ui_text[playerid], 0xFFFFFFFF);
    PlayerTextDrawUseBox(playerid, ui_text[playerid], 0);
    PlayerTextDrawBoxColor(playerid, ui_text[playerid], 0x80808080);
    PlayerTextDrawSetShadow(playerid, ui_text[playerid], 0);
    PlayerTextDrawSetOutline(playerid, ui_text[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, ui_text[playerid], 0x000000FF);
    PlayerTextDrawFont(playerid, ui_text[playerid], 1);
    PlayerTextDrawSetProportional(playerid, ui_text[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ui_text[playerid], 0);

    ui_box[playerid] = CreatePlayerTextDraw(playerid, 15.000000, 200.000000, "_");
    PlayerTextDrawLetterSize(playerid, ui_box[playerid], 0.380000, 1.570000);
    PlayerTextDrawTextSize(playerid, ui_box[playerid], 172.000000, -3.000000);
    PlayerTextDrawAlignment(playerid, ui_box[playerid], 0);
    PlayerTextDrawColor(playerid, ui_box[playerid], 0xCCCCCCFF);
    PlayerTextDrawUseBox(playerid, ui_box[playerid], 1);
    PlayerTextDrawBoxColor(playerid, ui_box[playerid], 0x000000AA);
    PlayerTextDrawSetShadow(playerid, ui_box[playerid], 2);
    PlayerTextDrawSetOutline(playerid, ui_box[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, ui_box[playerid], 0xFFFFFF00);
    PlayerTextDrawFont(playerid, ui_box[playerid], 1);
    PlayerTextDrawSetProportional(playerid, ui_box[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ui_box[playerid], 0);

    return 1;
}

public OnFilterScriptInit()
{
    for (new i = 0; i < MAX_PLAYERS; i += 1) {
        if (!IsPlayerConnected(i)) {
            continue;
        }

        CreateTD(i);
    }

    return 1;
}

public OnFilterScriptExit()
{
    for (new i = 0; i < MAX_PLAYERS; i += 1) {
        if (!IsPlayerConnected(i)) {
            continue;
        }

        PlayerTextDrawDestroy(i, ui_text[i]);
        PlayerTextDrawDestroy(i, ui_box[i]);
    }

    return 1;
}

public OnPlayerSpawn(playerid)
{
    CreateTD(playerid);

    return 1;
}

CMD:show(playerid, params[])
{
    PlayerTextDrawShow(playerid, ui_text[playerid]);
    PlayerTextDrawShow(playerid, ui_box[playerid]);

    return 1;
}

CMD:hide(playerid, params[])
{
    PlayerTextDrawHide(playerid, ui_text[playerid]);
    PlayerTextDrawHide(playerid, ui_box[playerid]);

    return 1;
}

CMD:test(playerid, params[])
{
    PlayerTextDrawSetString(playerid, ui_text[playerid], "Engine ~r~off~w~, press the N key to start the engine.");
    PlayerTextDrawShow(playerid, ui_text[playerid]);

    return 1;
}

CMD:test2(playerid, params[])
{
    PlayerTextDrawSetString(playerid, ui_box[playerid], "Engine ~r~off~w~, press the N key to start the engine.");
    PlayerTextDrawShow(playerid, ui_box[playerid]);

    return 1;
}
ghost commented 5 months ago

Перенес спидометр, все та же ошибка дает

ghost commented 5 months ago

image так же так стоит

ghost commented 5 months ago

то что ты мне кидал скрин и код, это потому что ты используешь SA-MP версию, а не омп. Ну типо у тебя на сервере стоит версия САМП, а не omp. Лучше качай omp-server.exe и компоненты и сам поймешь

ziggi commented 5 months ago

то что ты мне кидал скрин и код, это потому что ты используешь SA-MP версию, а не омп. Ну типо у тебя на сервере стоит версия САМП, а не omp. Лучше качай omp-server.exe и компоненты и сам поймешь

Я проверял как в сампе, так и в опенмп, везде результат одинаковый.

ghost commented 5 months ago

что за фигня.... можешь вк скинуть свой?

ziggi commented 5 months ago

Я не учитель программирования, с этими проблемами нужно обращаться куда-то в другое место.