Autorank

Autorank

380k Downloads

Can i change days?

Davincstyle opened this issue ยท 4 comments

commented

Dear autorank creators,

Can i change the Days in hours on my server?

Example: (name) - 15day(s),4 hour(s) and 35 minutes
into
(name) - 493 Hours

commented

No, that is not possible. Autorank works internally and externally with minutes.

commented

Well you can change it in /ar leaderboard with the advanced config. Just not in other commands like /ar check, a layout for every command might be a nice feature to add actually.
change
leaderboard layout: '&6&r | &b&p - &7&d day(s), &h hour(s) and &m minute(s).'
to something like
leaderboard layout: '&6&r | &b&p - &7&th hour(s).'

commented

@Staartvin I actually have some code from an unreleased plugin that reads messages from a config and fills in the parameters. If you're planning on doing something similar you can use it as an example.
You request a message here http://pastebin.com/R34f6yMP
This is the message class http://pastebin.com/awyfjUei
You call the argument (should have called it parameter) methods to fill in all parameters that might be appropriate for that message. It also tries to do some fancy stuff where when you do %s it goes backwards in the string to find a number and see if it's "player" or "players" for example. Though that probably needs more testing.
So with that I can do something like Messages.get("lobbyPreyWon").argument(map).argument(stalker.getPlayer()).broadcast();

EDIT: just took a look at the current language system and it already does something similar only with less options for dynamically changing the message, might be good enough though and probably better performing :P

commented

Thanks for the classes, but I'm not sure I'm going to use them. This might be useful for other features, though.