Files
apollo/game/plugin/cmd/src/messaging-cmd.plugin.kts
T
2017-09-24 22:35:07 +01:00

12 lines
392 B
Kotlin

import org.apollo.game.model.entity.setting.PrivilegeLevel
on_command("broadcast", PrivilegeLevel.ADMINISTRATOR)
.then { player ->
val message = arguments.joinToString(" ")
val broadcast = "[Broadcast] ${player.username.capitalize()}: $message"
player.world.playerRepository.forEach { other ->
other.sendMessage(broadcast)
}
}