This plugin allow server owners to issue time-based permission / rank to players. Time-based permissions/rank can be used as
Doesn't permission plugin like PermissionsEx have timer feature?
Yes, and if it's working for you, you would not need this plugin. However, if it's not working as you wanted or if your permission plugin does not have timer based permission/rank feature, this plugin is for you.
With this plugin, even if the server shuts down/restart/crash, timer information is still kept safe and when the server resumes the timer will resume counting down. Also, timer will be monitored for offline players too. And expired permissions/ranks are re-checked at the time of player login to make sure they are indeed expired.
Test Server:
You can customise
Installation:
Put PermissionTimer.jar in the plugins folder.
Dependency:
Vault (you need this to interface PermissionTimer and your permission plugin)
Example Usage:
You can access player's timer-based permissions/ranks informaiton through its public methods:
Code (Text):
import com.vk2gpz.permissiontimer.PermissionTimer;
...
public PermissionTimer getPermissionTimer() {
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("PermissionTimer");
if ((plugin == null) || (!(plugin instance PermissionTimer)) {
return null;
}
return (PermissionTimer)plugin;
}
....
PermissionTimer ptimer = getPermissionTimer();
....
Map<String, Long> perm_rank_list = ptimer.getPermissions(player); //player can be OfflinePlayer
for (String perm_rank : perm_rank_list.keySet()) {
long expires = perm_rank_list.get(key);
// do your own process here.
}
...
- voting rewards (any servers in general)
- pvp rewards (PvP, Faction, KitPvP servers)
- mining rewards (Prison Servers), etc.
Doesn't permission plugin like PermissionsEx have timer feature?
Yes, and if it's working for you, you would not need this plugin. However, if it's not working as you wanted or if your permission plugin does not have timer based permission/rank feature, this plugin is for you.
With this plugin, even if the server shuts down/restart/crash, timer information is still kept safe and when the server resumes the timer will resume counting down. Also, timer will be monitored for offline players too. And expired permissions/ranks are re-checked at the time of player login to make sure they are indeed expired.
Test Server:
- Please contact me to get test server information.
- /ptimer help : displays a help menu
- /ptimer reload : reloads the config.yml
- /ptimer info [name] : Display your (or [name]'s) time-based permissions.
- /ptimer give <name> <common-perm-name|rank> [permermission-node] [time:duration] [world:worldname]: Gives <name> a permission <common-perm-name> or a rank <rank>. If [node] and [duration] are not specified, the <common-perm-name|rank> specified in the config.yml will be used.
- /ptimer remove <name> <common-perm-name | rank> : Removes the permission <common-perm-name> or the rank <rank> from <name>.
- /ptimer giveaway <name> <common-perm-name | rank> : Stop the timer for this particular permission|rank and give it to the player.
- permissiontimer, ptimer
- permissiontimer.reload : allows you to use /ptimer reload
- permissiontimer.info: allows you to use /ptimer info command
- permissiontimer.admin: allows you to use /ptimer give and remove command
You can customise
- common name of a permission node, for instance "fly" for "essentials.fly",
- limit the number of times a player can use a permission,
- duration/expiration of a permission,
- messages for each permission given/removed.
Installation:
Put PermissionTimer.jar in the plugins folder.
Dependency:
Vault (you need this to interface PermissionTimer and your permission plugin)
Example Usage:
- Code (Text):
/ptimer give TestUser fly perm:essentials.fly time:10m
will give the user "TestUser" the Essential permission "essentials.fly" for 10 minutes. - Code (Text):
/ptimer give TestUser VIP 1d
will give the user "TestUser" the "VIP" rank for 1 day.
You can access player's timer-based permissions/ranks informaiton through its public methods:
Code (Text):
import com.vk2gpz.permissiontimer.PermissionTimer;
...
public PermissionTimer getPermissionTimer() {
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("PermissionTimer");
if ((plugin == null) || (!(plugin instance PermissionTimer)) {
return null;
}
return (PermissionTimer)plugin;
}
....
PermissionTimer ptimer = getPermissionTimer();
....
Map<String, Long> perm_rank_list = ptimer.getPermissions(player); //player can be OfflinePlayer
for (String perm_rank : perm_rank_list.keySet()) {
long expires = perm_rank_list.get(key);
// do your own process here.
}
...