SHARE
TWEET

Kod na komendę /itemshop

a guest May 19th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fcode.adyoo.itemshop.commands;
  2.  
  3. import fcode.adyoo.itemshop.apis.fcodeApi;
  4. import fcode.adyoo.itemshop.utils.ChatUtil;
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandExecutor;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10.  
  11. public class ItemShopCommand implements CommandExecutor {
  12.  
  13.     @Override
  14.     public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
  15.         if(sender.hasPermission("firecode.itemshop.cmd")){
  16.             if(args.length==0){
  17.                 sender.sendMessage(ChatUtil.fixColors("&cPoprawne uzycie: /itemshop (nick) (VIP/SVIP/SPONSOR)"));
  18.                 return false;
  19.             }
  20.             if(args.length==1){
  21.                 sender.sendMessage(ChatUtil.fixColors("&cfCode> Musisz podac nick gracza!"));
  22.                 return false;
  23.             }
  24.             if(args[1].equalsIgnoreCase("VIP")){
  25.                 Player target = Bukkit.getPlayer(args[0]);
  26.                 Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pex user "+target.getName()+" group set VIP");
  27.                 for(Player all : Bukkit.getOnlinePlayers()){
  28.                     fcodeApi.sendTitle(all.getPlayer(), "&c"+target.getName()+" &7zakupil range &6VIP", "&7Dziekujemy za wsparcie serwera!");
  29.                     return true;
  30.                 }
  31.             }
  32.             if(args[1].equalsIgnoreCase("SVIP")) {
  33.                 Player target = Bukkit.getPlayer(args[0]);
  34.                 Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pex user " + target.getName() + " group set SVIP");
  35.                 for (Player all : Bukkit.getOnlinePlayers()) {
  36.                     fcodeApi.sendTitle(all.getPlayer(), "&c" + target.getName() + " &7zakupil range &eSVIP", "&7Dziekujemy za wsparcie serwera!");
  37.                     return true;
  38.                 }
  39.             }
  40.             if(args[1].equalsIgnoreCase("SPONSOR")) {
  41.                 Player target = Bukkit.getPlayer(args[0]);
  42.                 Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pex user " + target.getName() + " group set Sponsor");
  43.                 for (Player all : Bukkit.getOnlinePlayers()) {
  44.                     fcodeApi.sendTitle(all.getPlayer(), "&c" + target.getName() + " &7zakupil range &9SPONSOR", "&7Dziekujemy za wsparcie serwera!");
  45.                     return true;
  46.                 }
  47.             }else{
  48.                 sender.sendMessage(ChatUtil.fixColors("&cPoprawne uzycie: /itemshop (nick) (VIP/SVIP/SPONSOR)"));
  49.                 return false;
  50.             }
  51.         }
  52.         return false;
  53.     }
  54. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top