Jump to content
Korean Random

Как правильно использовать условные/тернарные операторы в макросах?


Go to solution Solved by Bazooka,

Recommended Posts

Всем привет, недавно решил кастомизировать немного свой конфиг. Если по конкретике, я хочу выводить средний урон по технике в playerPanel.xc, только в том случае, если боев на танке больше 100:
 

{{?t-battles>=100}}DMG: <font color='{{c:xtdb}}'>{{tdb%d}}</font>

Так же хотел добавить условие проверки на анонимайзер, чтобы не выводить строку для анонимных игроков
К слову, какие языки программирования в конфиге XVM поддерживаются? И где можно найти больше примеров использования макросов?
 

Link to comment
Short link
Share on other sites

  • Solution

The {{anonym}} macro only works for the player and their platoon mates. It won't work for other players because it's impossible to determine whether a player is anonymous or simply has no statistics.

Therefore, if you want to hide the row for "anonymous" players, you'll need to hide the row for anyone without statistics, and keep in mind that this will include both anonymous players and regular players.

Link to comment
Short link
Share on other sites

1 час назад, Bazooka сказал:

The {{anonym}} macro only works for the player and their platoon mates. It won't work for other players because it's impossible to determine whether a player is anonymous or simply has no statistics.

Therefore, if you want to hide the row for "anonymous" players, you'll need to hide the row for anyone without statistics, and keep in mind that this will include both anonymous players and regular players.

hmm, thanks for the explanation! I thought it was quite simple to check: if no stats are found for a player, he is probably playing with an anonymizer
Thanks for the sources as well, although I've already familiarized myself with them :)

1 час назад, HEKPOMAHT сказал:

так наверно:

 

{{anonym?|{{t-battles>100?DMG: <font color='{{c:xtdb}}'>{{tdb%d}}</font>}}}}

Да, это как раз то что мне нужно, работает. Спасибо)

Link to comment
Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...