Вопрос PlaceholderApi заполнитель Javascript

Flaimer

Переводчик
Пользователь
Сообщения
672
Решения
57
Веб-сайт
mcsnapix.ru
Плагин
Placeholderapi
Ядро сервера
  1. Paper
Версия сервера
  1. 1.12.2
В плагине Papi есть заполнитель %skinsrestorer_getSkinName%, он выводит скин игрока, но если скина нет, он пишет None. Заместо None, я хочу выводить ник игрока.

Я знаю что это - делается через javascript (как делать, я не знаю)
Авто объединение сообщений:

Я написал:
JavaScript:
// create a variable and name it wantever you want like this
// and use the placeholder you want, i'm using this one
var haspermission = "%skinsrestorer_getSkinName%";

// create a function with the name you want
function permission() {

// if the haspermission variable that we created before return yes (true boolean)
// the js placeholder will return what we set in the return down
   if (haspermission === "None") {
       return "%player_name%";
   }

// if the haspermission varibale wasnt true it will return what we set down
   else {
       return "%skinsrestorer_getSkinName%";
   }
}
// by this we are calling the function to run
permission();
 
Последнее редактирование:
Назад
Сверху Снизу