- Плагин
- Placeholderapi
- Ядро сервера
- Paper
- Версия сервера
- 1.12.2
В плагине Papi есть заполнитель %skinsrestorer_getSkinName%, он выводит скин игрока, но если скина нет, он пишет None. Заместо None, я хочу выводить ник игрока.
Я знаю что это - делается через javascript (как делать, я не знаю)
Я написал:
Я знаю что это - делается через 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();
Последнее редактирование: