Skip to content

Commit

Permalink
Added method to print out a message to console and send it to player …
Browse files Browse the repository at this point in the history
…if he has the needed privileges
  • Loading branch information
CloudS3c committed May 22, 2023
1 parent a7804d7 commit 37719fc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions game/plugins/src/main/kotlin/gg/rsmod/plugins/api/ext/PlayerExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ fun Player.message(message: String, type: ChatMessageType = ChatMessageType.CONS
write(MessageGameMessage(type = type.id, message = message, username = username))
}

/**
* Print message in Servers Terminal and send message if player has reqPrivilege
*/
fun Player.printAndMessageIfHasPower(message: String, privilege: String) {
if (isPrivilegeEligible(privilege)) {
message(message)
}
println(message)
}


fun Player.nothingMessage(){
message(Entity.NOTHING_INTERESTING_HAPPENS)
}
Expand Down

0 comments on commit 37719fc

Please sign in to comment.