Hello, I don't know why but I have some errors with this plugin when I want to execute /sethome command... It's a home plugin with a MySql database, to keep players home's locations. Thanks for your help ! Just for you : La commande est /sethome = Unknow command. Votre home a bien été posé = Your home is now set.
@Aragone Change this: Code:Java public SqlHomePlugin sql; to something like this: Code:Java public SqlHomePlugin sql = /*SqlHomePlugin instance*/; EDIT: I also recommend you make the MySQL table have a yaw and a pitch so you can choose where the player is looking when using '/home'
I try but... What's SqlHomePlugin instance ? I tried public SqlHomePlugin sql = new SqlHomePlugin(connection()) but it doesn't work EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Can you just show me what are you thinking ? Because I'm really stuck. I think I understand the problem but I don't know the syntax to resolve it.
@Aragone Code:Java private SqlHomePlugin sql; // This is a CommandHome constructor// It has a parameter of type SqlHomePlugin// We give it the SqlHomePlugin instance// when we initialize CommandHomepublic CommandHome(SqlHomePlugin sql) { // We now set our variable to the // instance that was passed to this object this.sql = sql;}
Thanks for your answer. I have now this error : Implicit super constructor commandHome is undefined in my SqlHomePlugin class. I had too to add 'sql' in my main class in the getCommand instruction.
@Aragone Why does SqlHomePlugin extend CommandHome? Also, don't create two instances of your CommandHome class when you register the commands, make a variable with an instance and pass the variable when you register the commands.
SqlHomePlugin extend CommandHome because of the public static double x, y and z. I put them into the method 'createAccount' 'addX' 'addY' and 'addZ' How can I do what you said ?
Ok now I have a problem with my database. There is a problem with sql.createAccount(player). EDIT : Erreur de synthaxe = Syntax error
@Aragone I would guess that has to do with your SQL Statement. It's been a while since i've worked with SQL, so i can't really help you there.