Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you add prices to classes #309

Open
zmw1234 opened this issue Jan 11, 2015 · 6 comments
Open

How do you add prices to classes #309

zmw1234 opened this issue Jan 11, 2015 · 6 comments

Comments

@zmw1234
Copy link

zmw1234 commented Jan 11, 2015

Some one please help. How can i make so each class has a set price to buy.

@Europia79
Copy link

use the doCommands to charge players.

edit /plugins/BattleArena/classes.yml

Here's an example:

classes:
    Vector:
        displayName: "&1Vector"
        items:
            - 2256: 1 # record_13.png
            - 2257: 1 # Colt Handgun - record_cat.png
            - 402: 2 # M67 Grenades
            - 345: 1 # Compass for directions
            - 295: 64 # Ammo = Seeds
            - 295: 64 # Ammo = Seeds
        enchants:
            - speed:2:900
        doCommands:
            - console money take player 100

Except substitute money take with the equivalent command of your economy plugin.
And substitute 100 with the actual amount that you want to charge.

console means that the cmd will be run as the console CommandSender.
player will be replaced with the player selecting the class.

@zmw1234
Copy link
Author

zmw1234 commented Jan 12, 2015

How would i make it check to see if the player has enough money ? what if they have less then the amount i dont want them to be able to have the class if they do.

@zmw1234
Copy link
Author

zmw1234 commented Jan 12, 2015

also what do i put for the docommand

@Europia79
Copy link

Good point about not having enough money... That will have to be fixed.
I'll have to add either a 'cost' or 'preReqs' section... And maybe a refund section too... So servers can configure the refund amount if a player switches classes. (either full, partial, or none - specified by amount).

As far as the specific command to take money: I'm not sure. It would probably depend on what economy plugin that you're using. The general form would be this:
console money take player 100

Here are some possible future options:

classes:
    Vector:
        displayName: "&1Vector"
        items:
            - 2256: 1 # record_13.png
            - 2257: 1 # Colt Handgun - record_cat.png
            - 402: 2 # M67 Grenades
            - 345: 1 # Compass for directions
            - 295: 64 # Ammo = Seeds
            - 295: 64 # Ammo = Seeds
        enchants:
            - speed:2:900
        doCommands:
            - console money take player 100
        preReqs:
            options: [money=100]
        cost: 100
        refund: 90

What do you think ?

@zmw1234
Copy link
Author

zmw1234 commented Jan 12, 2015

i like the preReqs option i think people will like to see that i also think people will like a refund option. I really hope you add thes options in so i can use on my server.

Also the docommand is not working for me for some reason. Its not taking money from players im using iconomy for the money. I think you should just add a price option to the classes.

@zmw1234
Copy link
Author

zmw1234 commented Jan 12, 2015

I fixed the money issue but now we are trying to give items custom names when there enchanted. Is there a way to do that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants