Simple adjustment to the src

Status
This thread has been locked.

Asodey

This title is for sale, dm me
Premium
Feedback score
75
Posts
1,530
Reactions
645
Resources
6
Greetings!

I've been working on a LevelPoints shop, basically I implemented everything (checks etc) using the DeluxeMenus plugin, there is an issue where the player (an operator of the server) can add levels to somebody else while the console can not (in this case, I can not take a player's level through console, but can do it via ingame)

basically when I execute the command
"/lps addlevel {name} -175" in the game it does work, however, when I execute it through the console it just does nothing (no errors or anything, literally just does nothing). The plugin I am using for the levels is LevelPoints and it is open source. Is it possible that somebody here can help and enable the command through console ?

Plugin Page - https://www.spigotmc.org/resources/levelpoints-1-8-1-15-mysql.63996/
Plugin SRC - https://github.com/Zoon20X/LevelPoints-Recoded

Currently I am unable to pay but I am willing to leave a positive message on your profile if you can get this done. I am not trying to be disrespectful towards the developers on this market, but as far as I am aware it should be an easy job (correct me if I am wrong).

Thank you for your time, Asodey! <3
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

SpeedyQuickCoding

Feedback score
1
Posts
76
Reactions
15
Resources
0
The reason that it does nothing, is because every single time you issue any type of command, you are only checking if the sender has a permission, the console executing commands bypasses permissions and it's not possible to check if the console has a permission thus the commands do nothing. On these commands, I would check if the sender is InstanceOf Player, if not then do whatever you want the commands to do, else check if sender is player and then check that players permissions.

So for example in your case this plugin is checking if the player has the permission, but you're sending a message to a player that does not exist. For example I would do Bukkit.getConsole(Something).sendMessage(Insufficient Permissions).


Code:
if (args[0].equalsIgnoreCase("addlevel")) {
if(sender instanceOf Player) {
if (player.hasPermission("lp.admin")) {
//do stuff
}
}else {
//do stuff

If you have any questions, please add me on Discord Dustin#7168
 
Last edited:
Status
This thread has been locked.
Top