R1KO / VIP-Core

GNU General Public License v3.0
50 stars 34 forks source link

Support for breaking lines in messages #93

Open crashzk opened 2 years ago

crashzk commented 2 years ago

I'm using version [VIP] Core (3.1 DEV) by R1KO, I would like to know if it would be possible to add line breaks to messages that can be translated.

In this case it would be the messages from the file info.ini, located in the folder addons/sourcemod/data/vip/cfg/.

R1KO commented 2 years ago

I'm using version [VIP] Core (3.1 DEV) by R1KO, I would like to know if it would be possible to add line breaks to messages that can be translated.

In this case it would be the messages from the file info.ini, located in the folder addons/sourcemod/data/vip/cfg/.

yeah. use \n for this

crashzk commented 2 years ago

I've tried, it did not work.

R1KO commented 2 years ago

I've tried, it did not work.

give me example

crashzk commented 2 years ago

Translations pt:

"VIP_INFO"
{
    "connect_info_time" // Сообщение для VIP-игрока при входе на сервер (когда вип на время)
    {
        //  {NAME}      - Ник игрока
        //  {GROUP}     - Группа игрока
        //  {TIMELEFT}  - Через сколько истекает VIP-статус
        //  {EXPIRES}   - Когда истекает VIP-статус

        "chat"      // Сообщение в чат
        {
            "ru"        "{DEFAULT}Здравствуйте, {GREEN}{NAME}{DEFAULT}! Вы являетесь {GREEN}VIP-игроком{DEFAULT}. Ваш VIP статус истекает {GREEN}{EXPIRES}"
            "en"        "{DEFAULT}Hello, {GREEN}{NAME}{DEFAULT}! You have {GREEN}VIP features {DEFAULT}for {GREEN}{EXPIRES}"
            "pt"        "{GREEN}{NAME} {DEFAULT}obrigado por adquirir {GREEN}{GROUP}{DEFAULT} em nossos servidores, saiba que sem você a {GREEN}ZK Servidores™ {DEFAULT}não poderia existir! {RED}❤\n\nLembre-se de digitar {GREEN}!vip {DEFAULT}para ver todos seus privilégios.\n"
        }
        "menu"      // Сообщение в меню
        {
            "time"      "4" // Через сколько секунд меню будет закрыто автоматически (0 - пока игрок сам не закроет)
            "ru"
            {
                // Пукнты меню
                "item"  "Вы имеете VIP-статус"
                "item"  "SPACER"
                "item"  "Ник: {NAME}"
                "item"  "Группа: {GROUP}"
                "item"  "Истекает: {EXPIRES}"
                "item"  "Истекает через: {TIMELEFT}"
            }
            "en"
            {
                "item"  "You have a VIP-status"
                "item"  "SPACER"
                "item"  "Nick: {NAME}"
                "item"  "Group: {GROUP}"
                "item"  "Expires: {EXPIRES}"
                "item"  "Expires in: {TIMELEFT}"
            }
            "pt"
            {
                "item"  "Você tem privilégios no servidor"
                "item"  "SPACER"
                "item"  "Nick: {NAME}"
                "item"  "Privilégios: {GROUP}"
                "item"  "Expira: {EXPIRES}"
                "item"  "Expira em: {TIMELEFT}"
            }
        }
    }
    "connect_info_perm" // Сообщение для VIP-игрока при входе на сервер (когда вип навсегда)
    {
        //  {NAME}  - Ник игрока
        //  {GROUP} - Группа игрока

        "chat"      // Сообщение в чат
        {
            "ru"        "{DEFAULT}Здравствуйте, {GREEN}{NAME}{DEFAULT}! Вы являетесь {GREEN}VIP-игроком{DEFAULT}."
            "en"        "{DEFAULT}Hello, {GREEN}{NAME}{DEFAULT}! You have  {GREEN}VIP features{DEFAULT}."
            "pt"        "{GREEN}{NAME} {DEFAULT}obrigado por adquirir {GREEN}{GROUP}{DEFAULT} em nossos servidores, saiba que sem você a {GREEN}ZK Servidores™ {DEFAULT}não poderia existir! {RED}❤\n\nLembre-se de digitar {GREEN}!vip {DEFAULT}para ver todos seus privilégios.\n"
        }
        "menu"      // Сообщение в меню
        {
            "time"      "4" // Через сколько секунд меню будет закрыто автоматически (0 - пока игрок сам не закроет)
            "ru"
            {
                // Пукнты меню
                "item"  "Вы имеете VIP-статус"
                "item"  "Ник: {NAME}"
                "item"  "Группа: {GROUP}"
            }
            "en"
            {
                "item"  "You have a VIP-status"
                "item"  "Nick: {NAME}"
                "item"  "Group: {GROUP}"
            }
            "pt"
            {
                "item"  "Você tem privilégios no servidor"
                "item"  "Nick: {NAME}"
                "item"  "Privilégios: {GROUP}"
            }
        }
    }
    "no_access_info"    // Сообщение об остутствии VIP-статуса
    {
        "menu"      // Сообщение в меню
        {
            "time"      "4" // Через сколько секунд меню будет закрыто автоматически (0 - пока игрок сам не закроет)
            "ru"
            {
                // Пукнты меню
                "item"  "У вас нет доступа к этому меню"
                "item"  "Чтобы приобрести VIP-статус"
                "item"  "обратитесь к администратору"
            }
            "en"
            {
                "item"  "You do not have access to this menu"
                "item"  "To purchase VIP-status"
                "item"  "contact the administrator"
            }
            "pt"
            {
                "item"  "Você não tem acesso a este comando"
                "item"  "Para adquirir privilégios"
                "item"  "entre em contato conosco"
            }
        }
        "url"       // Ссылка, которую нужно открыть
        {
            "ru"        "http://mysite.ru/vip/no_access.php?lang=ru"
            "en"        "http://mysite.ru/vip/no_access.php?lang=en"
            "pt"        "http://mysite.ru/vip/no_access.php?lang=pt"
        }
    }
    "expired_info"  // Сообщение об истечении VIP-статуса
    {
        "menu"  // Сообщение в меню
        {
            "time"      "4" // Через сколько секунд меню будет закрыто автоматически (0 - пока игрок сам не закроет)
            "ru"
            {
                // Пукнты меню
                "item"  "Срок вашего VIP-статуса истек"
                "item"  "Чтобы вновь приобрести VIP-статус"
                "item"  "Oбратитесь к администратору"
            }
            "en"
            {
                "item"  "Your VIP-status has expired"
                "item"  "To re-purchase VIP-status"
                "item"  "Contact the administrator"
            }
            "pt"
            {
                "item"  "Seus privilégios expirou"
                "item"  "Para adquirir novamente"
                "item"  "Entre em contato conosco"
            }
        }
    }
}
crashzk commented 2 years ago

News? Anything I might have done wrong?

R1KO commented 2 years ago

i will test it tomorrow

crashzk commented 2 years ago

Hi, were you able to test it?

crashzk commented 2 years ago

News? Sorry to even ask about this again, it's really something I'd like to use in the plugin.

crashzk commented 2 years ago

Just an update, even the latest branch version 3.1-dev still doesn't work wrapping lines in file info.ini

R1KO commented 2 years ago

@crashzk check this build please https://github.com/R1KO/VIP-Core/actions/runs/2260015614

crashzk commented 2 years ago

@R1KO it worked and it didn't work... lol

In this case, I already have VIP active on my steam, but when I connect to server I don't receive any message informing that I'm VIP, here's a print.

20220503172116_1

But if I make any changes to the VIP using the command !vipadmin , I get the message that I have a VIP on the server.

20220503172145_1

Another thing would be the character limit, if you cut the message as you can see in the second print, would it be possible to increase this character limit?

R1KO commented 2 years ago

@R1KO it worked and it didn't work... lol

In this case, I already have VIP active on my steam, but when I connect to server I don't receive any message informing

that I'm VIP, here's a print. i noticed it too. When I added a delay before the message - it always worked. I think this is due to the fact that the VIP player loads too quickly and the message is displayed when he is not yet fully on the server

Another thing would be the character limit, if you cut the message as you can see in the second print, would it be possible to increase this character limit?

yep

crashzk commented 2 years ago

i noticed it too. When I added a delay before the message - it always worked. I think this is due to the fact that the VIP player loads too quickly and the message is displayed when he is not yet fully on the server

I see, it would be nice if you could add then again this delay in the message.

yep

Perfect, I would be grateful too so if you can increase this limit, in this case the message is complete in the file configuration but it was cut.

And again, thanks for the support, great plugin.

Other than these bugs, apparently everything is ok now.

crashzk commented 2 years ago

@R1KO news about this fix?

R1KO commented 2 years ago

So far I haven't come up with a good solution.

crashzk commented 2 years ago

Any news about it I'm here. Need help testing just let me know. 😁

crashzk commented 1 year ago

@R1KO just an update, I've retested this version of the line wrap fix.

Due to some updates that were made to the [VIP] ADMIN & [VIP] Admin Privileges plugins the message is being sent correctly now.

Player having VIP he receives the message, and if I add VIP to a new player he receives it too. There was only the question of the character limit now, the complete message is not being sent in this case.

image

R1KO commented 1 year ago

@R1KO just an update, I've retested this version of the line wrap fix.

Due to some updates that were made to the [VIP] ADMIN & [VIP] Admin Privileges plugins the message is being sent correctly now.

Player having VIP he receives the message, and if I add VIP to a new player he receives it too. There was only the question of the character limit now, the complete message is not being sent in this case.

image

yep) i know how fix it but for what?

crashzk commented 1 year ago

In my case it would be just to send the complete message.

Configured to send this message:

"{GREEN}{NAME} {DEFAULT}obrigado por adquirir {GREEN}{GROUP}{DEFAULT} em nossos servidores, saiba que sem você a {GREEN}ZK Servidores™ {DEFAULT}não poderia existir! {RED}❤\n\nLembre-se de digitar {GREEN}!vip {DEFAULT}para ver todos seus privilégios.\n"

As you can see in the screenshot above, he is cutting off the end of the sentence. Would it be possible to increase this character limit just a little bit more?

R1KO commented 1 year ago

In my case it would be just to send the complete message.

Configured to send this message:

"{GREEN}{NAME} {DEFAULT}obrigado por adquirir {GREEN}{GROUP}{DEFAULT} em nossos servidores, saiba que sem você a {GREEN}ZK Servidores™ {DEFAULT}não poderia existir! {RED}❤\n\nLembre-se de digitar {GREEN}!vip {DEFAULT}para ver todos seus privilégios.\n"

As you can see in the screenshot above, he is cutting off the end of the sentence. Would it be possible to increase this character limit just a little bit more?

don't get your hopes up) players won't read it all, I  tell from my own experience. More often than not, they won't even see this message. If you want to attract the player's attention - use the menu

crashzk commented 1 year ago

I understand, in this case I use both menu and chat features. In any case, if it's not a big change and you can just tell me to apply it to my version, it helps too, but thanks for the feedback.

About the support for breaking lines, I believe this issues can be closed and merged in the PR: https://github.com/R1KO/VIP-Core/pull/105

Thanks again for the support.

crashzk commented 1 year ago

@R1KO news on this implementation, can it be merged now? https://github.com/R1KO/VIP-Core/pull/105

I'm using the 3.1-dev branch and it doesn't have this change in it yet, would it be possible to include it in it, or something like that?