Hi all,
I have been using skript for a couple months. Right now I have a plugin that is storing player data in a MySQL database. I'm trying to use Skellet in order to retrieve players data and use it for other commands. However there aren't many examples of how to do this out there, and I'm new to MySQL and coding. This is also my first forum post.
I want to write a skript where players can access their account balance. Right now that is stored in the database 'minigame', the table 'players' and the column 'balance.' The table 'players' also has the columns 'UUID' and 'NAME'.
So something like:
command /bal:
trigger:
set {_playername} to player
set mysql host to "somehost"
set mysql username to "someusername"
set mysql password to "somepassword"
set mysql database to "minigame"
connect to mysql
set {_result} to mysql result of query "SELECT * FROM players WHERE NAME="%{_playername}%" "
set {_balance} to integer in {_result}
send "%{_balance}% is your balance" to player
Thanks in advance for any help you can provide!
I have been using skript for a couple months. Right now I have a plugin that is storing player data in a MySQL database. I'm trying to use Skellet in order to retrieve players data and use it for other commands. However there aren't many examples of how to do this out there, and I'm new to MySQL and coding. This is also my first forum post.
I want to write a skript where players can access their account balance. Right now that is stored in the database 'minigame', the table 'players' and the column 'balance.' The table 'players' also has the columns 'UUID' and 'NAME'.
So something like:
command /bal:
trigger:
set {_playername} to player
set mysql host to "somehost"
set mysql username to "someusername"
set mysql password to "somepassword"
set mysql database to "minigame"
connect to mysql
set {_result} to mysql result of query "SELECT * FROM players WHERE NAME="%{_playername}%" "
set {_balance} to integer in {_result}
send "%{_balance}% is your balance" to player
Thanks in advance for any help you can provide!