SQLCOINS [Skript 2.2, skQuery, MySQL]

Script SQLCOINS [Skript 2.2, skQuery, MySQL] 1.0.000

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Contributors
HiiqhFive
Supported Minecraft Versions
  1. 1.7
  2. 1.8
  3. 1.9
  4. 1.10
  5. 1.11
SQL COINS
for Skript 2.2


This script implements a currency with MySQL Integration of skQuery.
PS: I hate designing ressource threads, thats why it's looking shitty. lol.

law_trennlinie.png

DEPENDENCIES

• Skript (at least version 2.2)
• SkQuery
• A MySQL Database


law_trennlinie.png

HOW TO INSTALL


1. Install Skript v2.2 on your Spigot/Bukkit server.
2. Go to "plugins\Skript\scripts"
3. upload the required file.
4. open the mentioned file and set up the database connection (example inside the config)
5. Restart your server or type "/sk reload <script name>"
(in this case: /sk reload SQL-COINS_1.0.000)


law_trennlinie.png

PICTURES

qqxsgjc9.png

cxpzdmtu.png


law_trennlinie.png

COMMANDS & PERMISSIONS


• /money [<player>] » Displays the cash of a player.
• /eco » Displays admin commands.

law_trennlinie.png

CONFIG

code_language.skript:
options:
    prefix: &8[&cSQLC&8]
    # If you have a server with more than 20 players, it's recommended to activate this option. (Available: True, False)
    run_async: "true"
    # Do you want to allow cheating commands? (Available: True, False)
    allow_admincmd: "true"

    # messages
    addcoins_success: &aCoins added to target's account.
    addcoins_setsuccess: &aTarget's cash was set to given amount.
    remcoins_removesuccess:    &aRemoved Coins from target's account.
    remcoins_resetsuccess:    &aReset target's account.
    
    show_cash_me: &aYou have &e[AMOUNT] &aCoins available.
    show_cash_player: &aPlayer &6[PLAYER] &ahas &e[AMOUNT] &aCoins available.
    
    version: 1.0.000

code_language.skript:
# /*
# * Before using this script, you have to set up your database connection.
# * Here is a little example how to configure it:
# *    $ db url jdbc:mysql://127.0.0.1:3306/coins
# *    $ db username hiiqhfive 
# *    $ db password ouas0998b 
# */

law_trennlinie.png

API
code_language.skript:
checkCoins(target player)
# Example: checkCoins(player)
# Returns a number. (Cash of target player)

hasAmount(target player, amount of cash)
# Example: hasAmount(player, 5000)
# Returns a boolean.

addCoins(target player, amount of cash, [setting option])
# Examples:
#    Without setting to a specific number: addCoins(player, 3000)
#    With setting to a specific number: addCoins(player, 3000, 1)
#    --> Account will be set to given amount at arg 2.
# Returns a message.

removeCoins(target player, amount of cash, [reset option])
# Examples:
#    Without reset: removeCoins(player, 1234)
#    With reset: removeCoins(player, 0, 1)
#    --> Account will be reset to 0 coins
# Returns a message.

law_trennlinie.png

If you have any suggestions, post it in comments!
Have fun! :emoji_slight_smile:
  • Like
Reactions: WaxtzCraft
Author
HiiqhFive
Downloads
359
Views
929
First release
Last update
Rating
4.60 star(s) 5 ratings

More resources from HiiqhFive

Latest reviews

Hey, i have all installed and connected to mysql no errors but if i check /money they send me <none>
Is this skript allready updated with skellet and not SkQuery?
And if it is updated how do i use it now or is it the same?
HiiqhFive
HiiqhFive
Nah, didn't find some time to do that - but I will definetly update it in the future.
Nice, but Skquery mysql is broken and not supported with the "unofficial" skquery update, can you update this script using Skellett's mysql syntax? That would be really nice ;)
HiiqhFive
HiiqhFive
I will.
good script but " Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available."

I'd like to edit peoples gold through PHPMYADMIN

How can i fix htis?
thanks
Excellent script. Good for Minigame servers! Is there a way to add Scoreboards and Add the money to it so it shows you how much money you have on the scoreboard? :) Also, can this be added to Minigame scripts, so whenever you win a game you will get money and it will add +10 or something in the database? :)

Also, since you are good at MySQL + Script, please look at my post. (I need help)

https://forums.skunity.com/threads/adding-mysql-to-script.2928/

Thanks!
HiiqhFive
HiiqhFive
Thanks for your review, I'm appreciating it!
SQLC contains a lot of API's which can be used very easy. So Just look for the right funtion and use it.

I'll take a look when I'm at home. :)