@Override
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    	if(cmd.getName().equalsIgnoreCase("duty")){
    		if (!(sender instanceof Player)) { //if not sent by player fail
    			sender.sendMessage("This command can Only be run by a player");
    			return false;
    		} else {   
        		if (args.length == 1) { //if has arguement
        			if (args[0].equalsIgnoreCase("silent")) { //check arguement is silent
        				if (sender.hasPermission("guards.duty.silent")){ //if user has permission
        					plugin.silent=true; //set silent to true
        				}
        			}
        		}
        		//If there is no arguement
    			Player player = (Player) sender; //cast sender to player 
    			String name = player.getName(); //get player name
    			if (player.hasPermission("guards.duty")) { //if player has perms
    				if (!plugin.onDuty.contains(name)) { //If they are not on duty
    		              setOnDuty(player, plugin.silent); //set onduty
    		              plugin.onDuty.add(name); //add to list
    		              return true;
    		            } else if (plugin.onDuty.contains(name)) { //if they are on duty
    		              setOffDuty(player, plugin.silent); //set off Duty
    		              plugin.onDuty.remove(name); //remove name from list
    		              return true;
    		            }
    				}
    			}
    		}
		return false; 
	}