-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial: Rewards Management
Rewards are one of the best parts of CityZen, rewarding players for their contributions and engagement. Rewards are set by server owners, and can be managed in one of two ways: with commands or directly in rewards.yml. Before you begin, it's a good idea to read over the rewards page to figure out what properties you want to set for your reward.
One of the simplest ways to manage rewards is to use the in-game commands. This allows the plugin to check your properties to reduce error, as well as making sure everything's formatted correctly. Standard users will probably find this interface easier to use. One downside is that it's difficult to make small changes to rewards if you mess up or want to adjust something.
A list of available rewards can be shown with /cityzen reward list, which displays all the properties of each reward.
When you want to create a reward, simply use the following command:
/cityzen reward add <Citizen | City> <initialRep> <intervalRep> <isBroadcast> <command...>
Where:
-
<Citizen | City>is either "citizen" or "city," depending on whether you want it to be a Citizen or City reward. -
<initialRep>is the starting reputation for this reward -
<intervalRep>is the interval at which this reward is distributed -
<isBroadcast>is "true" or "false" depending on whether or not you want this reward's message to be broadcast to the server -
<command...>is the command you want this reward to run. You can use the variables listed on the rewards page to represent player names and more. Spaces are allowed.
Next, if you want your reward to display a message when distributed, you can run the following command:
/cityzen reward message <rewardID> <message...>
Where <rewardID> is the ID number of the reward you just created (use the list command if you don't know it) and <message...> is the message to add to this reward. Supports spaces, color codes, and variables. Remember: semicolons are NOT allowed!
Rewards can be easily deleted with the command /cityzen reward delete <rewardID> where <rewardID> is the ID number of the reward you want to delete. You can find ID numbers with the list command.
Alternatively, you can manage rewards by editing the rewards.yml file. This is more for advanced users, as it offers more direct control over each reward, however it's much easier to break something if you don't know what you're doing. Rewards in this file are listed in the rewards section in the format id;type;initialRep;intervalRep;isBroadcast;command;message where each of the properties is separated by a semicolon. Do not use semicolons in your reward variables, as this will make the reward invalid!
Before editing, it's a good idea to run /cityzen save in chat. This is because you will be reloading your config when you finish, and you don't want to overwrite any unsaved data.
To create a reward, simply type one on a new line following the same format. The ID should be a unique integer, but not necessarily sequential to existing IDs. To delete a reward, simply delete one of the lines. You should not modify the IDs of rewards, as this may mess up reward scheduling. You can also edit any reward property here, so long as you set it to a valid value.
When you're done editing, save your file back and run /cityzen reload in chat to load these changes into memory. If you wait too long to reload, your changes might get saved over by the autosave function, so be sure to reload promptly.