post the code please
|
Alright community!
This is the problem i got, when i add my vote command (to claim the reward ) in regularcommands it does not work for anyone, but if i delete if from regularcommand and add it into admincommands it works "only for admins thougt"
The cmd prints no error.
Thank you!
Regularcommands: http://pastebin.com/gPyzysUS
Admincommands: http://pastebin.com/3fiJxqXN
post the code please
Doubt these might work but you should try:
1st:
Try putting your claim and auth commands directly underneath this line:
If that don't work, try adding a playerright check? LikeCode:public static void handleRegularCommands(Client c, String playerCommand) {
Code:c.playerRights == 7
Hmm. Do you still have a commands.java or have you just divided it into different classes based on playerrights?
Code:package server.model.players.packets; import java.sql.ResultSet; import server.Config; import server.Connection; import server.Server; import server.model.npcs.NPCHandler; import server.model.players.Client; import server.model.players.PacketType; import server.model.players.Player; import server.model.players.PlayerHandler; import server.model.players.PlayerSave; import server.world.ClanHandler; import server.world.ShopHandler; import server.model.players.Teleport; import server.model.players.commands.*; /** * Commands **/ public class Commands implements PacketType { @Override public void processPacket(Client c, int packetType, int packetSize) { String playerCommand = c.getInStream().readString(); RegularCommands.handleRegularCommands(c, playerCommand); ModeratorCommands.handleModeratorCommands(c, playerCommand); AdminCommands.handleAdminCommands(c, playerCommand); OwnerCommands.handleOwnerCommands(c, playerCommand); //DeveloperCommands.handleDeveloperCommands(c, playerCommand); } }
try adding, not sure if it will help but just a thought haha
EDIT: Actually does it do it with all regular commands or just the vote one?Code:if(c.playerRights <= 0) { return; }
EDIT2: after looking at the commands in regualr you need to add else if to the vote commands. so like this
Code:else if (playerCommand.startsWith("reward") || playerCommand.startsWith("claim")) {Code:else if (playerCommand.startsWith("auth") && playerCommand.length() > 5) {Code:else if(playerCommand.startsWith("vote")) {
if (playerCommandStartsWith("Vote") && c.playerRights == 0) {
something like that :X
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |